[squid-users] mangle ranges using ICAP

Amos Jeffries squid3 at treenet.co.nz
Mon Dec 5 02:33:29 UTC 2016

On 5/12/2016 11:05 a.m., Alfredo Rezinovsky wrote:
> Let say a client asks for a URL using a range: 0-256000.
> I want squid to ask just for 10.000 bytes and answer as if the request was
> server side aborted.
> I can change the request Range: "bytes=0-256000" to "bytes=0-10000" with
> and icap server
> In the answer I'm trying to change the Content-Range from "0-10000/total"
> to "0-256000/total" and Content-Length from "10001" to "256001" squid won't
> hung up and the client will stay waiting after the first 10001 bytes.
> There's a way to make squid send what it gets from the icap and then drop
> the TCP connection as in a server side aborted connection?

Squid is a network proxy for production use, not a piece of testing
software. To see what happens when a server disconnects early ... make
the server disconnect early.

There is also no relationship between client and server TCP connections
in HTTP proxying. And there is no server abort happening in your setup.
So the server abort handling is not going to happen. Period.

ICAP has told Squid there are 256000 bytes comming *from ICAP*, not from
any server. How those bytes are found/generated is not up to Squid.
Since ICAP only requested 10000 bytes from the server the rest is up to
the ICAP service to generate somehow. Squid is simply waiting for that
_ICAP_ transaction to complete.
 --> What you are emulating is the handling of an ICAP service hanging.


More information about the squid-users mailing list