Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
984d1e9e
Commit
984d1e9e
authored
9 years ago
by
Tatsuhiro Tsujikawa
Committed by
Jay Satiro
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
http2: Fix PUSH_PROMISE headers being treated as trailers
Discussed in
https://github.com/bagder/curl/pull/564
parent
d9b4d1ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/http2.c
+17
-17
17 additions, 17 deletions
lib/http2.c
with
17 additions
and
17 deletions
lib/http2.c
+
17
−
17
View file @
984d1e9e
...
...
@@ -771,23 +771,6 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
return
NGHTTP2_ERR_CALLBACK_FAILURE
;
}
if
(
stream
->
bodystarted
)
{
/* This is trailer fields. */
/* 3 is for ":" and "\r\n". */
uint32_t
n
=
(
uint32_t
)(
namelen
+
valuelen
+
3
);
DEBUGF
(
infof
(
data_s
,
"h2 trailer: %.*s: %.*s
\n
"
,
namelen
,
name
,
valuelen
,
value
));
Curl_add_buffer
(
stream
->
trailer_recvbuf
,
&
n
,
sizeof
(
n
));
Curl_add_buffer
(
stream
->
trailer_recvbuf
,
name
,
namelen
);
Curl_add_buffer
(
stream
->
trailer_recvbuf
,
":"
,
1
);
Curl_add_buffer
(
stream
->
trailer_recvbuf
,
value
,
valuelen
);
Curl_add_buffer
(
stream
->
trailer_recvbuf
,
"
\r\n\0
"
,
3
);
return
0
;
}
/* Store received PUSH_PROMISE headers to be used when the subsequent
PUSH_PROMISE callback comes */
if
(
frame
->
hd
.
type
==
NGHTTP2_PUSH_PROMISE
)
{
...
...
@@ -818,6 +801,23 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame,
return
0
;
}
if
(
stream
->
bodystarted
)
{
/* This is trailer fields. */
/* 3 is for ":" and "\r\n". */
uint32_t
n
=
(
uint32_t
)(
namelen
+
valuelen
+
3
);
DEBUGF
(
infof
(
data_s
,
"h2 trailer: %.*s: %.*s
\n
"
,
namelen
,
name
,
valuelen
,
value
));
Curl_add_buffer
(
stream
->
trailer_recvbuf
,
&
n
,
sizeof
(
n
));
Curl_add_buffer
(
stream
->
trailer_recvbuf
,
name
,
namelen
);
Curl_add_buffer
(
stream
->
trailer_recvbuf
,
":"
,
1
);
Curl_add_buffer
(
stream
->
trailer_recvbuf
,
value
,
valuelen
);
Curl_add_buffer
(
stream
->
trailer_recvbuf
,
"
\r\n\0
"
,
3
);
return
0
;
}
if
(
namelen
==
sizeof
(
":status"
)
-
1
&&
memcmp
(
":status"
,
name
,
namelen
)
==
0
)
{
/* nghttp2 guarantees :status is received first and only once, and
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment