Commit 0dec0492 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Remove priority adjustment for a DATA frame

Simply it does not work as expected.
parent f5b19744
...@@ -34,10 +34,6 @@ ...@@ -34,10 +34,6 @@
/* Priority for PING */ /* Priority for PING */
#define NGHTTP2_OB_PRI_PING -10 #define NGHTTP2_OB_PRI_PING -10
/* Priority for CREDENTIAL */
#define NGHTTP2_OB_PRI_CREDENTIAL -2
/* Priority for the frame which must be sent after CREDENTIAL */
#define NGHTTP2_OB_PRI_AFTER_CREDENTIAL -1
typedef struct { typedef struct {
nghttp2_data_provider *data_prd; nghttp2_data_provider *data_prd;
...@@ -50,19 +46,7 @@ typedef struct { ...@@ -50,19 +46,7 @@ typedef struct {
nghttp2_frame_category frame_cat; nghttp2_frame_category frame_cat;
void *frame; void *frame;
void *aux_data; void *aux_data;
/* Initial priority of this item */
int inipri;
/* The current priority of this item. Initially, pri equals to
inipri. The item is chosen from the queue based on pri and
seq. For control frames, they consist of just 1 frame and pri
does not change. For DATA frame, they could split up to several
frames. After sending a frame, the pri becomes |inipri| +
|pridecay| and |pridecay| is multiplied by 2. If it becomes more
than lowest priority, then it returns back to |inipri| and do the
same sequence again and again. By doing this, the higher priority
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;
......
...@@ -415,8 +415,6 @@ int nghttp2_session_add_frame(nghttp2_session *session, ...@@ -415,8 +415,6 @@ int nghttp2_session_add_frame(nghttp2_session *session,
free(item); free(item);
return r; return r;
} }
item->inipri = item->pri;
item->pridecay = 1;
return 0; return 0;
} }
...@@ -1193,28 +1191,6 @@ nghttp2_outbound_item* nghttp2_session_pop_next_ob_item ...@@ -1193,28 +1191,6 @@ nghttp2_outbound_item* nghttp2_session_pop_next_ob_item
} }
} }
/*
* Adjust priority of item so that the higher priority long DATA
* frames don't starve lower priority streams.
*/
static void nghttp2_outbound_item_adjust_pri(nghttp2_session *session,
nghttp2_outbound_item *item)
{
if(item->pri == NGHTTP2_PRI_LOWEST) {
nghttp2_stream *stream;
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;
} else {
item->pri = item->inipri + item->pridecay;
item->pridecay *= 2;
}
}
/* /*
* Called after a frame is sent. * Called after a frame is sent.
* *
...@@ -1368,7 +1344,6 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session) ...@@ -1368,7 +1344,6 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session)
} else { } else {
nghttp2_outbound_item* next_item; nghttp2_outbound_item* next_item;
next_item = nghttp2_session_get_next_ob_item(session); next_item = nghttp2_session_get_next_ob_item(session);
nghttp2_outbound_item_adjust_pri(session, session->aob.item);
/* If priority of this stream is higher or equal to other stream /* If priority of this stream is higher or equal to other stream
waiting at the top of the queue, we continue to send this waiting at the top of the queue, we continue to send this
data. */ data. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment