cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: CURLOPT_WRITEFUNCTION callback not called when If-Modified-Since not obeyed

From: Steve Liao <steve_at_broadsoft.com>
Date: Thu, 12 May 2011 15:29:28 -0700

Daniel Stenberg wrote:

> On Thu, 12 May 2011, Steve Liao wrote:
>
> > My application uses CURL_TIMECOND_IFMODSINCE. When the HTTP server returns
> > a 304 in response to an HTTP GET in which the If-Modified-Since header is
> > the same time as the last modification time of the file, things are fine.
> >
> > However, when an HTTP server that doesn't obey that header returns a 200
> > response and provides the file content, the callback registered against
> > CURLOPT_WRITEFUNCTION doesn't get called even though there is file content.
> > This behavior is observed on libcurl 7.21.6. When the application is built
> > against libcurl 7.17.1, this beahavior doesn't show up - the callback
> > registered against CURLOPT_WRITEFUNCTION gets called.
>
> So what's the full set of request headers in the libcurl request and response
> headers from the server?

GET . . . . HTTP/1.1\r\n
Authorization: . . . <snip>. . .
Host: 192.168.0.1\r\n
Accept: */*\r\n
If-Modified-Since: Sun, 01 May 2011 17:11:14 GMT\r\n
\r\n

HTTP/1.1 200 OK\r\n
Date: Thu, 12 May 2011 14:18:14 GMT\r\n
Server: BW HTTP Server\r\n
Set-Cookie: JSESSIONID=41237EB45A1D4BC2B3AF019E8482E9E6; Path=. . . . .\r\n
Expires: Fri, 13 May 2011 10:18:14 EDT\r\n
Cache-Control: max-age=86400\r\n
Last-Modified: Sun, 01 May 2011 17:11:14 GMT\r\n
Content-Length: 81764\r\n
Content-Type: audio/x-wav\r\n
\r\n
Media Type
    Media Type: audio/x-wav (81764 bytes)

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-13