On Mon, Nov 16, 2009 at 12:55 PM, Lars Nilsson <[email protected]> wrote: > On Mon, Nov 16, 2009 at 7:47 AM, Andy Shellam (Mailing Lists) > <[email protected]> wrote: >> Notice that the pointer to the data (ptr) has the address of 0x1 which >> causes a segfault if I try to read it: >> >> (gdb) p (char*)ptr >> $1 = 0x1 <Address 0x1 out of bounds> >> >> Also the "307" passed to the size parameter is actually the size of the data >> received - no idea what the nmemb figure is. In my working application, the >> size of the data is in the nmemb parameter, and the size parameter is always >> 1. >> >> Any ideas what could cause this? Note that the working application does >> typically have 2-3 calls made to my write function (it receives an average >> of 25KB) whereas this one has tiny responses (average of 300 bytes) - is >> that significant? > > Make OnDataRead() a static member function and use CURLOPT_WRITEDATA > (possibly the "this" pointer when setting up the connection) to > provide a proper context for each callback?
I now see others have replied to another copy of this email, so disregard my reply, please. Lars Nilsson ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
