curl-library
Re: getinmemory.c problems
Date: Fri, 28 Dec 2012 10:54:14 -0600
On Fri, Dec 28, 2012 at 10:50:10AM +0100, Dan Fandrich wrote:
> getinmemory.c is designed to be an easy-to-understand demonstration
> program, not a production-ready one.
Fair enough... though it's still not clear to me why the example
program retrieves no data. Other than memory allocation scheme, it
does not appear to be substantively different from mine.
> > 2. If you point getinmemory.c at, say, www.google.com (or several
> > other sites I tried, including one of my own), you get no results.
> > It just prints "0 bytes retrieved" and dies a happy death.
> > Clearly, this is the Wrong Thing¢â. Though to be honest, it's not
> > clear to me why it does that. It does work with most sites I
> > tried... including others of my own.
>
> Have you looked at the headers from the server in these cases? You'll
> probably find that there is no Content-Length: header sent. The Web 2.0
> world of dynamically-generated pages means that at many sites even the
> server doesn't know what the page length is going to be until it's
> completely sent.
Well that's interesting. You're right; the server is sending the
pages as chunked encoding without a content length. I wasn't
expecting that.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- application/pgp-signature attachment: stored