multi & hiper examples: updates and cleanups
all multi and hiper examples: * don't loop curl_multi_perform calls, that was <7.20.0 style, currently the exported multi functions will not return CURLM_CALL_MULTI_PERFORM all hiper examples: * renamed check_run_count to check_multi_info * don't compare current running handle count with previous value, this was the wrong way to check for finished requests, simply call curl_multi_info_read * it's also safe to call curl_multi_remove_handle inside the curl_multi_info_read loop. ghiper.c: * replaced curl_multi_socket (that function is marked as obsolete) calls with curl_multi_socket_action calls (as in hiperfifo.c and evhiperfifo.c) ghiper.c and evhiperfifo.c: * be smart as hiperfifo.c, don't do uncessary curl_multi_* calls in new_conn and main
This commit is contained in:

committed by
Daniel Stenberg

parent
67c83eb9eb
commit
5fb4279ec7
@@ -184,12 +184,7 @@ fill_buffer(URL_FILE *file,int want,int waittime)
|
||||
|
||||
default:
|
||||
/* timeout or readable/writable sockets */
|
||||
/* note we *could* be more efficient and not wait for
|
||||
* CURLM_CALL_MULTI_PERFORM to clear here and check it on re-entry
|
||||
* but that gets messy */
|
||||
while(curl_multi_perform(multi_handle, &file->still_running) ==
|
||||
CURLM_CALL_MULTI_PERFORM);
|
||||
|
||||
curl_multi_perform(multi_handle, &file->still_running);
|
||||
break;
|
||||
}
|
||||
} while(file->still_running && (file->buffer_pos < want));
|
||||
@@ -260,8 +255,7 @@ url_fopen(const char *url,const char *operation)
|
||||
curl_multi_add_handle(multi_handle, file->handle.curl);
|
||||
|
||||
/* lets start the fetch */
|
||||
while(curl_multi_perform(multi_handle, &file->still_running) ==
|
||||
CURLM_CALL_MULTI_PERFORM );
|
||||
curl_multi_perform(multi_handle, &file->still_running);
|
||||
|
||||
if((file->buffer_pos == 0) && (!file->still_running))
|
||||
{
|
||||
|
Reference in New Issue
Block a user