--- curl-7.19.0-20080713.orig/lib/multi.c Fri Jun 20 02:00:09 2008 +++ curl-7.19.0-20080713/lib/multi.c Sat Aug 2 04:23:16 2008 @@ -1632,12 +1632,12 @@ longer supervised ones and add new ones */ /* walk over the sockets we got right now */ - for(i=0; (i< MAX_SOCKSPEREASYHANDLE) && - (curraction & (GETSOCK_READSOCK(i) | GETSOCK_WRITESOCK(i))); - i++) { + for(i=0; i< MAX_SOCKSPEREASYHANDLE; i++) { int action = CURL_POLL_NONE; s = socks[i]; + if (s == CURL_SOCKET_BAD) + break; /* get it from the hash */ entry = Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s)); @@ -1670,6 +1670,10 @@ entry->action = action; /* store the current action state */ } + /* if we are in DONE state, don't delete sockets yet */ + if (easy->state == CURLM_STATE_DONE) + return; + num = i; /* number of sockets */ /* when we've walked over all the sockets we should have right now, we must