From c4539046be2994fca498e1f1d103b54d8e7feb02 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 22 Dec 2013 15:42:12 +0900 Subject: [PATCH] nghttpx: No string copy if no cookie crumbling occurs --- src/shrpx_downstream.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shrpx_downstream.cc b/src/shrpx_downstream.cc index d3b7ab72..2f1e1fa2 100644 --- a/src/shrpx_downstream.cc +++ b/src/shrpx_downstream.cc @@ -236,6 +236,9 @@ void Downstream::crumble_request_cookie() } if(num == 0) { + if(first == 0 && j == last) { + break; + } rep_cookie = kv.second.substr(first, j - first); } else { cookie_hdrs.push_back