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
cc49eff7
Unverified
Commit
cc49eff7
authored
Aug 30, 2018
by
Ge Jun
Committed by
GitHub
Aug 30, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #469 from ipconfigme/master
add GetSockOption to controller; fix some typo
parents
fc0fefb5
b332e0b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
controller.cpp
src/brpc/controller.cpp
+10
-0
controller.h
src/brpc/controller.h
+3
-0
rtmp_protocol.h
src/brpc/policy/rtmp_protocol.h
+1
-1
No files found.
src/brpc/controller.cpp
View file @
cc49eff7
...
...
@@ -1382,6 +1382,16 @@ x509_st* Controller::get_peer_certificate() const {
return
s
?
s
->
GetPeerCertificate
()
:
NULL
;
}
int
Controller
::
GetSockOption
(
int
level
,
int
optname
,
void
*
optval
,
socklen_t
*
optlen
)
{
Socket
*
s
=
_current_call
.
sending_sock
.
get
();
if
(
s
)
{
return
getsockopt
(
s
->
fd
(),
level
,
optname
,
optval
,
optlen
);
}
else
{
errno
=
EBADF
;
return
-
1
;
}
}
#if defined(OS_MACOSX)
typedef
sig_t
SignalHandler
;
#else
...
...
src/brpc/controller.h
View file @
cc49eff7
...
...
@@ -591,6 +591,9 @@ private:
void
set_used_by_rpc
()
{
add_flag
(
FLAGS_USED_BY_RPC
);
}
bool
is_used_by_rpc
()
const
{
return
has_flag
(
FLAGS_USED_BY_RPC
);
}
// Get sock option. .e.g get vip info through ttm kernel module hook,
int
GetSockOption
(
int
level
,
int
optname
,
void
*
optval
,
socklen_t
*
optlen
);
private
:
// NOTE: align and group fields to make Controller as compact as possible.
...
...
src/brpc/policy/rtmp_protocol.h
View file @
cc49eff7
...
...
@@ -560,7 +560,7 @@ void SerializeRtmpRequest(butil::IOBuf* buf,
Controller
*
cntl
,
const
google
::
protobuf
::
Message
*
request
);
// ============== inli
en
impl. =================
// ============== inli
ne
impl. =================
// TODO(gejun): impl. do not work for big-endian machines.
inline
uint8_t
Read1Byte
(
const
void
*
void_buf
)
{
return
*
(
const
char
*
)
void_buf
;
...
...
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