mirror of
https://gitee.com/openharmony/third_party_nghttp2
synced 2024-11-27 18:10:47 +00:00
Remove priority adjustment for a DATA frame
Simply it does not work as expected.
This commit is contained in:
parent
f5b1974473
commit
0dec04921d
@ -34,10 +34,6 @@
|
||||
|
||||
/* Priority for PING */
|
||||
#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 {
|
||||
nghttp2_data_provider *data_prd;
|
||||
@ -50,19 +46,7 @@ typedef struct {
|
||||
nghttp2_frame_category frame_cat;
|
||||
void *frame;
|
||||
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;
|
||||
uint32_t pridecay;
|
||||
int64_t seq;
|
||||
} nghttp2_outbound_item;
|
||||
|
||||
|
@ -415,8 +415,6 @@ int nghttp2_session_add_frame(nghttp2_session *session,
|
||||
free(item);
|
||||
return r;
|
||||
}
|
||||
item->inipri = item->pri;
|
||||
item->pridecay = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -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.
|
||||
*
|
||||
@ -1368,7 +1344,6 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session)
|
||||
} else {
|
||||
nghttp2_outbound_item* next_item;
|
||||
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
|
||||
waiting at the top of the queue, we continue to send this
|
||||
data. */
|
||||
|
Loading…
Reference in New Issue
Block a user