From 52503a2addc5460d37863be2ac74f67b41eb929a Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 7 Jun 2018 22:57:49 -0400 Subject: [PATCH] updates proxy to always allocate 4K buffers on socket read --- vere/http.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vere/http.c b/vere/http.c index 1566cccfea..8ecd00216b 100644 --- a/vere/http.c +++ b/vere/http.c @@ -989,8 +989,11 @@ _proxy_alloc(uv_handle_t* had_u, size_t len_i, uv_buf_t* buf) { - void* ptr_v = c3_malloc(len_i); - *buf = uv_buf_init(ptr_v, len_i); + // len_i is always 64k, so we're ignoring it + // using fixed size 4K buffer for + // XX consider h2o_buffer_t, a pool, or something XX + void* ptr_v = c3_malloc(4096); + *buf = uv_buf_init(ptr_v, 4096); } /* _proxy_write_free(): free uv_write struct and linked buffer