cURL / Mailing Lists / curl-library / Single Mail

curl-library

multi API q

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 27 Nov 2001 13:56:16 +0100 (MET)

Imagine a working "multi" interface for libcurl. The multi-app.c example code
is working. Using that code, you can downlad HTTP and upload FTP
simultaneously while also taking care of your own file descriptors. In one
single thread.

Now, a question. Say you want to download several HTTP pages using the http
handle (while the FTP transfer is still going). How would you go about and do
that?

When using the easy interface, you just call curl_easy_perform() again, but
with the multi interface, there's really no good equivalent way of doing
that. Using the currently described API (approach A), I figure you'd need
to:

 1. Remove the single http handle from the multi stack with
    curl_multi_remove_handle()
 2. Set new options in the http handle with curl_easy_setopt(), in good old
    style.
 3. Attach the handle again to the multi stack with curl_multi_add_handle()

Alternatively, the handle could B) be removed automatically from the stack
when the transfer is done, or perhaps C) the new options could be set on the
handle without removing it from the multi stack, only requiring a call to
some function to let it know the options are updated and that it is ready for
another run...

I know this question is very theoritecal and hypothetical, but I still need
to decide...

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-11-27