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
11da9c8c
Unverified
Commit
11da9c8c
authored
Jul 21, 2020
by
jamesge
Committed by
GitHub
Jul 21, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1116 from wasphin/feature/fix-typo
fix a typo: COMPLELE -> COMPLETE
parents
4941431b
f67446d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
http_message.cpp
src/brpc/details/http_message.cpp
+3
-3
http_message.h
src/brpc/details/http_message.h
+3
-3
http_rpc_protocol.cpp
src/brpc/policy/http_rpc_protocol.cpp
+1
-1
No files found.
src/brpc/details/http_message.cpp
View file @
11da9c8c
...
...
@@ -134,7 +134,7 @@ int HttpMessage::on_header_value(http_parser *parser,
int
HttpMessage
::
on_headers_complete
(
http_parser
*
parser
)
{
HttpMessage
*
http_message
=
(
HttpMessage
*
)
parser
->
data
;
http_message
->
_stage
=
HTTP_ON_HEADERS_COMPLE
L
E
;
http_message
->
_stage
=
HTTP_ON_HEADERS_COMPLE
T
E
;
// Move content-type into the member field.
const
std
::
string
*
content_type
=
http_message
->
header
().
GetHeader
(
"content-type"
);
if
(
content_type
)
{
...
...
@@ -295,12 +295,12 @@ int HttpMessage::OnMessageComplete() {
_cur_value
=
NULL
;
if
(
!
_read_body_progressively
)
{
// Normal read.
_stage
=
HTTP_ON_MESSAGE_COMPLE
L
E
;
_stage
=
HTTP_ON_MESSAGE_COMPLE
T
E
;
return
0
;
}
// Progressive read.
std
::
unique_lock
<
butil
::
Mutex
>
mu
(
_body_mutex
);
_stage
=
HTTP_ON_MESSAGE_COMPLE
L
E
;
_stage
=
HTTP_ON_MESSAGE_COMPLE
T
E
;
if
(
_body_reader
!=
NULL
)
{
// Solve the case: SetBodyReader quit at ntry=MAX_TRY with non-empty
// _body and the remaining _body is just the last part.
...
...
src/brpc/details/http_message.h
View file @
11da9c8c
...
...
@@ -37,9 +37,9 @@ enum HttpParserStage {
HTTP_ON_STATUS
,
HTTP_ON_HEADER_FIELD
,
HTTP_ON_HEADER_VALUE
,
HTTP_ON_HEADERS_COMPLE
L
E
,
HTTP_ON_HEADERS_COMPLE
T
E
,
HTTP_ON_BODY
,
HTTP_ON_MESSAGE_COMPLE
L
E
HTTP_ON_MESSAGE_COMPLE
T
E
};
class
HttpMessage
{
...
...
@@ -61,7 +61,7 @@ public:
// Returns bytes parsed, -1 on failure.
ssize_t
ParseFromIOBuf
(
const
butil
::
IOBuf
&
buf
);
bool
Completed
()
const
{
return
_stage
==
HTTP_ON_MESSAGE_COMPLE
L
E
;
}
bool
Completed
()
const
{
return
_stage
==
HTTP_ON_MESSAGE_COMPLE
T
E
;
}
HttpParserStage
stage
()
const
{
return
_stage
;
}
HttpHeader
&
header
()
{
return
_header
;
}
...
...
src/brpc/policy/http_rpc_protocol.cpp
View file @
11da9c8c
...
...
@@ -1099,7 +1099,7 @@ ParseResult ParseHttpMessage(butil::IOBuf *source, Socket *socket,
}
return
result
;
}
else
if
(
socket
->
is_read_progressive
()
&&
http_imsg
->
stage
()
>=
HTTP_ON_HEADERS_COMPLE
L
E
)
{
http_imsg
->
stage
()
>=
HTTP_ON_HEADERS_COMPLE
T
E
)
{
// header part of a progressively-read http message is complete,
// go on to ProcessHttpXXX w/o waiting for full body.
http_imsg
->
AddOneRefForStage2
();
// released when body is fully read
...
...
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