]> granicus.if.org Git - curl/commitdiff
SOCKS5: when name resolves fail return immediately
authorDaniel Stenberg <daniel@haxx.se>
Fri, 16 Apr 2010 20:58:04 +0000 (22:58 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 16 Apr 2010 20:58:04 +0000 (22:58 +0200)
This makes the code flow more obvious and reacts on the return
code properly, even if the code acted the same way before.

lib/socks.c

index eb795679818f56f635d65a522ab5dbaafc6243ec..0b051545c49e526a1895f6dfd33931fed94a81a8 100644 (file)
@@ -597,9 +597,12 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
     if(rc == CURLRESOLV_ERROR)
       return CURLE_COULDNT_RESOLVE_HOST;
 
-    if(rc == CURLRESOLV_PENDING)
+    if(rc == CURLRESOLV_PENDING) {
       /* this requires that we're in "wait for resolve" state */
       rc = Curl_wait_for_resolv(conn, &dns);
+      if(rc)
+        return rc;
+    }
 
     /*
      * We cannot use 'hostent' as a struct that Curl_resolv() returns.  It