cURL / Mailing Lists / curl-library / Single Mail

curl-library

chunked Transfer-Encoding and spurious \r\n in output

From: Bram de Jong <bram.dejong_at_native-instruments.de>
Date: Fri, 21 Feb 2014 19:25:52 +0100

Hi everyone,

I'm getting a binary file via libcurl (7.35.0) and the server is sending
the data in chunks to me. In the bytes I get from libcurl I see spurious
\r\n's.

Is this normal? Am *I* supposed to strip out the \r\n's from the chunks?

See the verbose output below for the next bit: as you can see this is
actually after a 302/redirect from another server. I set up libcurl to
follow automatically... It seems weird to me that the first server says
that the reply will be chunked, but the second doesn't repeat this, even
though the reply is chunked!

Any help or pointers are appreciated!

greetings,

  - bram

> GET /some/url HTTP/1.1
Host: api.*********.com
Accept: */*

< HTTP/1.1 302 Moved Temporarily
< Location: http://mn.*********.com/albums/024/169/345/m.jpeg
< Date: Fri, 21 Feb 2014 18:15:34 GMT
< Connection: keep-alive
< Transfer-Encoding: chunked
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Methods: GET,PUT,DELETE,POST,OPTIONS
< Access-Control-Allow-Headers:
Accept-Encoding,Keep-Alive,User-Agent,If-Modified-Since,Cache-Control,Content-Type,Authorization,DNT
<
* Ignoring the response-body
* Connection #0 to host api.*********.com left intact
* Issue another request to this URL:
'http://mn.*********.com/albums/024/169/345/m.jpeg'
* Hostname was NOT found in DNS cache
* Trying 93.184.*********...
* Connected to mn.*********.com (93.184.*********) port 80 (#2)
> GET /albums/024/169/345/m.jpeg HTTP/1.1
Host: mn.*********.com
Accept: */*

< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Cache-Control: max-age=86400
< Content-Type: image/jpeg
< Date: Fri, 21 Feb 2014 18:15:34 GMT
< Etag: "4e8e237-141b-45f0047dac140"
< Expires: Sat, 22 Feb 2014 18:15:34 GMT
< Last-Modified: Sat, 27 Dec 2008 05:11:57 GMT
* Server ECS (fra/D435) is not blacklisted
< Server: ECS (fra/D435)
< X-Cache: HIT
< Content-Length: 5147
<
* Connection #2 to host mn.*********.com left intact
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-02-21