nghttp2_hd: Fix bug on local_hd_table_bufsize_max > hd_table_bufsize_max

This commit is contained in:
Tatsuhiro Tsujikawa 2013-10-26 23:30:48 +09:00
parent f49fb2b8b2
commit 22df6f4190
1 changed files with 5 additions and 4 deletions

View File

@ -804,10 +804,6 @@ static nghttp2_hd_entry* add_hd_table_incremental(nghttp2_hd_context *context,
free(new_ent); free(new_ent);
return NULL; return NULL;
} }
if(context->role == NGHTTP2_HD_ROLE_DEFLATE) {
context->local_hd_table_bufsize += room;
++context->local_hd_tablelen;
}
} }
if(room > context->hd_table_bufsize_max) { if(room > context->hd_table_bufsize_max) {
/* The entry taking more than NGHTTP2_HD_MAX_BUFFER_SIZE is /* The entry taking more than NGHTTP2_HD_MAX_BUFFER_SIZE is
@ -817,6 +813,11 @@ static nghttp2_hd_entry* add_hd_table_incremental(nghttp2_hd_context *context,
context->hd_table_bufsize += room; context->hd_table_bufsize += room;
new_ent->flags |= NGHTTP2_HD_FLAG_REFSET; new_ent->flags |= NGHTTP2_HD_FLAG_REFSET;
nghttp2_hd_ringbuf_push_front(&context->hd_table, new_ent); nghttp2_hd_ringbuf_push_front(&context->hd_table, new_ent);
if(context->role == NGHTTP2_HD_ROLE_DEFLATE &&
room <= context->local_hd_table_bufsize_max) {
context->local_hd_table_bufsize += room;
++context->local_hd_tablelen;
}
} }
return new_ent; return new_ent;
} }