cURL
Haxx ad
libcurl

Shopping cart software, Online file storage, Online photo storage, Hosted shopping cart, Contact management software, Email marketing software, Project management software, Issue tracking software, Online notepad, Web publishing software

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Archives

Re: curlopt_writefunction sending weird parameter values

From: Lars Nilsson <chamaeleon_at_gmail.com>
Date: Mon, 16 Nov 2009 12:55:08 -0500

On Mon, Nov 16, 2009 at 7:47 AM, Andy Shellam (Mailing Lists)
<andy-lists_at_networkmail.eu> 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?

Lars Nilsson
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-16

These mail archives are generated by hypermail.

donate! Page updated November 16, 2009.
web site info

File upload with ASP.NET