Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
ae0bac79
Commit
ae0bac79
authored
Aug 18, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak comments and variable names per Harris's review.
parent
6e4c5ce3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
http.c++
c++/src/kj/compat/http.c++
+4
-4
http.h
c++/src/kj/compat/http.h
+4
-4
No files found.
c++/src/kj/compat/http.c++
View file @
ae0bac79
...
...
@@ -2168,7 +2168,7 @@ private:
}
uint64_t
getPayloadLen
()
const
{
byte
payloadLen
=
bytes
[
1
]
&
PAYLOAD_MASK
;
byte
payloadLen
=
bytes
[
1
]
&
PAYLOAD_
LEN_
MASK
;
if
(
payloadLen
==
127
)
{
return
(
static_cast
<
uint64_t
>
(
bytes
[
2
])
<<
56
)
|
(
static_cast
<
uint64_t
>
(
bytes
[
3
])
<<
48
)
...
...
@@ -2188,7 +2188,7 @@ private:
Mask
getMask
()
const
{
if
(
bytes
[
1
]
&
USE_MASK_MASK
)
{
byte
payloadLen
=
bytes
[
1
]
&
PAYLOAD_MASK
;
byte
payloadLen
=
bytes
[
1
]
&
PAYLOAD_
LEN_
MASK
;
if
(
payloadLen
==
128
)
{
return
Mask
(
bytes
+
10
);
}
else
if
(
payloadLen
==
127
)
{
...
...
@@ -2210,7 +2210,7 @@ private:
required
+=
4
;
}
byte
payloadLen
=
bytes
[
1
]
&
PAYLOAD_MASK
;
byte
payloadLen
=
bytes
[
1
]
&
PAYLOAD_
LEN_
MASK
;
if
(
payloadLen
==
127
)
{
required
+=
8
;
}
else
if
(
payloadLen
==
126
)
{
...
...
@@ -2228,7 +2228,7 @@ private:
static
constexpr
byte
OPCODE_MASK
=
0x0f
;
static
constexpr
byte
USE_MASK_MASK
=
0x80
;
static
constexpr
byte
PAYLOAD_MASK
=
0x7f
;
static
constexpr
byte
PAYLOAD_
LEN_
MASK
=
0x7f
;
};
static
constexpr
byte
OPCODE_CONTINUATION
=
0
;
...
...
c++/src/kj/compat/http.h
View file @
ae0bac79
...
...
@@ -388,7 +388,7 @@ class WebSocket {
//
// Ping/Pong and message fragmentation are not exposed through this interface. These features of
// the underlying WebSocket protocol are not exposed by the browser-level Javascript API either,
// and thus applications typically need to implement these features at the applica
it
on protocol
// and thus applications typically need to implement these features at the applica
ti
on protocol
// level instead. The implementation is, however, expected to reply to Ping messages it receives.
public
:
...
...
@@ -436,7 +436,7 @@ public:
kj
::
StringPtr
statusText
;
const
HttpHeaders
*
headers
;
kj
::
Own
<
kj
::
AsyncInputStream
>
body
;
// `statusText` and `headers` remain valid until `body` is dropped.
// `statusText` and `headers` remain valid until `body` is dropped
or read from
.
};
struct
Request
{
...
...
@@ -469,7 +469,7 @@ public:
kj
::
StringPtr
statusText
;
const
HttpHeaders
*
headers
;
kj
::
OneOf
<
kj
::
Own
<
kj
::
AsyncInputStream
>
,
kj
::
Own
<
WebSocket
>>
webSocketOrBody
;
// `statusText` and `headers` remain valid until `
upstreamOrBody` is dropped
.
// `statusText` and `headers` remain valid until `
webSocketOrBody` is dropped or read from
.
};
virtual
kj
::
Promise
<
WebSocketResponse
>
openWebSocket
(
kj
::
StringPtr
url
,
const
HttpHeaders
&
headers
);
...
...
@@ -590,7 +590,7 @@ kj::Own<WebSocket> newWebSocket(kj::Own<kj::AsyncIoStream> stream,
// sent and received on the stream. Normally applications would not call this directly.
//
// `maskEntropySource` is used to generate cryptographically-random frame masks. If null, outgoing
// frames will not be masked. Servers are
not required
to mask their outgoing frames, but clients
// frames will not be masked. Servers are
required NOT
to mask their outgoing frames, but clients
// ARE required to do so. So, on the client side, you MUST specify an entropy source. The mask
// must be crytographically random if the data being sent on the WebSocket may be malicious. The
// purpose of the mask is to prevent badly-written HTTP proxies from interpreting "things that look
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment