mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-08 02:58:53 +08:00
nghttp2_buffer: Set minimum buffer size to 8
This commit is contained in:
@@ -49,7 +49,7 @@ int nghttp2_buffer_reserve(nghttp2_buffer *buffer, size_t len)
|
||||
}
|
||||
if(buffer->capacity < len) {
|
||||
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_buf = realloc(buffer->buf, new_cap);
|
||||
if(new_buf == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user