cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem understanding Keep-Alive and Squid

From: Mohamed Lrhazi <lrhazi_at_gmail.com>
Date: Sun, 21 May 2006 17:46:01 -0400

I actully dud this by hand and it seems Squid works fine:

telnet 10.0.4.2 80
Trying 10.0.4.2...
Connected to 10.0.4.2.
Escape character is '^]'.
PURGE http://yaqb.org/test-cache/test.html HTTP/1.1
Proxy-Connection: Keep-Alive

HTTP/1.0 404 Not Found
Server: squid/2.5.STABLE13
Mime-Version: 1.0
Date: Sun, 21 May 2006 21:43:42 GMT
Content-Length: 0

PURGE http://yaqb.org/test-cache/test.html HTTP/1.1
Proxy-Connection: Keep-Alive

HTTP/1.0 404 Not Found
Server: squid/2.5.STABLE13
Mime-Version: 1.0
Date: Sun, 21 May 2006 21:43:56 GMT
Content-Length: 0

As you can see it does not close the connection so I could send an
other request.
Why is the connection closed when using cURL?
Thanks a lot.

On 5/21/06, Mohamed Lrhazi <lrhazi_at_gmail.com> wrote:
> Hello,
>
> I need to send PURGE requests to Squid servers and would like it all
> to happen pipelined using HTTP Keep-Alive...
> When I try using GET method, keep alive seems to work fine:
>
> Testing libcurl/7.15.3 OpenSSL/0.9.8b zlib/1.1.4
> DEBUG: 0: About to connect() to proxy 10.0.4.2 port 80
> DEBUG: 0: Trying 10.0.4.2...
> DEBUG: 0: connected
> DEBUG: 0: Connected to 10.0.4.2 (10.0.4.2) port 80
> DEBUG: 2: GET http://yaqb.org/test-cache/test.html HTTP/1.1
> DEBUG: 2: User-Agent: PycURL/7.15.3
> DEBUG: 2: Host: yaqb.org
> DEBUG: 2: Pragma: no-cache
> DEBUG: 2: Accept: */*
> DEBUG: 2: Proxy-Connection: Keep-Alive
> DEBUG: 1: HTTP/1.0 200 OK
> DEBUG: 1: Server: Zeus/4.3
> DEBUG: 1: Date: Sun, 21 May 2006 21:32:26 GMT
> DEBUG: 1: Content-Length: 29
> DEBUG: 1: Accept-Ranges: bytes
> DEBUG: 1: Content-Type: text/html
> DEBUG: 1: Last-Modified: Sun, 21 May 2006 04:32:45 GMT
> DEBUG: 1: X-Cache: MISS from yscache2.your-site.com
> DEBUG: 0: HTTP/1.0 proxy connection set to keep alive!
> DEBUG: 1: Proxy-Connection: keep-alive
> DEBUG: 0: Connection #0 to host 10.0.4.2 left intact
>
>
> When switch to method PURGE using: c.setopt(c.CUSTOMREQUEST,'PURGE')
> I then get:
>
> Testing libcurl/7.15.3 OpenSSL/0.9.8b zlib/1.1.4
> DEBUG: 0: About to connect() to proxy 10.0.4.2 port 80
> DEBUG: 0: Trying 10.0.4.2...
> DEBUG: 0: connected
> DEBUG: 0: Connected to 10.0.4.2 (10.0.4.2) port 80
> DEBUG: 2: PURGE http://yaqb.org/test-cache/test.html HTTP/1.1
> DEBUG: 2: User-Agent: PycURL/7.15.3
> DEBUG: 2: Host: yaqb.org
> DEBUG: 2: Pragma: no-cache
> DEBUG: 2: Accept: */*
> DEBUG: 2: Proxy-Connection: Keep-Alive
> DEBUG: 1: HTTP/1.0 200 OK
> DEBUG: 1: Server: squid/2.5.STABLE13
> DEBUG: 1: Mime-Version: 1.0
> DEBUG: 1: Date: Sun, 21 May 2006 21:32:57 GMT
> DEBUG: 1: Content-Length: 0
> DEBUG: 0: Closing connection #0
>
>
> Is it cURL or Squid that causes Keep-Alive to not be used when I
> swtich the HTTP method from GET to PURGE?
>
> Thanks,
> Mohamed~
>

-- 
``We have now sunk to a depth at which restatement of the obvious is
the first duty of intelligent men.''
-George Orwell
Received on 2006-05-21