cURL / Mailing Lists / curl-library / Single Mail

curl-library

Fix for known bug #64 / simplification of hostthre.c

From: Constantine Sapuntzakis <csapuntz_at_gmail.com>
Date: Sun, 6 Sep 2009 22:59:23 -0700

The addrinfo callback is now called in the same thread as
curl_multi_add_handle / curl_multi_perform / curl_multi_socket_action.

This patch gets rid of most of the synchronization and just waits for the
resolver thread to exit. The benefit is simplicity.

This patch does not really support timeout of async name lookups -- the
patch will eventually wait for the thread to exit in
Curl_destroy_thread_data if it hasn't earlier. There is no safe way to abort
the name lookup thread (TerminateThread is not safe), so the patch doesn't
do it. Abandoning the name lookup thread isn't safe either - threads can
accumulate or if the curl DLL is unloaded, the thread would crash the
process.

-Costa

Received on 2009-09-07