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
de323bde
Commit
de323bde
authored
6 years ago
by
zyearn
Committed by
zhujiashun
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Add Trailers-Only Support in Response
* Add grpc-message
parent
4c50ffb4
master
0.9.8-rc01
0.9.7
0.9.7-rc03
0.9.7-rc02
0.9.7-rc01
0.9.6
0.9.6-rc03
0.9.6-rc02
0.9.6-rc01
0.9.5
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
http2_rpc_protocol.cpp
src/brpc/policy/http2_rpc_protocol.cpp
+2
-2
http_rpc_protocol.cpp
src/brpc/policy/http_rpc_protocol.cpp
+4
-2
No files found.
src/brpc/policy/http2_rpc_protocol.cpp
View file @
de323bde
...
...
@@ -1716,8 +1716,8 @@ H2UnsentResponse::AppendAndDestroySelf(butil::IOBuf* out, Socket* socket) {
// TODO(zhujiashun): how to decide status code and status message
HPacker
::
Header
status
(
"grpc-status"
,
"0"
);
hpacker
.
Encode
(
&
trailer_appender
,
status
,
options
);
//
HPacker::Header message("grpc-message", "");
//
hpacker.Encode(&trailer_appender, message, options);
HPacker
::
Header
message
(
"grpc-message"
,
""
);
hpacker
.
Encode
(
&
trailer_appender
,
message
,
options
);
trailer_appender
.
move_to
(
trailer_frag
);
}
...
...
This diff is collapsed.
Click to expand it.
src/brpc/policy/http_rpc_protocol.cpp
View file @
de323bde
...
...
@@ -270,13 +270,15 @@ void ProcessHttpResponse(InputMessageBase* msg) {
// TODO(zhujiashun): handle compression
char
compressed_grpc
=
false
;
if
(
ParseContentType
(
res_header
->
content_type
())
==
HTTP_CONTENT_GRPC
)
{
if
(
ParseContentType
(
res_header
->
content_type
())
==
HTTP_CONTENT_GRPC
&&
!
res_body
.
empty
())
{
/* 4 is the size of grpc Message-Length in Length-Prefixed-Message*/
char
buf
[
4
];
res_body
.
cut1
(
&
compressed_grpc
);
res_body
.
cutn
(
buf
,
4
);
int
message_length
=
ReadBigEndian4Bytes
(
buf
);
CHECK
(
message_length
==
res_body
.
length
());
CHECK
(
message_length
==
res_body
.
length
())
<<
message_length
<<
" vs "
<<
res_body
.
length
();
}
do
{
...
...
This diff is collapsed.
Click to expand it.
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