------------------------------------------------------------ revno: 13035 revision-id: squid3@treenet.co.nz-20131119225146-egmh0zbj38npjw0r parent: squid3@treenet.co.nz-20131119225029-dipkpauphy9g6jfx author: Alex Rousskov committer: Amos Jeffries branch nick: 3.4 timestamp: Tue 2013-11-19 15:51:46 -0700 message: Re-compute Range response content offset after an FTP response was adapted. Moved HTTP-only offset calculation code to the general ServerStateData code so that [converted-to-HTTP] FTP responses can use it. FTP code computes the range offset on its own earlier, but we must REcalculate in case the response is adapted into a response with a different (or no) content range. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20131119225146-egmh0zbj38npjw0r # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # testament_sha1: e09f899da339b2cc88b52433b6336e38fc29dc55 # timestamp: 2013-11-19 22:52:28 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.4 # base_revision_id: squid3@treenet.co.nz-20131119225029-\ # dipkpauphy9g6jfx # # Begin patch === modified file 'src/Server.cc' --- src/Server.cc 2013-07-26 03:14:01 +0000 +++ src/Server.cc 2013-11-19 22:51:46 +0000 @@ -39,6 +39,7 @@ #include "fd.h" #include "err_detail_type.h" #include "errorpage.h" +#include "HttpHdrContRange.h" #include "HttpReply.h" #include "HttpRequest.h" #include "Server.h" @@ -525,6 +526,11 @@ { Must(theFinalReply); maybePurgeOthers(); + + // adaptation may overwrite old offset computed using the virgin response + const bool partial = theFinalReply->content_range && + theFinalReply->sline.status() == Http::scPartialContent; + currentOffset = partial ? theFinalReply->content_range->spec.offset : 0; } HttpRequest * === modified file 'src/http.cc' --- src/http.cc 2013-10-23 05:11:22 +0000 +++ src/http.cc 2013-11-19 22:51:46 +0000 @@ -913,9 +913,6 @@ Ctx ctx = ctx_enter(entry->mem_obj->url); HttpReply *rep = finalReply(); - if (rep->sline.status() == Http::scPartialContent && rep->content_range) - currentOffset = rep->content_range->spec.offset; - entry->timestampsSet(); /* Check if object is cacheable or not based on reply code */