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
8b3a3efa
Commit
8b3a3efa
authored
Jul 20, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change priority increasing scheme
parent
c85220e6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
lib/nghttp2_outbound_item.h
lib/nghttp2_outbound_item.h
+6
-5
lib/nghttp2_session.c
lib/nghttp2_session.c
+11
-3
No files found.
lib/nghttp2_outbound_item.h
View file @
8b3a3efa
...
@@ -56,12 +56,13 @@ typedef struct {
...
@@ -56,12 +56,13 @@ typedef struct {
inipri. The item is chosen from the queue based on pri and
inipri. The item is chosen from the queue based on pri and
seq. For control frames, they consist of just 1 frame and pri
seq. For control frames, they consist of just 1 frame and pri
does not change. For DATA frame, they could split up to several
does not change. For DATA frame, they could split up to several
frames. After sending a frame, the pri
is increased by 1. If it
frames. After sending a frame, the pri
becomes |inipri| +
becomes more than lowest priority, then it returns back to inipri
|pridecay| and |pridecay| is multiplied by 2. If it becomes more
and do the same sequence again and again. By doing this,
the
than lowest priority, then it returns back to |inipri| and do
the
higher priority long DATA frames don't starve the lower
same sequence again and again. By doing this, the higher priority
prioritized streams. */
long DATA frames don't starve the lower
prioritized streams. */
int
pri
;
int
pri
;
uint32_t
pridecay
;
int64_t
seq
;
int64_t
seq
;
}
nghttp2_outbound_item
;
}
nghttp2_outbound_item
;
...
...
lib/nghttp2_session.c
View file @
8b3a3efa
...
@@ -388,6 +388,7 @@ int nghttp2_session_add_frame(nghttp2_session *session,
...
@@ -388,6 +388,7 @@ int nghttp2_session_add_frame(nghttp2_session *session,
return
r
;
return
r
;
}
}
item
->
inipri
=
item
->
pri
;
item
->
inipri
=
item
->
pri
;
item
->
pridecay
=
1
;
return
0
;
return
0
;
}
}
...
@@ -979,12 +980,19 @@ nghttp2_outbound_item* nghttp2_session_pop_next_ob_item
...
@@ -979,12 +980,19 @@ nghttp2_outbound_item* nghttp2_session_pop_next_ob_item
static
void
nghttp2_outbound_item_adjust_pri
(
nghttp2_session
*
session
,
static
void
nghttp2_outbound_item_adjust_pri
(
nghttp2_session
*
session
,
nghttp2_outbound_item
*
item
)
nghttp2_outbound_item
*
item
)
{
{
assert
(
item
->
pri
>
0
);
if
(
item
->
pri
==
NGHTTP2_PRI_LOWEST
)
{
if
(
item
->
pri
==
NGHTTP2_PRI_LOWEST
)
{
item
->
pri
=
item
->
inipri
;
nghttp2_stream
*
stream
;
}
else
if
(
item
->
pri
>
(
int32_t
)
NGHTTP2_PRI_LOWEST
/
2
)
{
stream
=
nghttp2_session_get_stream
(
session
,
nghttp2_outbound_item_get_data_frame
(
item
)
->
hd
.
stream_id
);
assert
(
stream
);
item
->
pri
=
item
->
inipri
=
stream
->
pri
;
item
->
pridecay
=
1
;
}
else
if
(
item
->
pri
+
item
->
pridecay
>
NGHTTP2_PRI_LOWEST
)
{
item
->
pri
=
NGHTTP2_PRI_LOWEST
;
item
->
pri
=
NGHTTP2_PRI_LOWEST
;
}
else
{
}
else
{
item
->
pri
*=
2
;
item
->
pri
=
item
->
inipri
+
item
->
pridecay
;
item
->
pridecay
*=
2
;
}
}
}
}
...
...
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