http://bugs.squid-cache.org/attachment.cgi?id=2166&action=diff Backported to squid-3.1.5 by Kerin Millar diff -urp squid-3.1.5.orig/src/HttpReply.cc squid-3.1.5/src/HttpReply.cc --- squid-3.1.5.orig/src/HttpReply.cc 2010-07-15 00:40:43.562561668 +0400 +++ squid-3.1.5/src/HttpReply.cc 2010-07-15 00:51:09.046799333 +0400 @@ -607,6 +607,7 @@ HttpReply * HttpReply::clone() const { HttpReply *rep = new HttpReply(); + rep->sline = sline; // used in hdrCacheInit() call above rep->header.append(&header); rep->hdrCacheInit(); rep->hdr_sz = hdr_sz; @@ -615,8 +616,7 @@ HttpReply::clone() const rep->body_pipe = body_pipe; rep->protocol = protocol; - rep->sline = sline; - rep->keep_alive = keep_alive; + // keep_alive is handled in HttpMsg::hdrCacheInit() return rep; } diff -urp squid-3.1.5.orig/src/HttpRequest.cc squid-3.1.5/src/HttpRequest.cc --- squid-3.1.5.orig/src/HttpRequest.cc 2010-07-02 06:47:30.000000000 +0400 +++ squid-3.1.5/src/HttpRequest.cc 2010-07-15 00:45:21.755798990 +0400 @@ -188,7 +188,7 @@ HttpRequest::clone() const // urlPath handled in ctor copy->canonical = canonical ? xstrdup(canonical) : NULL; - copy->range = range ? new HttpHdrRange(*range) : NULL; + // range handled in hdrCacheInit() copy->ims = ims; copy->imslen = imslen; copy->max_forwards = max_forwards; @@ -358,6 +358,7 @@ HttpRequest::hdrCacheInit() { HttpMsg::hdrCacheInit(); + assert(!range); range = header.getRange(); }