Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
a433b132
Unverified
Commit
a433b132
authored
Nov 15, 2018
by
Tatsuhiro Tsujikawa
Committed by
GitHub
Nov 15, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1260 from nghttp2/h2load-non-final-response
h2load: Handle HTTP/1 non-final response
parents
cf48a56d
17292445
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
src/h2load_http1_session.cc
src/h2load_http1_session.cc
+23
-8
No files found.
src/h2load_http1_session.cc
View file @
a433b132
...
...
@@ -70,6 +70,11 @@ namespace {
int
htp_statuscb
(
http_parser
*
htp
,
const
char
*
at
,
size_t
length
)
{
auto
session
=
static_cast
<
Http1Session
*>
(
htp
->
data
);
auto
client
=
session
->
get_client
();
if
(
htp
->
status_code
/
100
==
1
)
{
return
0
;
}
client
->
on_status_code
(
session
->
stream_resp_counter_
,
htp
->
status_code
);
return
0
;
...
...
@@ -82,6 +87,10 @@ int htp_msg_completecb(http_parser *htp) {
auto
session
=
static_cast
<
Http1Session
*>
(
htp
->
data
);
auto
client
=
session
->
get_client
();
if
(
htp
->
status_code
/
100
==
1
)
{
return
0
;
}
client
->
final
=
http_should_keep_alive
(
htp
)
==
0
;
auto
req_stat
=
client
->
get_req_stat
(
session
->
stream_resp_counter_
);
...
...
@@ -133,6 +142,12 @@ int htp_hdr_valcb(http_parser *htp, const char *data, size_t len) {
}
}
// namespace
namespace
{
int
htp_hdrs_completecb
(
http_parser
*
htp
)
{
return
!
http2
::
expect_response_body
(
htp
->
status_code
);
}
}
// namespace
namespace
{
int
htp_body_cb
(
http_parser
*
htp
,
const
char
*
data
,
size_t
len
)
{
auto
session
=
static_cast
<
Http1Session
*>
(
htp
->
data
);
...
...
@@ -147,14 +162,14 @@ int htp_body_cb(http_parser *htp, const char *data, size_t len) {
namespace
{
constexpr
http_parser_settings
htp_hooks
=
{
htp_msg_begincb
,
// http_cb on_message_begin;
nullptr
,
// http_data_cb on_url;
htp_statuscb
,
// http_data_cb on_status;
htp_hdr_keycb
,
// http_data_cb on_header_field;
htp_hdr_valcb
,
// http_data_cb on_header_value;
nullptr
,
// http_cb on_headers_complete;
htp_body_cb
,
// http_data_cb on_body;
htp_msg_completecb
// http_cb on_message_complete;
htp_msg_begincb
,
// http_cb on_message_begin;
nullptr
,
// http_data_cb on_url;
htp_statuscb
,
// http_data_cb on_status;
htp_hdr_keycb
,
// http_data_cb on_header_field;
htp_hdr_valcb
,
// http_data_cb on_header_value;
htp_hdrs_completecb
,
// http_cb on_headers_complete;
htp_body_cb
,
// http_data_cb on_body;
htp_msg_completecb
// http_cb on_message_complete;
};
}
// namespace
...
...
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