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
e1d1d9af
Commit
e1d1d9af
authored
Jan 25, 2019
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize impl
parent
c4908ae7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
http2_rpc_protocol.cpp
src/brpc/policy/http2_rpc_protocol.cpp
+6
-7
No files found.
src/brpc/policy/http2_rpc_protocol.cpp
View file @
e1d1d9af
...
...
@@ -1523,25 +1523,24 @@ H2UnsentRequest::AppendAndDestroySelf(butil::IOBuf* out, Socket* socket) {
return
butil
::
Status
(
EH2RUNOUTSTREAMS
,
"Fail to allocate stream_id"
);
}
std
::
unique_ptr
<
H2StreamContext
>
sctx
(
std
::
move
(
_sctx
));
sctx
->
Init
(
ctx
,
id
);
_sctx
->
Init
(
ctx
,
id
);
// flow control
if
(
!
_cntl
->
request_attachment
().
empty
())
{
const
int64_t
data_size
=
_cntl
->
request_attachment
().
size
();
if
(
!
sctx
->
ConsumeWindowSize
(
data_size
))
{
if
(
!
_
sctx
->
ConsumeWindowSize
(
data_size
))
{
return
butil
::
Status
(
ELIMIT
,
"remote_window_left is not enough, data_size=%"
PRId64
,
data_size
);
}
}
const
int
rc
=
ctx
->
TryToInsertStream
(
id
,
sctx
.
get
());
const
int
rc
=
ctx
->
TryToInsertStream
(
id
,
_
sctx
.
get
());
if
(
rc
<
0
)
{
return
butil
::
Status
(
EINTERNAL
,
"Fail to insert existing stream_id"
);
}
else
if
(
rc
>
0
)
{
return
butil
::
Status
(
ELOGOFF
,
"the connection just issued GOAWAY"
);
}
_stream_id
=
sctx
->
stream_id
();
// After calling TryToInsertStream,
ownership of
sctx is transferred to ctx
sctx
.
release
();
_stream_id
=
_
sctx
->
stream_id
();
// After calling TryToInsertStream,
the ownership of _
sctx is transferred to ctx
_
sctx
.
release
();
HPacker
&
hpacker
=
ctx
->
hpacker
();
butil
::
IOBufAppender
appender
;
...
...
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