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
65cb5594
Commit
65cb5594
authored
Jul 23, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change priority update scheme
parent
3c9e31da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
39 deletions
+30
-39
lib/nghttp2_session.c
lib/nghttp2_session.c
+30
-39
No files found.
lib/nghttp2_session.c
View file @
65cb5594
...
...
@@ -581,9 +581,8 @@ static int nghttp2_session_predicate_syn_reply_send(nghttp2_session *session,
}
/*
* This function checks HEADERS, which is neither stream-opening nor
* first response header, with the stream ID |stream_id| can be sent
* at this time.
* This function checks frames belongs to the stream |stream_id| can
* be sent.
*
* This function returns 0 if it succeeds, or one of the following
* negative error codes:
...
...
@@ -599,8 +598,8 @@ static int nghttp2_session_predicate_syn_reply_send(nghttp2_session *session,
* The state of the stream is not valid (e.g., if the local peer
* is receiving side and SYN_REPLY has not been sent).
*/
static
int
nghttp2_session_predicate_
headers_send
(
nghttp2_session
*
session
,
int32_t
stream_id
)
static
int
nghttp2_session_predicate_
stream_frame_send
(
nghttp2_session
*
session
,
int32_t
stream_id
)
{
nghttp2_stream
*
stream
=
nghttp2_session_get_stream
(
session
,
stream_id
);
int
r
;
...
...
@@ -625,38 +624,25 @@ static int nghttp2_session_predicate_headers_send(nghttp2_session *session,
}
}
/*
* This function checks HEADERS, which is neither stream-opening nor
* first response header, with the stream ID |stream_id| can be sent
* at this time.
*/
static
int
nghttp2_session_predicate_headers_send
(
nghttp2_session
*
session
,
int32_t
stream_id
)
{
return
nghttp2_session_predicate_stream_frame_send
(
session
,
stream_id
);
}
/*
* This function checks PRIORITY frame with stream ID |stream_id| can
* be sent at this time.
*
* This function returns 0 if it is succeeds, or one of the following
* negative error codes:
*
* NGHTTP2_ERR_STREAM_CLOSED
* The stream is already closed or does not exist.
* NGHTTP2_ERR_STREAM_SHUT_WR
* The transmission is not allowed for this stream (e.g., a frame
* with END_STREAM flag set has already sent)
* NGHTTP2_ERR_STREAM_CLOSING
* RST_STREAM was queued for this stream.
*/
static
int
nghttp2_session_predicate_priority_send
(
nghttp2_session
*
session
,
int32_t
stream_id
)
{
nghttp2_stream
*
stream
=
nghttp2_session_get_stream
(
session
,
stream_id
);
int
r
;
r
=
nghttp2_predicate_stream_for_send
(
stream
);
if
(
r
!=
0
)
{
return
r
;
}
/* The spec is not clear if the receiving side can issue PRIORITY
and the other side should do when receiving it. We just send
PRIORITY if requested. */
if
(
stream
->
state
!=
NGHTTP2_STREAM_CLOSING
)
{
return
0
;
}
else
{
return
NGHTTP2_ERR_STREAM_CLOSING
;
}
return
nghttp2_session_predicate_stream_frame_send
(
session
,
stream_id
);
}
/*
...
...
@@ -1133,15 +1119,17 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session)
}
break
;
}
case
NGHTTP2_PRIORITY
:
{
nghttp2_stream
*
stream
=
nghttp2_session_get_stream
(
session
,
frame
->
hd
.
stream_id
);
case
NGHTTP2_PRIORITY
:
// TODO Update priority of the stream if the stream is initiated
// by the local endpoint. The spec is not detailed about this.
if
(
nghttp2_session_is_my_stream_id
(
session
,
frame
->
hd
.
stream_id
))
{
nghttp2_stream
*
stream
;
stream
=
nghttp2_session_get_stream
(
session
,
frame
->
hd
.
stream_id
);
if
(
stream
)
{
// Just update priority for the stream for now.
stream
->
pri
=
frame
->
priority
.
pri
;
}
break
;
}
break
;
case
NGHTTP2_RST_STREAM
:
nghttp2_session_close_stream
(
session
,
frame
->
hd
.
stream_id
,
frame
->
rst_stream
.
error_code
);
...
...
@@ -1636,8 +1624,11 @@ int nghttp2_session_on_priority_received(nghttp2_session *session,
stream
=
nghttp2_session_get_stream
(
session
,
frame
->
hd
.
stream_id
);
if
(
stream
)
{
if
((
stream
->
shut_flags
&
NGHTTP2_SHUT_RD
)
==
0
)
{
// Just update priority anyway for now
// Update the priority of the stream if the stream is initiated
// by the remote endpoint.
if
(
!
nghttp2_session_is_my_stream_id
(
session
,
frame
->
hd
.
stream_id
))
{
stream
->
pri
=
frame
->
priority
.
pri
;
}
nghttp2_session_call_on_frame_received
(
session
,
frame
);
}
else
{
return
nghttp2_session_handle_invalid_stream
(
session
,
frame
,
...
...
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