Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
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
brpc
Commits
8c32109d
Commit
8c32109d
authored
Jun 27, 2019
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
still parse body when the http request contains upgrade header
parent
40b13429
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
14 deletions
+3
-14
http_message.cpp
src/brpc/details/http_message.cpp
+1
-2
http_parser.cpp
src/brpc/details/http_parser.cpp
+1
-5
http_parser.h
src/brpc/details/http_parser.h
+1
-7
No files found.
src/brpc/details/http_message.cpp
View file @
8c32109d
...
...
@@ -513,8 +513,7 @@ std::ostream& operator<<(std::ostream& os, const http_parser& parser) {
if
(
parser
.
type
==
HTTP_REQUEST
||
parser
.
type
==
HTTP_BOTH
)
{
os
<<
" method="
<<
HttpMethod2Str
((
HttpMethod
)
parser
.
method
);
}
os
<<
" upgrade="
<<
parser
.
upgrade
<<
" data="
<<
parser
.
data
os
<<
" data="
<<
parser
.
data
<<
'}'
;
return
os
;
}
...
...
src/brpc/details/http_parser.cpp
View file @
8c32109d
...
...
@@ -1741,10 +1741,6 @@ size_t http_parser_execute (http_parser *parser,
parser
->
state
=
s_headers_done
;
/* Set this here so that on_headers_complete() callbacks can see it */
parser
->
upgrade
=
(
parser
->
flags
&
F_UPGRADE
||
parser
->
method
==
HTTP_CONNECT
);
/* Here we call the headers_complete callback. This is somewhat
* different than other callbacks because if the user returns 1, we
* will interpret that as saying that this message has no body. This
...
...
@@ -1783,7 +1779,7 @@ size_t http_parser_execute (http_parser *parser,
parser
->
nread
=
0
;
/* Exit, the rest of the connect is in a different protocol. */
if
(
parser
->
upgrade
)
{
if
(
parser
->
method
==
HTTP_CONNECT
)
{
parser
->
state
=
NEW_MESSAGE
();
CALLBACK_NOTIFY
(
message_complete
);
return
(
p
-
data
)
+
1
;
...
...
src/brpc/details/http_parser.h
View file @
8c32109d
...
...
@@ -216,13 +216,7 @@ struct http_parser {
unsigned
int
status_code
:
16
;
/* responses only */
unsigned
int
method
:
8
;
/* requests only */
unsigned
int
http_errno
:
7
;
/* 1 = Upgrade header was present and the parser has exited because of that.
* 0 = No upgrade header present.
* Should be checked when http_parser_execute() returns in addition to
* error checking.
*/
unsigned
int
upgrade
:
1
;
unsigned
int
dummy
:
1
;
/** PUBLIC **/
void
*
data
;
/* A pointer to get hook to the "connection" or "socket" object */
...
...
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