curl-and-python

PyCurl READFUNCTION - set number of characters to read

From: Tom Rioux <trioux_at_tango.me>
Date: Tue, 22 Oct 2013 16:49:49 -0700

The format of the pycurl readback function is this:
| READFUNCTION(|/number of characters to read/|)|/-> string/

My function starts off like this:

   def my_pycurl_READFUNCTION(pycurl_size):
     print('pycurl_size=%s' % pycurl_size)
     ...
     return some_value # where some_value > 16kb

The value of pycurl_size is 16384 (16kb).

I get this error when the return string is larger than 16kb:

   pycurl.error: invalid return value for read callback 16925 16384

Is it possible to change the value that is passed to the READFUNCTION
callback?

I tried setting BUFFERSIZE, but it appears to be a WRITEFUNCTION option.

Thanks,
Tom

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2013-10-23