cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1202 Response body not parsed for OK 200 if If-Modified-Since matches Last-Modified

From: Niko Sams <nikotto_at_users.sf.net>
Date: Tue, 05 Mar 2013 08:57:03 +0000

Including a Content-Length doesn't make a difference:

    curl localhost:1234 -v -z "Mon, 25 Feb 2013 13:35:56 GMT"
    * About to connect() to localhost port 1234 (#0)
    * Trying 192.168.0.128...
    * Connected to localhost (127.0.0.1) port 1234 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:1234
> Accept: */*
> If-Modified-Since: Mon, 25 Feb 2013 13:35:56 GMT
>
    < HTTP/1.1 200 OK
    < Content-Type: text/plain
    < Last-Modified: Mon, 25 Feb 2013 13:35:56 GMT
    < Content-Length: 8
    <
    * The requested document is not new enough
    * Closing connection 0

---
** [bugs:#1202] Response body not parsed for OK 200 if If-Modified-Since matches Last-Modified**
**Status:** open
**Created:** Mon Mar 04, 2013 07:43 AM UTC by Niko Sams
**Last Updated:** Tue Mar 05, 2013 08:43 AM UTC
**Owner:** Daniel Stenberg
For some reason fetching the url with lastmodified options doesn't work 
correctly. The server returns a 200 OK but the response doesn't include the 
body.
to reproduce start the following php script:
    <?php 
    $sock = socket_create_listen(1234); 
    socket_getsockname($sock, $addr, $port); 
    print "Server Listening on $addr:$port\n"; 
    while($c = socket_accept($sock)) { 
        socket_getpeername($c, $raddr, $rport); 
        print "Received Connection from $raddr:$rport\n";
        $buf = '';
        do {
            $l = socket_read($c, 1024);
            $buf .= $l;
        } while (substr($buf, -4) != "\r\n\r\n");
        echo $buf."\n";
        $out = "HTTP/1.1 200 OK
    Content-Type: text/plain
    Last-Modified: Mon, 25 Feb 2013 13:35:56 GMT
    test
    ";
	$out = str_replace("\n", "\r\n", $out);
	echo $out;
	socket_write($c, $out, strlen($out));
	socket_close($c);
    } 
    socket_close($sock); 
    ?>
and try to fetch:
`curl localhost:1234 -v -z "Mon, 25 Feb 2013 13:35:56 GMT"`
Expected behavior:
body ("test") should be included in response
Actual behavior:
body is *not* included in response
Downstream bug: https://bugs.php.net/bug.php?id=64298
---
Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/curl/bugs/1202/>
To unsubscribe from further messages, please visit <https://sourceforge.net/auth/prefs/>
Received on 2013-03-05

These mail archives are generated by hypermail.

donate! Page updated January 05, 2012.
web site info

File upload with ASP.NET