curl-and-python

aborting a transaction

From: Seth Vidal <skvidal_at_fedoraproject.org>
Date: Tue, 22 Sep 2009 17:48:26 -0400 (EDT)

Hi all,
  confused by a problem.

From the libcurl programming guide:

"A malicious server could cause libcurl to download an infinite amount of
data, potentially causing all of memory or disk to be filled. Setting the
CURLOPT_MAXFILESIZE_LARGE option is not sufficient to guard against this.
Instead, the app should monitor the amount of data received within the
write or progress callback and abort once the limit is reached. "

From pycurl, I have my progress function checking against a set size
and/or the content-length to make sure we've not being given an endless
stream of data. I also do this in the header read function.

How do I promote it up the stack so perform() gets the right error
message? Can I just raise pycurl.error(63, 'msg here')? B/c that doesn't
seem to do what I'd expect.

thanks,
-sv

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