Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
96777883
Commit
96777883
authored
May 23, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't count closed streams in nghttp2_session_want_{read,write}
parent
78a55935
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
lib/nghttp2_session.c
lib/nghttp2_session.c
+21
-2
No files found.
lib/nghttp2_session.c
View file @
96777883
...
...
@@ -5293,28 +5293,47 @@ int nghttp2_session_recv(nghttp2_session *session)
}
}
/*
* Returns the number of active streams, which includes streams in
* reserved state.
*/
static
size_t
session_get_num_active_streams
(
nghttp2_session
*
session
)
{
return
nghttp2_map_size
(
&
session
->
streams
)
-
session
->
num_closed_streams
;
}
int
nghttp2_session_want_read
(
nghttp2_session
*
session
)
{
size_t
num_active_streams
;
/* If these flags are set, we don't want to read. The application
should drop the connection. */
if
((
session
->
goaway_flags
&
NGHTTP2_GOAWAY_FAIL_ON_SEND
)
&&
(
session
->
goaway_flags
&
NGHTTP2_GOAWAY_SEND
))
{
return
0
;
}
num_active_streams
=
session_get_num_active_streams
(
session
);
/* Unless GOAWAY is sent or received, we always want to read
incoming frames. After GOAWAY is sent or received, we are only
interested in active streams. */
return
!
session
->
goaway_flags
||
n
ghttp2_map_size
(
&
session
->
streams
)
>
0
;
return
!
session
->
goaway_flags
||
n
um_active_streams
>
0
;
}
int
nghttp2_session_want_write
(
nghttp2_session
*
session
)
{
size_t
num_active_streams
;
/* If these flags are set, we don't want to write any data. The
application should drop the connection. */
if
((
session
->
goaway_flags
&
NGHTTP2_GOAWAY_FAIL_ON_SEND
)
&&
(
session
->
goaway_flags
&
NGHTTP2_GOAWAY_SEND
))
{
return
0
;
}
num_active_streams
=
session_get_num_active_streams
(
session
);
/*
* Unless GOAWAY is sent or received, we want to write frames if
* there is pending ones. If pending frame is request/push response
...
...
@@ -5325,7 +5344,7 @@ int nghttp2_session_want_write(nghttp2_session *session)
return
(
session
->
aob
.
item
!=
NULL
||
!
nghttp2_pq_empty
(
&
session
->
ob_pq
)
||
(
!
nghttp2_pq_empty
(
&
session
->
ob_ss_pq
)
&&
!
session_is_outgoing_concurrent_streams_max
(
session
)))
&&
(
!
session
->
goaway_flags
||
n
ghttp2_map_size
(
&
session
->
streams
)
>
0
);
(
!
session
->
goaway_flags
||
n
um_active_streams
>
0
);
}
int
nghttp2_session_add_ping
(
nghttp2_session
*
session
,
uint8_t
flags
,
...
...
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