rendered paste body--- proxy.c.org 2007-11-22 16:30:44.000000000 +0100
+++ proxy.c 2007-11-22 16:31:45.000000000 +0100
@@ -120,11 +120,14 @@
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1);
ret = curl_easy_perform(hnd);
- /* Extract socket, and select() */
- curl_easy_getinfo(hnd, ret, &sckt);
- if(sckt==-1){
- fprintf(stderr,"[ERR] Couldn't get socket");
- return(-1);
+ if(ret == CURLE_OK)
+ {
+ /* Extract socket, and select() */
+ ret = curl_easy_getinfo(hnd, CURLINFO_LASTSOCKET, &sckt);
+ if((sckt==-1) || ret){
+ fprintf(stderr,"[ERR] Couldn't get socket");
+ return(-1);
+ }
}
wait_and_act((int)sckt);