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
f67446d7
Commit
f67446d7
authored
May 19, 2020
by
Xiaofeng Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a typo: COMPLELE -> COMPLETE
parent
87f149c4
Show 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 @
f67446d7
...
@@ -134,7 +134,7 @@ int HttpMessage::on_header_value(http_parser *parser,
...
@@ -134,7 +134,7 @@ int HttpMessage::on_header_value(http_parser *parser,
int
HttpMessage
::
on_headers_complete
(
http_parser
*
parser
)
{
int
HttpMessage
::
on_headers_complete
(
http_parser
*
parser
)
{
HttpMessage
*
http_message
=
(
HttpMessage
*
)
parser
->
data
;
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.
// Move content-type into the member field.
const
std
::
string
*
content_type
=
http_message
->
header
().
GetHeader
(
"content-type"
);
const
std
::
string
*
content_type
=
http_message
->
header
().
GetHeader
(
"content-type"
);
if
(
content_type
)
{
if
(
content_type
)
{
...
@@ -295,12 +295,12 @@ int HttpMessage::OnMessageComplete() {
...
@@ -295,12 +295,12 @@ int HttpMessage::OnMessageComplete() {
_cur_value
=
NULL
;
_cur_value
=
NULL
;
if
(
!
_read_body_progressively
)
{
if
(
!
_read_body_progressively
)
{
// Normal read.
// Normal read.
_stage
=
HTTP_ON_MESSAGE_COMPLE
L
E
;
_stage
=
HTTP_ON_MESSAGE_COMPLE
T
E
;
return
0
;
return
0
;
}
}
// Progressive read.
// Progressive read.
std
::
unique_lock
<
butil
::
Mutex
>
mu
(
_body_mutex
);
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
)
{
if
(
_body_reader
!=
NULL
)
{
// Solve the case: SetBodyReader quit at ntry=MAX_TRY with non-empty
// Solve the case: SetBodyReader quit at ntry=MAX_TRY with non-empty
// _body and the remaining _body is just the last part.
// _body and the remaining _body is just the last part.
...
...
src/brpc/details/http_message.h
View file @
f67446d7
...
@@ -37,9 +37,9 @@ enum HttpParserStage {
...
@@ -37,9 +37,9 @@ enum HttpParserStage {
HTTP_ON_STATUS
,
HTTP_ON_STATUS
,
HTTP_ON_HEADER_FIELD
,
HTTP_ON_HEADER_FIELD
,
HTTP_ON_HEADER_VALUE
,
HTTP_ON_HEADER_VALUE
,
HTTP_ON_HEADERS_COMPLE
L
E
,
HTTP_ON_HEADERS_COMPLE
T
E
,
HTTP_ON_BODY
,
HTTP_ON_BODY
,
HTTP_ON_MESSAGE_COMPLE
L
E
HTTP_ON_MESSAGE_COMPLE
T
E
};
};
class
HttpMessage
{
class
HttpMessage
{
...
@@ -61,7 +61,7 @@ public:
...
@@ -61,7 +61,7 @@ public:
// Returns bytes parsed, -1 on failure.
// Returns bytes parsed, -1 on failure.
ssize_t
ParseFromIOBuf
(
const
butil
::
IOBuf
&
buf
);
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
;
}
HttpParserStage
stage
()
const
{
return
_stage
;
}
HttpHeader
&
header
()
{
return
_header
;
}
HttpHeader
&
header
()
{
return
_header
;
}
...
...
src/brpc/policy/http_rpc_protocol.cpp
View file @
f67446d7
...
@@ -1099,7 +1099,7 @@ ParseResult ParseHttpMessage(butil::IOBuf *source, Socket *socket,
...
@@ -1099,7 +1099,7 @@ ParseResult ParseHttpMessage(butil::IOBuf *source, Socket *socket,
}
}
return
result
;
return
result
;
}
else
if
(
socket
->
is_read_progressive
()
&&
}
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,
// header part of a progressively-read http message is complete,
// go on to ProcessHttpXXX w/o waiting for full body.
// go on to ProcessHttpXXX w/o waiting for full body.
http_imsg
->
AddOneRefForStage2
();
// released when body is fully read
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