cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to provide data to curl in multi_socket interface

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 13 May 2016 14:15:39 +0200 (CEST)

On Fri, 13 May 2016, smruti kumari wrote:

(There's no point in sending these emails to curl-users-request_at_cool.haxx.se.
That's the address for mailing list requests for the curl-users list.)

> I am using multi_socket interface for my project.I will send huge data in
> data buffer pointer by using curl_easy_setopt(curl, CURLOPT_POSTFIELDS,
> data) API. Since I am using multip interface(i.e. non-blocking) it may not
> send complete packet in single shot.

> When I call curl_multi_socket_action() 2nd time how data pointer need to
> provide to curl_easy_setop() API as a argument ?

Isn't this documented clearly in quite a few places? Can you tell me what
you've read and if there's anyting in that documentation that makes these
details unclear?

You set options to the easy handle - before the transfer. Then you perform the
transfer. Normal transfers don't need options changed during the transfer, and
in fact most options can't even be modified while the transfer is in progress.

> Is curl copying the data buffer pointer and sending internally when we call
> 2nd time ?

You setup a transfer with the options in the easy handle. That transfer will
then be performed when you've added it to the multi handle and you "drive"
that and potentially other transfers.

Yes, it'll handle (send) all the data you ask it to handle. It would be a very
strange transfer if it only copied some small portion of the data you asked it
to send.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2016-05-13