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
ad00daf8
Commit
ad00daf8
authored
Oct 10, 2018
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move all DeferWindowUpdate into RemoveStream
parent
57d9554c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
http2_rpc_protocol.cpp
src/brpc/policy/http2_rpc_protocol.cpp
+12
-10
No files found.
src/brpc/policy/http2_rpc_protocol.cpp
View file @
ad00daf8
...
...
@@ -360,11 +360,17 @@ int H2Context::Init() {
H2StreamContext
*
H2Context
::
RemoveStream
(
int
stream_id
)
{
H2StreamContext
*
sctx
=
NULL
;
std
::
unique_lock
<
butil
::
Mutex
>
mu
(
_stream_mutex
);
if
(
_pending_streams
.
erase
(
stream_id
,
&
sctx
))
{
return
sctx
;
{
std
::
unique_lock
<
butil
::
Mutex
>
mu
(
_stream_mutex
);
if
(
!
_pending_streams
.
erase
(
stream_id
,
&
sctx
))
{
return
NULL
;
}
}
return
NULL
;
// The remote stream will not send any more data, sending back the
// stream-level WINDOW_UPDATE is pointless, just move the value into
// the connection.
DeferWindowUpdate
(
sctx
->
ReleaseDeferredWindowUpdate
());
return
sctx
;
}
void
H2Context
::
RemoveGoAwayStreams
(
...
...
@@ -507,7 +513,6 @@ ParseResult H2Context::Consume(
}
H2StreamContext
*
sctx
=
RemoveStream
(
h2_res
.
stream_id
());
if
(
sctx
)
{
DeferWindowUpdate
(
sctx
->
ReleaseDeferredWindowUpdate
());
if
(
is_server_side
())
{
delete
sctx
;
return
MakeMessage
(
NULL
);
...
...
@@ -719,7 +724,8 @@ H2ParseResult H2Context::OnData(
// If a DATA frame is received whose stream is not in "open" or "half-closed (local)" state,
// the recipient MUST respond with a stream error (Section 5.4.2) of type STREAM_CLOSED.
// Ignore the message without closing the socket.
H2StreamContext
tmp_sctx
(
this
,
frame_head
.
stream_id
);
H2StreamContext
tmp_sctx
(
false
);
tmp_sctx
.
Init
(
this
,
frame_head
.
stream_id
);
tmp_sctx
.
OnData
(
it
,
frame_head
,
frag_size
,
pad_length
);
DeferWindowUpdate
(
tmp_sctx
.
ReleaseDeferredWindowUpdate
());
...
...
@@ -844,10 +850,6 @@ H2ParseResult H2StreamContext::EndRemoteStream() {
return
MakeH2Message
(
NULL
);
}
CHECK_EQ
(
sctx
,
this
);
// The remote stream will not send any more data, sending back the
// stream-level WINDOW_UPDATE is pointless, just move the value into
// the connection.
_conn_ctx
->
DeferWindowUpdate
(
sctx
->
ReleaseDeferredWindowUpdate
());
OnMessageComplete
();
return
MakeH2Message
(
sctx
);
...
...
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