<div dir="auto">An icap tcpdump pcap file might help to understand something.<div dir="auto"><br></div><div dir="auto">Eliezer</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 30, 2020, 16:10 Moti Berger <<a href="mailto:moberger@metanetworks.com">moberger@metanetworks.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>I have a setup with squid 5.0.4 with ICAP server handling responses. The ICAP server redirects based on some parameters of the response.</div><div><br></div><div>To test this setup, I use cURL like this:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">curl -k -s --proxy localhost:8000 -o /dev/null -v <URL></blockquote><div><br></div><div>Now, for some URLs, cURL hangs and for others it exits after receiving the 307 response.</div><div>When it hangs, I see this as the output of cURL (I removed what seemed to me as non-related logs from the beginning):</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">} [5 bytes data]<br>* TLSv1.3 (OUT), TLS Unknown, Unknown (23):<br>} [1 bytes data]<br>> GET / HTTP/1.1<br>> Host: <a href="http://www.one.co.il" target="_blank" rel="noreferrer">www.one.co.il</a><br>> User-Agent: curl/7.58.0<br>> Accept: */*<br>><br> { [5 bytes data]<br>* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):<br>{ [1 bytes data]<br>* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):<br>{ [217 bytes data]<br>* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):<br>{ [1 bytes data]<br>* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):<br>{ [217 bytes data]<br>* TLSv1.3 (IN), TLS Unknown, Unknown (23):<br>{ [1 bytes data]<br>< HTTP/1.1 307 Temporary Redirect<br>< Location: <REDIRECTION-URL><br>< Cache-Control: no-cache, no-store, must-revalidate<br>< Pragma: no-cache<br>< Date: Wed, 30 Dec 2020 13:58:51 GMT<br>< X-Cache: MISS from a0e59ea22cf8<br>< X-Cache-Lookup: MISS from a0e59ea22cf8:3128<br>< Transfer-Encoding: chunked<br>< Via: 1.1 a0e59ea22cf8 (squid/5.0.4)<br>< Connection: keep-alive<br>< </blockquote><div><br></div><div>Using tcpdump I didn't see squid send any other ICAP requests (besides OPTIONS which the ICAP server replied to properly).</div><div>For some of the URLs where it hangs, I saw that running the same cURL command with the --compressed switch, makes cURL exit as expected:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">} [5 bytes data]<br>* TLSv1.3 (OUT), TLS Unknown, Unknown (23):<br>} [1 bytes data]<br>> GET / HTTP/1.1<br>> Host: <a href="http://www.one.co.il" target="_blank" rel="noreferrer">www.one.co.il</a><br>> User-Agent: curl/7.58.0<br>> Accept: */*<br>> Accept-Encoding: deflate, gzip<br>><br> { [5 bytes data]<br>* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):<br>{ [1 bytes data]<br>* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):<br>{ [217 bytes data]<br>* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):<br>{ [1 bytes data]<br>* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):<br>{ [217 bytes data]<br>* TLSv1.3 (IN), TLS Unknown, Unknown (23):<br>{ [1 bytes data]<br>< HTTP/1.1 307 Temporary Redirect<br>< Location: <REDIRECTION URL><br>< Cache-Control: no-cache, no-store, must-revalidate<br>< Pragma: no-cache<br>< Date: Wed, 30 Dec 2020 14:00:31 GMT<br>< X-Cache: MISS from a0e59ea22cf8<br>< X-Cache-Lookup: MISS from a0e59ea22cf8:3128<br>< Transfer-Encoding: chunked<br>< Via: 1.1 a0e59ea22cf8 (squid/5.0.4)<br>< Connection: keep-alive<br><<br> { [5 bytes data]<br>* TLSv1.3 (IN), TLS Unknown, Unknown (23):<br>{ [1 bytes data]<br>* Connection #0 to host localhost left intact</blockquote><div><br></div><div>When I skip the adaptation in REQMOD, I get the page and the connection is terminated.</div><div>When the ICAP works in REQMOD and redirects on the same URLs, everything seems to work properly.</div><div><br></div><div>What could make squid not to terminate the connection? Could it be that it still holds connection with the HTTP server?</div><div><br></div><div>Thanks</div></div></div>
_______________________________________________<br>
squid-users mailing list<br>
<a href="mailto:squid-users@lists.squid-cache.org" target="_blank" rel="noreferrer">squid-users@lists.squid-cache.org</a><br>
<a href="http://lists.squid-cache.org/listinfo/squid-users" rel="noreferrer noreferrer" target="_blank">http://lists.squid-cache.org/listinfo/squid-users</a><br>
</blockquote></div>