![]() ![]() Num_transfers = 3 /* a suitable low default */ /* init a multi stack */ multi_handle = curl_multi_init() Įlse timeout. If(! num_transfers || ( num_transfers > NUM_HANDLES)) * if given a number, do that many transfers */ num_transfers = atoi( argv) Int still_running /* keep number of running handles */ if( argc > 1) * * Simply download two files over HTTP/2, using the same physical connection! */ int main( int argc, char * * argv) * wait for pipe connection to confirm */ curl_easy_setopt( hnd, CURLOPT_PIPEWAIT, 1L) * we use a self-signed test server, skip verification during debugging */ curl_easy_setopt( hnd, CURLOPT_SSL_VERIFYPEER, 0L) Ĭurl_easy_setopt( hnd, CURLOPT_SSL_VERIFYHOST, 0L) Set the timeout val as mini as you can curl_easy_setopt( hnd, CURLOPT_TIMEOUT, 1L) Ĭurl_easy_setopt( hnd, CURLOPT_NOPROGRESS, 0) Ĭurl_easy_setopt( hnd, CURLOPT_XFERINFOFUNCTION, progress_cb) * HTTP/2 please */ curl_easy_setopt( hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0) ![]() * set the same URL */ curl_easy_setopt( hnd, CURLOPT_URL, " /* send it verbose for max debuggaility */ curl_easy_setopt( hnd, CURLOPT_VERBOSE, 1L) * write to this file */ curl_easy_setopt( hnd, CURLOPT_WRITEDATA, out) If I return > 0, the libcurl will reconnect the connect printf( "progress_callback exit\n") It is _not_ defined to zero in a recent libcurl header. #include #include #include /* somewhat unix-specific */ #include #include /* curl stuff */ #include #ifndef CURLPIPE_MULTIPLEX /* This little trick will just make sure that we don't enable pipelining for libcurls old enough to not have this symbol. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |