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
e018977c
Commit
e018977c
authored
Apr 09, 2018
by
wangxuefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix merge issue
parent
56aa6d4c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
41 additions
and
11 deletions
+41
-11
client.cpp
example/thrift_extension_c++/client.cpp
+1
-1
thrift_protocol.cpp
src/brpc/policy/thrift_protocol.cpp
+4
-0
thrift_protocol.h
src/brpc/policy/thrift_protocol.h
+4
-1
server.cpp
src/brpc/server.cpp
+7
-0
thrift_framed_message.cpp
src/brpc/thrift_framed_message.cpp
+8
-4
thrift_framed_message.h
src/brpc/thrift_framed_message.h
+7
-3
thrift_service.cpp
src/brpc/thrift_service.cpp
+3
-0
thrift_service.h
src/brpc/thrift_service.h
+6
-1
thrift_utils.h
src/butil/thrift_utils.h
+1
-1
No files found.
example/thrift_extension_c++/client.cpp
View file @
e018977c
...
...
@@ -24,7 +24,7 @@
#include <butil/thrift_utils.h>
#include <butil/strings/string_piece.h>
#include <brpc/channel.h>
#include <brpc/thrift_
binary
_message.h>
#include <brpc/thrift_
framed
_message.h>
#include <bvar/bvar.h>
#include <thrift/transport/TBufferTransports.h>
...
...
src/brpc/policy/thrift_protocol.cpp
View file @
e018977c
...
...
@@ -14,6 +14,8 @@
// Authors: wangxuefeng (wangxuefeng@didichuxing.com)
#ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
#include <google/protobuf/descriptor.h> // MethodDescriptor
#include <google/protobuf/message.h> // Message
#include <gflags/gflags.h>
...
...
@@ -613,3 +615,5 @@ void PackThriftFramedRequest(
}
// namespace policy
}
// namespace brpc
#endif
src/brpc/policy/thrift_protocol.h
View file @
e018977c
...
...
@@ -14,11 +14,13 @@
// Authors: wangxuefeng (wangxuefeng@didichuxing.com)
#ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
#ifndef BRPC_POLICY_THRIFT_PROTOCOL_H
#define BRPC_POLICY_THRIFT_PROTOCOL_H
#include "brpc/protocol.h"
#include "brpc/thrift_
binary
_message.h"
#include "brpc/thrift_
framed
_message.h"
namespace
brpc
{
namespace
policy
{
...
...
@@ -52,3 +54,4 @@ bool VerifyThriftFramedRequest(const InputMessageBase *msg);
#endif // BRPC_POLICY_THRIFT_PROTOCOL_H
#endif
src/brpc/server.cpp
View file @
e018977c
...
...
@@ -317,9 +317,11 @@ void* Server::UpdateDerivedVars(void* arg) {
server
->
options
().
nshead_service
->
Expose
(
prefix
);
}
#ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
if
(
server
->
options
().
thrift_service
)
{
server
->
options
().
thrift_service
->
Expose
(
prefix
);
}
#endif
int64_t
last_time
=
butil
::
gettimeofday_us
();
int
consecutive_nosleep
=
0
;
...
...
@@ -403,8 +405,10 @@ Server::~Server() {
delete
_options
.
nshead_service
;
_options
.
nshead_service
=
NULL
;
#ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
delete
_options
.
thrift_service
;
_options
.
thrift_service
=
NULL
;
#endif
delete
_options
.
http_master_service
;
_options
.
http_master_service
=
NULL
;
...
...
@@ -1545,12 +1549,15 @@ void Server::GenerateVersionIfNeeded() {
}
_version
.
append
(
butil
::
class_name_str
(
*
_options
.
nshead_service
));
}
#ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
if
(
_options
.
thrift_service
)
{
if
(
!
_version
.
empty
())
{
_version
.
push_back
(
'+'
);
}
_version
.
append
(
butil
::
class_name_str
(
*
_options
.
thrift_service
));
}
#endif
if
(
_options
.
rtmp_service
)
{
if
(
!
_version
.
empty
())
{
...
...
src/brpc/thrift_
binary
_message.cpp
→
src/brpc/thrift_
framed
_message.cpp
View file @
e018977c
...
...
@@ -14,8 +14,10 @@
// Authors: wangxuefeng (wangxuefeng@didichuxing.com)
#ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "brpc/thrift_
binary
_message.h"
#include "brpc/thrift_
framed
_message.h"
#include <algorithm>
#include "butil/logging.h"
...
...
@@ -39,7 +41,7 @@ void protobuf_AssignDesc_baidu_2frpc_2fthrift_binary_5fmessage_2eproto() {
protobuf_AddDesc_baidu_2frpc_2fthrift_binary_5fmessage_2eproto
();
const
::
google
::
protobuf
::
FileDescriptor
*
file
=
::
google
::
protobuf
::
DescriptorPool
::
generated_pool
()
->
FindFileByName
(
"baidu/rpc/thrift_
binary
_message.proto"
);
"baidu/rpc/thrift_
framed
_message.proto"
);
GOOGLE_CHECK
(
file
!=
NULL
);
ThriftFramedMessage_descriptor_
=
file
->
message_type
(
0
);
}
...
...
@@ -73,10 +75,10 @@ void protobuf_AddDesc_baidu_2frpc_2fthrift_binary_5fmessage_2eproto_impl() {
::
google
::
protobuf
::
protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto
();
#endif
::
google
::
protobuf
::
DescriptorPool
::
InternalAddGeneratedFile
(
"
\n\033
thrift_
binary
_message.proto
\022\004
brpc
\"\025\n\023
T"
"
\n\033
thrift_
framed
_message.proto
\022\004
brpc
\"\025\n\023
T"
"hriftBinaryMessage"
,
58
);
::
google
::
protobuf
::
MessageFactory
::
InternalRegisterGeneratedFile
(
"thrift_
binary
_message.proto"
,
&
protobuf_RegisterTypes
);
"thrift_
framed
_message.proto"
,
&
protobuf_RegisterTypes
);
ThriftFramedMessage
::
default_instance_
=
new
ThriftFramedMessage
();
ThriftFramedMessage
::
default_instance_
->
InitAsDefaultInstance
();
::
google
::
protobuf
::
internal
::
OnShutdown
(
&
protobuf_ShutdownFile_baidu_2frpc_2fthrift_binary_5fmessage_2eproto
);
...
...
@@ -235,3 +237,5 @@ void ThriftFramedMessage::Swap(ThriftFramedMessage* other) {
}
}
// namespace brpc
#endif
src/brpc/thrift_
binary
_message.h
→
src/brpc/thrift_
framed
_message.h
View file @
e018977c
...
...
@@ -14,8 +14,10 @@
// Authors: wangxuefeng (wangxuefeng@didichuxing.com)
#ifndef BRPC_THRIFT_BINARY_MESSAGE_H
#define BRPC_THRIFT_BINARY_MESSAGE_H
#ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
#ifndef BRPC_THRIFT_FRAMED_MESSAGE_H
#define BRPC_THRIFT_FRAMED_MESSAGE_H
#include <functional>
#include <string>
...
...
@@ -227,4 +229,6 @@ private:
}
// namespace brpc
#endif // BRPC_THRIFT_BINARY_MESSAGE_H
#endif // BRPC_THRIFT_FRAMED_MESSAGE_H
#endif
src/brpc/thrift_service.cpp
View file @
e018977c
...
...
@@ -13,6 +13,7 @@
// limitations under the License.
// Authors: wangxuefeng (wangxuefeng@didichuxing.com)
#ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
#include "butil/class_name.h"
#include "brpc/thrift_service.h"
...
...
@@ -59,3 +60,5 @@ void ThriftFramedService::Expose(const butil::StringPiece& prefix) {
}
}
// namespace brpc
#endif
src/brpc/thrift_service.h
View file @
e018977c
...
...
@@ -14,11 +14,13 @@
// Authors: wangxuefeng (wangxuefeng@didichuxing.com)
#ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
#ifndef BRPC_THRIFT_SERVICE_H
#define BRPC_THRIFT_SERVICE_H
#include "brpc/controller.h" // Controller
#include "brpc/thrift_
binary
_message.h" // ThriftFramedMessage
#include "brpc/thrift_
framed
_message.h" // ThriftFramedMessage
#include "brpc/describable.h"
...
...
@@ -127,3 +129,6 @@ private:
#endif // BRPC_THRIFT_SERVICE_H
#endif
src/butil/thrift_utils.h
View file @
e018977c
...
...
@@ -20,7 +20,7 @@
#include <boost/make_shared.hpp>
#include <brpc/channel.h>
#include <brpc/thrift_
binary
_message.h>
#include <brpc/thrift_
framed
_message.h>
#include <thrift/TDispatchProcessor.h>
#include <thrift/transport/TBufferTransports.h>
...
...
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