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
739172ae
Commit
739172ae
authored
Sep 11, 2018
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust impl. of OnCompleteAndKeepSocket/OnComplete
parent
b7e545c5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
Makefile
example/http_c++/Makefile
+0
-1
controller.cpp
src/brpc/controller.cpp
+9
-6
controller.h
src/brpc/controller.h
+1
-1
No files found.
example/http_c++/Makefile
View file @
739172ae
...
@@ -68,7 +68,6 @@ endif
...
@@ -68,7 +68,6 @@ endif
http_server
:
$(PROTO_OBJS) $(SERVER_OBJS)
http_server
:
$(PROTO_OBJS) $(SERVER_OBJS)
@
echo
"Linking
$@
"
@
echo
"Linking
$@
"
ifneq
(
"$(LINK_SO)"
,
""
)
ifneq
(
"$(LINK_SO)"
,
""
)
@echo
"@$(CXX) $(LIBPATHS) $(SOPATHS) $(LINK_OPTIONS_SO) -o $@"
@$(CXX)
$(LIBPATHS)
$(SOPATHS)
$(LINK_OPTIONS_SO)
-o
$@
@$(CXX)
$(LIBPATHS)
$(SOPATHS)
$(LINK_OPTIONS_SO)
-o
$@
else
else
@$(CXX)
$(LIBPATHS)
$(LINK_OPTIONS)
-o
$@
@$(CXX)
$(LIBPATHS)
$(LINK_OPTIONS)
-o
$@
...
...
src/brpc/controller.cpp
View file @
739172ae
...
@@ -694,8 +694,8 @@ inline bool does_error_affect_main_socket(int error_code) {
...
@@ -694,8 +694,8 @@ inline bool does_error_affect_main_socket(int error_code) {
// retries and backup requests. This method simply cares about the error of
// retries and backup requests. This method simply cares about the error of
// this very Call (specified by |error_code|) rather than the error of the
// this very Call (specified by |error_code|) rather than the error of the
// entire RPC (specified by c->FailedInline()).
// entire RPC (specified by c->FailedInline()).
void
Controller
::
Call
::
OnComplete
(
Controller
*
c
,
int
error_code
/*note*/
,
void
Controller
::
Call
::
OnComplete
AndKeepSocket
(
bool
responded
,
bool
release_socket
)
{
Controller
*
c
,
int
error_code
/*note*/
,
bool
responded
)
{
switch
(
c
->
connection_type
())
{
switch
(
c
->
connection_type
())
{
case
CONNECTION_TYPE_UNKNOWN
:
case
CONNECTION_TYPE_UNKNOWN
:
break
;
break
;
...
@@ -778,9 +778,11 @@ void Controller::Call::OnComplete(Controller* c, int error_code/*note*/,
...
@@ -778,9 +778,11 @@ void Controller::Call::OnComplete(Controller* c, int error_code/*note*/,
}
}
}
}
void
Controller
::
Call
::
OnComplete
AndKeepSocket
(
void
Controller
::
Call
::
OnComplete
(
Controller
*
c
,
int
error_code
,
bool
responded
)
{
Controller
*
c
,
int
error_code
,
bool
responded
)
{
OnComplete
(
c
,
error_code
,
responded
,
false
);
OnCompleteAndKeepSocket
(
c
,
error_code
,
responded
);
// Release the `Socket' we used to send/receive data
sending_sock
.
reset
(
NULL
);
}
}
void
Controller
::
EndRPC
(
const
CompletionInfo
&
info
)
{
void
Controller
::
EndRPC
(
const
CompletionInfo
&
info
)
{
...
@@ -837,13 +839,14 @@ void Controller::EndRPC(const CompletionInfo& info) {
...
@@ -837,13 +839,14 @@ void Controller::EndRPC(const CompletionInfo& info) {
CHECK
(
false
)
<<
"A previous non-backed-up call responded"
;
CHECK
(
false
)
<<
"A previous non-backed-up call responded"
;
_unfinished_call
->
OnCompleteAndKeepSocket
(
this
,
ECANCELED
,
false
);
_unfinished_call
->
OnCompleteAndKeepSocket
(
this
,
ECANCELED
,
false
);
}
}
delete
_unfinished_call
;
_unfinished_call
=
NULL
;
if
(
_stream_creator
)
{
if
(
_stream_creator
)
{
_stream_creator
->
OnStreamCreationDone
(
_stream_creator
->
OnStreamCreationDone
(
_unfinished_call
->
sending_sock
,
this
);
_unfinished_call
->
sending_sock
,
this
);
}
}
_unfinished_call
->
sending_sock
.
reset
(
NULL
);
_unfinished_call
->
sending_sock
.
reset
(
NULL
);
delete
_unfinished_call
;
_unfinished_call
=
NULL
;
}
else
{
}
else
{
CHECK
(
false
)
<<
"A previous non-backed-up call responded"
;
CHECK
(
false
)
<<
"A previous non-backed-up call responded"
;
}
}
...
...
src/brpc/controller.h
View file @
739172ae
...
@@ -568,7 +568,7 @@ private:
...
@@ -568,7 +568,7 @@ private:
Call
(
Call
*
);
//move semantics
Call
(
Call
*
);
//move semantics
~
Call
();
~
Call
();
void
Reset
();
void
Reset
();
void
OnComplete
(
Controller
*
c
,
int
error_code
,
bool
responded
,
bool
release_socket
=
true
);
void
OnComplete
(
Controller
*
c
,
int
error_code
,
bool
responded
);
void
OnCompleteAndKeepSocket
(
Controller
*
c
,
int
error_code
,
bool
responded
);
void
OnCompleteAndKeepSocket
(
Controller
*
c
,
int
error_code
,
bool
responded
);
int
nretry
;
// sent in nretry-th retry.
int
nretry
;
// sent in nretry-th retry.
...
...
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