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
62b61711
Commit
62b61711
authored
Sep 12, 2018
by
zhujiashun
Committed by
gejun
Sep 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fix OnDestroyingStream not calling bug
* Fix socket failed bug in rtmp in connection short case
parent
1578278f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
controller.cpp
src/brpc/controller.cpp
+2
-7
stream_creator.h
src/brpc/stream_creator.h
+4
-3
No files found.
src/brpc/controller.cpp
View file @
62b61711
...
...
@@ -258,7 +258,6 @@ void Controller::InternalReset(bool in_constructor) {
Controller
::
Call
::
Call
(
Controller
::
Call
*
rhs
)
:
nretry
(
rhs
->
nretry
)
,
need_feedback
(
rhs
->
need_feedback
)
,
touched_by_stream_creator
(
rhs
->
touched_by_stream_creator
)
,
peer_id
(
rhs
->
peer_id
)
,
begin_time_us
(
rhs
->
begin_time_us
)
,
sending_sock
(
rhs
->
sending_sock
.
release
())
{
...
...
@@ -266,7 +265,6 @@ Controller::Call::Call(Controller::Call* rhs)
// setting all the fields to next call and _current_call.OnComplete
// will behave incorrectly.
rhs
->
need_feedback
=
false
;
rhs
->
touched_by_stream_creator
=
false
;
rhs
->
peer_id
=
(
SocketId
)
-
1
;
}
...
...
@@ -733,7 +731,7 @@ void Controller::Call::OnComplete(
case
CONNECTION_TYPE_SHORT
:
if
(
sending_sock
!=
NULL
)
{
// Check the comment in CONNECTION_TYPE_POOLED branch.
if
(
!
sending_sock
->
is_read_progressive
())
{
if
(
!
sending_sock
->
is_read_progressive
()
&&
c
->
_stream_creator
==
NULL
)
{
sending_sock
->
SetFailed
();
}
else
{
sending_sock
->
OnProgressiveReadCompleted
();
...
...
@@ -769,9 +767,7 @@ void Controller::Call::OnComplete(
c
->
_lb
->
Feedback
(
info
);
}
if
(
touched_by_stream_creator
)
{
touched_by_stream_creator
=
false
;
CHECK
(
c
->
stream_creator
());
if
(
c
->
stream_creator
())
{
c
->
stream_creator
()
->
OnDestroyingStream
(
sending_sock
,
c
,
error_code
,
end_of_rpc
);
}
...
...
@@ -1000,7 +996,6 @@ void Controller::IssueRPC(int64_t start_realtime_us) {
_remote_side
=
tmp_sock
->
remote_side
();
}
if
(
_stream_creator
)
{
_current_call
.
touched_by_stream_creator
=
true
;
_stream_creator
->
OnCreatingStream
(
&
tmp_sock
,
this
);
if
(
FailedInline
())
{
return
HandleSendFailed
();
...
...
src/brpc/stream_creator.h
View file @
62b61711
...
...
@@ -29,7 +29,9 @@ class Controller;
class
StreamCreator
{
public
:
// Called when the socket for sending request is about to be created.
// If the RPC has retries, this function is called before each retry.
// If the RPC has retries, this function MAY be called before each retry.
// This function would not be called if some preconditions are not
// satisfied.
// Params:
// inout: pointing to the socket to send requests by default,
// replaceable by user created ones (or keep as it is). remote_side()
...
...
@@ -43,8 +45,7 @@ public:
Controller
*
cntl
)
=
0
;
// Called when the stream is about to destroyed.
// If the RPC has retries, this function is called before each retry.
// This method is always called even if OnCreatingStream() is not called.
// If the RPC has retries, this function MUST be called before each retry.
// Params:
// sending_sock: The socket chosen by OnCreatingStream(), if OnCreatingStream
// is not called, the enclosed socket may be NULL.
...
...
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