cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH 2/2] Correctly propagate failures

From: Jerome Vouillon <vouillon_at_pps.jussieu.fr>
Date: Fri, 16 Apr 2010 22:03:33 +0200

---
 lib/gtls.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/gtls.c b/lib/gtls.c
index 6b09280..4f5edaf 100644
--- a/lib/gtls.c
+++ b/lib/gtls.c
@@ -682,8 +682,11 @@ gtls_connect_common(struct connectdata *conn,
   struct ssl_connect_data *connssl = &conn->ssl[sockindex];
 
   /* Initiate the connection, if not already done */
-  if(ssl_connect_1==connssl->connecting_state)
-    gtls_connect_step1 (conn, sockindex);
+  if(ssl_connect_1==connssl->connecting_state) {
+    rc = gtls_connect_step1 (conn, sockindex);
+    if(rc)
+      return rc;
+  }
 
   rc = handshake(conn, sockindex, TRUE, nonblocking);
   if(rc)
-- 
1.7.0
--+HP7ph2BbKc20aGI
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
--+HP7ph2BbKc20aGI--
Received on 2001-09-17