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
0bc3f27c
Commit
0bc3f27c
authored
May 23, 2019
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cntl param back to DestroyStreamUserData
parent
44c49447
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
3 deletions
+10
-3
controller.cpp
src/brpc/controller.cpp
+1
-1
http2_rpc_protocol.cpp
src/brpc/policy/http2_rpc_protocol.cpp
+2
-0
http2_rpc_protocol.h
src/brpc/policy/http2_rpc_protocol.h
+1
-0
rtmp.cpp
src/brpc/rtmp.cpp
+1
-0
rtmp.h
src/brpc/rtmp.h
+1
-0
stream_creator.h
src/brpc/stream_creator.h
+3
-1
brpc_http_rpc_protocol_unittest.cpp
test/brpc_http_rpc_protocol_unittest.cpp
+1
-1
No files found.
src/brpc/controller.cpp
View file @
0bc3f27c
...
...
@@ -697,7 +697,7 @@ inline bool does_error_affect_main_socket(int error_code) {
void
Controller
::
Call
::
OnComplete
(
Controller
*
c
,
int
error_code
/*note*/
,
bool
responded
,
bool
end_of_rpc
)
{
if
(
stream_user_data
)
{
stream_user_data
->
DestroyStreamUserData
(
sending_sock
,
error_code
,
end_of_rpc
);
stream_user_data
->
DestroyStreamUserData
(
sending_sock
,
c
,
error_code
,
end_of_rpc
);
stream_user_data
=
NULL
;
}
...
...
src/brpc/policy/http2_rpc_protocol.cpp
View file @
0bc3f27c
...
...
@@ -1448,10 +1448,12 @@ private:
};
void
H2UnsentRequest
::
DestroyStreamUserData
(
SocketUniquePtr
&
sending_sock
,
Controller
*
cntl
,
int
error_code
,
bool
/*end_of_rpc*/
)
{
RemoveRefOnQuit
deref_self
(
this
);
if
(
sending_sock
!=
NULL
&&
error_code
!=
0
)
{
CHECK_EQ
(
cntl
,
_cntl
);
std
::
unique_lock
<
butil
::
Mutex
>
mu
(
_mutex
);
_cntl
=
NULL
;
if
(
_stream_id
!=
0
)
{
...
...
src/brpc/policy/http2_rpc_protocol.h
View file @
0bc3f27c
...
...
@@ -153,6 +153,7 @@ public:
// @StreamUserData
void
DestroyStreamUserData
(
SocketUniquePtr
&
sending_sock
,
Controller
*
cntl
,
int
error_code
,
bool
end_of_rpc
)
override
;
...
...
src/brpc/rtmp.cpp
View file @
0bc3f27c
...
...
@@ -1747,6 +1747,7 @@ void RtmpClientStream::OnFailedToCreateStream() {
}
void
RtmpClientStream
::
DestroyStreamUserData
(
SocketUniquePtr
&
sending_sock
,
Controller
*
cntl
,
int
/*error_code*/
,
bool
end_of_rpc
)
{
if
(
!
end_of_rpc
)
{
...
...
src/brpc/rtmp.h
View file @
0bc3f27c
...
...
@@ -827,6 +827,7 @@ friend class RtmpRetryingClientStream;
// @StreamUserData
void
DestroyStreamUserData
(
SocketUniquePtr
&
sending_sock
,
Controller
*
cntl
,
int
error_code
,
bool
end_of_rpc
)
override
;
...
...
src/brpc/stream_creator.h
View file @
0bc3f27c
...
...
@@ -66,9 +66,11 @@ public:
// Params:
// sending_sock: The socket chosen by OnCreatingStream(), if an error
// happens during choosing, the enclosed socket is NULL.
// error_code: the error code after the RPC.
// cntl: contexts of the RPC
// error_code: error code after the RPC.
// end_of_rpc: true if the RPC is about to destroyed.
virtual
void
DestroyStreamUserData
(
SocketUniquePtr
&
sending_sock
,
Controller
*
cntl
,
int
error_code
,
bool
end_of_rpc
)
=
0
;
};
...
...
test/brpc_http_rpc_protocol_unittest.cpp
View file @
0bc3f27c
...
...
@@ -1113,7 +1113,7 @@ TEST_F(HttpTest, http2_window_used_up) {
}
else
{
ASSERT_TRUE
(
st
.
ok
());
}
h2_req
->
DestroyStreamUserData
(
_h2_client_sock
,
0
,
false
);
h2_req
->
DestroyStreamUserData
(
_h2_client_sock
,
&
cntl
,
0
,
false
);
}
}
...
...
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