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
381b734c
Commit
381b734c
authored
Apr 24, 2018
by
old-bear
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ Fix a bug that socket options must be set before adding to epoll
parent
a0f635ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
7 deletions
+1
-7
socket.cpp
src/brpc/socket.cpp
+1
-7
No files found.
src/brpc/socket.cpp
View file @
381b734c
...
...
@@ -648,6 +648,7 @@ int Socket::Create(const SocketOptions& options, SocketId* id) {
}
m
->
_last_writetime_us
.
store
(
cpuwide_now
,
butil
::
memory_order_relaxed
);
m
->
_unwritten_bytes
.
store
(
0
,
butil
::
memory_order_relaxed
);
m
->
_options
=
options
;
CHECK
(
NULL
==
m
->
_write_head
.
load
(
butil
::
memory_order_relaxed
));
// Must be last one! Internal fields of this Socket may be access
// just after calling ResetFileDescriptor.
...
...
@@ -659,10 +660,6 @@ int Socket::Create(const SocketOptions& options, SocketId* id) {
return
-
1
;
}
*
id
=
m
->
_this_id
;
m
->
_options
=
options
;
if
(
m
->
_ssl_state
==
SSL_UNKNOWN
)
{
CHECK
(
m
->
_options
.
ssl_ctx
);
}
return
0
;
}
...
...
@@ -1774,9 +1771,6 @@ int Socket::SSLHandshake(int fd, bool server_mode) {
if
(
_options
.
ssl_ctx
==
NULL
)
{
if
(
server_mode
)
{
LOG
(
ERROR
)
<<
"Lack SSL configuration to handle SSL request"
;
std
::
stringstream
ss
;
DebugSocket
(
ss
,
id
());
LOG
(
ERROR
)
<<
ss
;
return
-
1
;
}
return
0
;
...
...
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