curl-and-python

Re: aborting a transaction

From: Seth Vidal <skvidal_at_fedoraproject.org>
Date: Thu, 24 Sep 2009 14:12:05 -0400 (EDT)

On Thu, 24 Sep 2009, Daniel Stenberg wrote:

> libcurl does the service of putting each complete header in a buffer before
> it calls the app simply to make life easier for the apps, since they can thus
> assume that they always get full headers and not have to support getting tiny
> fragments or pieces with embedded newlines etc.

Is there a way within the python bindings to get access to each line of
the header from the writefunction? Right now I'm calling perform() and I
had to write my own headerfunction so I can get the content-length to
properly initialize my progress callback.

In my tinkering I couldn't find a way to access the header or lines of the
header from within the writefunction or progressfunction.

> lib/transfer.c:readwrite_http_headers() is the responsible function. I guess
> at least some kind of fixed maximum header length (like a 100KB or 1MB or so)
> is suitable to use there. Wouldn't you agree on that?

Nod - pick a number, any number, really. Just as long as it isn't
unlimited.

I pulled 2MB straight out of thin air.
-sv

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2009-09-24