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
aa93ede6
Commit
aa93ede6
authored
Jan 22, 2018
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make HttpService.Echo in example/http_c++ as http service again
parent
7278f99d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
16 deletions
+2
-16
http.proto
example/http_c++/http.proto
+2
-6
http_server.cpp
example/http_c++/http_server.cpp
+0
-10
No files found.
example/http_c++/http.proto
View file @
aa93ede6
...
...
@@ -3,12 +3,8 @@ package example;
option
cc_generic_services
=
true
;
message
HttpRequest
{
optional
bytes
message
=
1
;
};
message
HttpResponse
{
optional
bytes
message
=
1
;
};
message
HttpRequest
{};
message
HttpResponse
{};
service
HttpService
{
rpc
Echo
(
HttpRequest
)
returns
(
HttpResponse
);
...
...
example/http_c++/http_server.cpp
View file @
aa93ede6
...
...
@@ -58,16 +58,6 @@ public:
os
<<
"
\n
body: "
<<
cntl
->
request_attachment
()
<<
'\n'
;
os
.
move_to
(
cntl
->
response_attachment
());
}
void
EchoProtobuf
(
google
::
protobuf
::
RpcController
*
,
const
HttpRequest
*
request
,
HttpResponse
*
response
,
google
::
protobuf
::
Closure
*
done
)
{
// This object helps you to call done->Run() in RAII style. If you need
// to process the request asynchronously, pass done_guard.release().
brpc
::
ClosureGuard
done_guard
(
done
);
response
->
set_message
(
request
->
message
());
}
};
// Service with dynamic path.
...
...
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