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
ba889908
Commit
ba889908
authored
Oct 12, 2017
by
Kenton Varda
Committed by
GitHub
Oct 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #569 from ecatmur/http-header-null-reference
Don't bind Header reference to a null pointer.
parents
eadeea59
d909c711
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
http.c++
c++/src/kj/compat/http.c++
+4
-3
No files found.
c++/src/kj/compat/http.c++
View file @
ba889908
...
...
@@ -1953,8 +1953,7 @@ public:
}
kj
::
Promise
<
Message
>
receive
()
override
{
auto
&
recvHeader
=
*
reinterpret_cast
<
Header
*>
(
recvData
.
begin
());
size_t
headerSize
=
recvHeader
.
headerSize
(
recvData
.
size
());
size_t
headerSize
=
Header
::
headerSize
(
recvData
.
begin
(),
recvData
.
size
());
if
(
headerSize
>
recvData
.
size
())
{
if
(
recvData
.
begin
()
!=
recvBuffer
.
begin
())
{
...
...
@@ -1982,6 +1981,8 @@ public:
});
}
auto
&
recvHeader
=
*
reinterpret_cast
<
Header
*>
(
recvData
.
begin
());
recvData
=
recvData
.
slice
(
headerSize
,
recvData
.
size
());
size_t
payloadLen
=
recvHeader
.
getPayloadLen
();
...
...
@@ -2231,7 +2232,7 @@ private:
}
}
s
ize_t
headerSize
(
size_t
sizeSoFar
)
{
s
tatic
size_t
headerSize
(
byte
const
*
bytes
,
size_t
sizeSoFar
)
{
if
(
sizeSoFar
<
2
)
return
2
;
size_t
required
=
2
;
...
...
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