Commit 58cbecbf authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttp2_buffer: Set minimum buffer size to 8

parent fbffd2c9
...@@ -49,7 +49,7 @@ int nghttp2_buffer_reserve(nghttp2_buffer *buffer, size_t len) ...@@ -49,7 +49,7 @@ int nghttp2_buffer_reserve(nghttp2_buffer *buffer, size_t len)
} }
if(buffer->capacity < len) { if(buffer->capacity < len) {
uint8_t *new_buf; uint8_t *new_buf;
size_t new_cap = buffer->capacity == 0 ? 32 : buffer->capacity * 3 / 2; size_t new_cap = buffer->capacity == 0 ? 8 : buffer->capacity * 3 / 2;
new_cap = nghttp2_min(buffer->max_capacity, nghttp2_max(new_cap, len)); new_cap = nghttp2_min(buffer->max_capacity, nghttp2_max(new_cap, len));
new_buf = realloc(buffer->buf, new_cap); new_buf = realloc(buffer->buf, new_cap);
if(new_buf == NULL) { if(new_buf == NULL) {
......
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