From 0baf93fd7bc9ba98c04dc7a747ba1f56b2acb2b8 Mon Sep 17 00:00:00 2001 From: nick Date: Tue, 11 Feb 2014 20:43:44 +0000 Subject: [PATCH] proxy: Fix a read corruption issue caused by us failing to reset needles on timeout --- src/proxy.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/proxy.c b/src/proxy.c index fed1cd8..4f66b4e 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -797,6 +797,13 @@ void proxy_session( struct proxier* proxy ) proxy_session_state_names[state] ); state = CONNECT_TO_UPSTREAM; + + /* Since we've timed out, we won't have gone through the timeout logic + * in the various state handlers that resets these appropriately... */ + proxy->init.size = 0; + proxy->init.needle = 0; + proxy->rsp.size = 0; + proxy->rsp.needle = 0; } } }