]> granicus.if.org Git - curl/commitdiff
Curl_setup_transfer: no longer returns anything
authorDaniel Stenberg <daniel@haxx.se>
Fri, 16 Apr 2010 21:43:04 +0000 (23:43 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 16 Apr 2010 21:43:04 +0000 (23:43 +0200)
This function could only return CURLE_OK and by changing it to
a void instead, we can simplify code all over.

12 files changed:
lib/dict.c
lib/ftp.c
lib/http.c
lib/imap.c
lib/pop3.c
lib/rtsp.c
lib/smtp.c
lib/ssh.c
lib/tftp.c
lib/transfer.c
lib/transfer.h
lib/url.c

index 1deab76ec83774713c97737d2adf564a262e3cd5..d86923a9fdffa9bf2edcc9187b5ed3bb2e95ab98 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -217,13 +217,12 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
 
     free(eword);
 
-    if(result)
+    if(result) {
       failf(data, "Failed sending DICT request");
-    else
-      result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
-                                   -1, NULL); /* no upload */
-    if(result)
       return result;
+    }
+    Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
+                        -1, NULL); /* no upload */
   }
   else if(Curl_raw_nequal(path, DICT_DEFINE, sizeof(DICT_DEFINE)-1) ||
            Curl_raw_nequal(path, DICT_DEFINE2, sizeof(DICT_DEFINE2)-1) ||
@@ -265,15 +264,12 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
 
     free(eword);
 
-    if(result)
+    if(result) {
       failf(data, "Failed sending DICT request");
-    else
-      result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
-                                   -1, NULL); /* no upload */
-
-    if(result)
       return result;
-
+    }
+    Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
+                        -1, NULL); /* no upload */
   }
   else {
 
@@ -290,13 +286,12 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
                           "CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\r\n"
                           "%s\r\n"
                           "QUIT\r\n", ppath);
-      if(result)
+      if(result) {
         failf(data, "Failed sending DICT request");
-      else
-        result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
-                                     -1, NULL);
-      if(result)
         return result;
+      }
+
+      Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount, -1, NULL);
     }
   }
 
index 9df4e23bcd1070824ed74f85f12a1adac15eb111..11bd80fd6bcb5a648103756b49edbfcd3773402a 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1378,7 +1378,7 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn,
         infof(data, "File already completely uploaded\n");
 
         /* no data to transfer */
-        result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+        Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
 
         /* Set ->transfer so that we won't get any error in
          * ftp_done() because we didn't transfer anything! */
@@ -1974,7 +1974,7 @@ static CURLcode ftp_state_post_retr_size(struct connectdata *conn,
 
     if(ftp->downloadsize == 0) {
       /* no data to transfer */
-      result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+      Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
       infof(data, "File already completely downloaded\n");
 
       /* Set ->transfer so that we won't get any error in ftp_done()
@@ -2116,8 +2116,8 @@ static CURLcode ftp_state_stor_resp(struct connectdata *conn,
   /* set the SO_SNDBUF for the secondary socket for those who need it */
   Curl_sndbufset(conn->sock[SECONDARYSOCKET]);
 
-  result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */
-                               SECONDARYSOCKET, ftp->bytecountp);
+  Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */
+                      SECONDARYSOCKET, ftp->bytecountp);
   state(conn, FTP_STOP);
 
   conn->proto.ftpc.pp.pending_resp = TRUE; /* expect a server response */
@@ -2230,11 +2230,8 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
       infof(data, "Getting file with size: %" FORMAT_OFF_T "\n", size);
 
     /* FTP download: */
-    result=Curl_setup_transfer(conn, SECONDARYSOCKET, size, FALSE,
-                               ftp->bytecountp,
-                               -1, NULL); /* no upload here */
-    if(result)
-      return result;
+    Curl_setup_transfer(conn, SECONDARYSOCKET, size, FALSE,
+                        ftp->bytecountp, -1, NULL); /* no upload here */
 
     conn->proto.ftpc.pp.pending_resp = TRUE; /* expect server response */
     state(conn, FTP_STOP);
@@ -3391,7 +3388,7 @@ static CURLcode ftp_nextconnect(struct connectdata *conn)
   if((result == CURLE_OK) && (ftp->transfer != FTPTRANSFER_BODY))
     /* no data to transfer. FIX: it feels like a kludge to have this here
        too! */
-    result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+    Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
 
   /* end of transfer */
   DEBUGF(infof(data, "DO-MORE phase ends with %d\n", (int)result));
@@ -3818,7 +3815,7 @@ static CURLcode ftp_dophase_done(struct connectdata *conn,
 
   if(ftp->transfer != FTPTRANSFER_BODY)
     /* no data to transfer */
-    result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+    Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
   else if(!connected)
     /* since we didn't connect now, we want do_more to get called */
     conn->bits.do_more = TRUE;
index 99d34e6618635af12070e06e645ec1dafad8e8a9..cfc09cd5ecbea328cad62284c8e464bdd8cacf98 100644 (file)
@@ -2653,14 +2653,13 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
         return result;
 
       result = Curl_add_buffer_send(req_buffer, conn,
-                               &data->info.request_size, 0, FIRSTSOCKET);
+                                    &data->info.request_size, 0, FIRSTSOCKET);
       if(result)
         failf(data, "Failed sending POST request");
       else
         /* setup variables for the upcoming transfer */
-        result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
-                                     &http->readbytecount,
-                                     -1, NULL);
+        Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount,
+                            -1, NULL);
       break;
     }
 
@@ -2728,10 +2727,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
       failf(data, "Failed sending POST request");
     else
       /* setup variables for the upcoming transfer */
-      result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
-                                   &http->readbytecount,
-                                   FIRSTSOCKET,
-                                   &http->writebytecount);
+      Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
+                          &http->readbytecount, FIRSTSOCKET,
+                          &http->writebytecount);
 
     if(result) {
       Curl_formclean(&http->sendit); /* free that whole lot */
@@ -2781,10 +2779,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
       failf(data, "Failed sending PUT request");
     else
       /* prepare for transfer */
-      result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
-                                   &http->readbytecount,
-                                   postsize?FIRSTSOCKET:-1,
-                                   postsize?&http->writebytecount:NULL);
+      Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
+                          &http->readbytecount, postsize?FIRSTSOCKET:-1,
+                          postsize?&http->writebytecount:NULL);
     if(result)
       return result;
     break;
@@ -2931,11 +2928,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
     if(result)
       failf(data, "Failed sending HTTP POST request");
     else
-      result =
-        Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
-                            &http->readbytecount,
-                            http->postdata?FIRSTSOCKET:-1,
-                            http->postdata?&http->writebytecount:NULL);
+      Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
+                          &http->readbytecount, http->postdata?FIRSTSOCKET:-1,
+                          http->postdata?&http->writebytecount:NULL);
     break;
 
   default:
@@ -2951,10 +2946,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
       failf(data, "Failed sending HTTP request");
     else
       /* HTTP GET/HEAD download: */
-      result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
-                                   &http->readbytecount,
-                                   http->postdata?FIRSTSOCKET:-1,
-                                   http->postdata?&http->writebytecount:NULL);
+      Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount,
+                          http->postdata?FIRSTSOCKET:-1,
+                          http->postdata?&http->writebytecount:NULL);
   }
   if(result)
     return result;
index f7b895dded827aa0454898d7a3ac31722213b5c4..cdadd17135da632fb5a4627a774d9c8c17b8de1a 100644 (file)
@@ -436,12 +436,11 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn,
 
     if(!filesize)
       /* the entire data is already transfered! */
-      result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+      Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
     else
       /* IMAP download */
-      result=Curl_setup_transfer(conn, FIRSTSOCKET, filesize, FALSE,
-                                 imap->bytecountp,
-                                 -1, NULL); /* no upload here */
+      Curl_setup_transfer(conn, FIRSTSOCKET, filesize, FALSE,
+                          imap->bytecountp, -1, NULL); /* no upload here */
 
     data->req.maxdownload = filesize;
   }
@@ -924,15 +923,14 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
 static CURLcode imap_dophase_done(struct connectdata *conn,
                                   bool connected)
 {
-  CURLcode result = CURLE_OK;
   struct FTP *imap = conn->data->state.proto.imap;
   (void)connected;
 
   if(imap->transfer != FTPTRANSFER_BODY)
     /* no data to transfer */
-    result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+    Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
 
-  return result;
+  return CURLE_OK;
 }
 
 /* called from multi.c while DOing */
index 34c6fdfb1300c0856cd07d8d2006e5e23c1e8b42..4d79eebb2c196d6bcdf3a33893387dc5bde7e97e 100644 (file)
@@ -359,9 +359,8 @@ static CURLcode pop3_state_retr_resp(struct connectdata *conn,
   }
 
   /* POP3 download */
-  result=Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE,
-                             pop3->bytecountp,
-                             -1, NULL); /* no upload here */
+  Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE,
+                      pop3->bytecountp, -1, NULL); /* no upload here */
 
   if(pp->cache) {
     /* At this point there is a bunch of data in the header "cache" that is
@@ -403,9 +402,8 @@ static CURLcode pop3_state_list_resp(struct connectdata *conn,
   }
 
   /* POP3 download */
-  result=Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE,
-                             pop3->bytecountp,
-                             -1, NULL); /* no upload here */
+  Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, pop3->bytecountp,
+                      -1, NULL); /* no upload here */
 
   if(pp->cache) {
     /* cache holds the email ID listing */
@@ -863,18 +861,17 @@ static CURLcode pop3_parse_url_path(struct connectdata *conn)
 static CURLcode pop3_dophase_done(struct connectdata *conn,
                                   bool connected)
 {
-  CURLcode result = CURLE_OK;
   struct FTP *pop3 = conn->data->state.proto.pop3;
   struct pop3_conn *pop3c = &conn->proto.pop3c;
- (void)connected;
 (void)connected;
 
   if(pop3->transfer != FTPTRANSFER_BODY)
     /* no data to transfer */
-    result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+    Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
 
   free(pop3c->mailbox);
 
-  return result;
+  return CURLE_OK;
 }
 
 /* called from multi.c while DOing */
index 8cc200bda8f55e19eb97830fd0bc98509d166546..032f58f7e0b0ca1dfd6b7158dd0df7a97c3320e5 100644 (file)
@@ -254,8 +254,8 @@ CURLcode Curl_rtsp(struct connectdata *conn, bool *done)
   }
 
   if(rtspreq == RTSPREQ_RECEIVE) {
-    result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
-                                 &http->readbytecount, -1, NULL);
+    Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
+                        &http->readbytecount, -1, NULL);
 
     return result;
   }
@@ -503,15 +503,9 @@ CURLcode Curl_rtsp(struct connectdata *conn, bool *done)
     return result;
   }
 
-  result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
-                               &http->readbytecount,
-                               putsize?FIRSTSOCKET:-1,
-                               putsize?&http->writebytecount:NULL);
-
-  if(result) {
-    failf(data, "Failed RTSP transfer");
-    return result;
-  }
+  Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount,
+                      putsize?FIRSTSOCKET:-1,
+                      putsize?&http->writebytecount:NULL);
 
   /* Increment the CSeq on success */
   data->state.rtsp_next_client_CSeq++;
index 654f4350591a94ffecd27bae74dfb397d215273b..b4fa58f9542cee9a16f530080513b5400704c8df 100644 (file)
@@ -465,7 +465,6 @@ static CURLcode smtp_state_data_resp(struct connectdata *conn,
                                      int smtpcode,
                                      smtpstate instate)
 {
-  CURLcode result = CURLE_OK;
   struct SessionHandle *data = conn->data;
   struct FTP *smtp = data->state.proto.smtp;
 
@@ -477,11 +476,11 @@ static CURLcode smtp_state_data_resp(struct connectdata *conn,
   }
 
   /* SMTP upload */
-  result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */
-                               FIRSTSOCKET, smtp->bytecountp);
+  Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */
+                      FIRSTSOCKET, smtp->bytecountp);
 
   state(conn, SMTP_STOP);
-  return result;
+  return CURLE_OK;
 }
 
 /* for the POSTDATA response, which is received after the entire DATA
@@ -934,18 +933,17 @@ static CURLcode smtp_disconnect(struct connectdata *conn)
 static CURLcode smtp_dophase_done(struct connectdata *conn,
                                   bool connected)
 {
-  CURLcode result = CURLE_OK;
   struct FTP *smtp = conn->data->state.proto.smtp;
   struct smtp_conn *smtpc= &conn->proto.smtpc;
   (void)connected;
 
   if(smtp->transfer != FTPTRANSFER_BODY)
     /* no data to transfer */
-    result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+    Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
 
   free(smtpc->domain);
 
-  return result;
+  return CURLE_OK;
 }
 
 /* called from multi.c while DOing */
index b3da65562468945b1b89162931ad6a58a126d297..e4e5767c7cfe81c91b3b763fbf92d9fba93cc4cf 100644 (file)
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1556,8 +1556,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
         Curl_pgrsSetUploadSize(data, data->set.infilesize);
       }
       /* upload data */
-      result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL,
-                                   FIRSTSOCKET, NULL);
+      Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL);
 
       /* not set by Curl_setup_transfer to preserve keepon bits */
       conn->sockfd = conn->writesockfd;
@@ -1850,7 +1849,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
       sshc->readdir_longentry = NULL;
 
       /* no data to transfer */
-      result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+      Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
       state(conn, SSH_STOP);
       break;
 
@@ -1975,14 +1974,14 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
     /* Setup the actual download */
     if(data->req.size == 0) {
       /* no data to transfer */
-      result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+      Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
       infof(data, "File already completely downloaded\n");
       state(conn, SSH_STOP);
       break;
     }
     else {
-      result = Curl_setup_transfer(conn, FIRSTSOCKET, data->req.size,
-                                   FALSE, NULL, -1, NULL);
+      Curl_setup_transfer(conn, FIRSTSOCKET, data->req.size,
+                          FALSE, NULL, -1, NULL);
 
       /* not set by Curl_setup_transfer to preserve keepon bits */
       conn->writesockfd = conn->sockfd;
@@ -2107,8 +2106,8 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
       }
 
       /* upload data */
-      result = Curl_setup_transfer(conn, -1, data->req.size, FALSE, NULL,
-                                   FIRSTSOCKET, NULL);
+      Curl_setup_transfer(conn, -1, data->req.size, FALSE, NULL,
+                          FIRSTSOCKET, NULL);
 
       /* not set by Curl_setup_transfer to preserve keepon bits */
       conn->sockfd = conn->writesockfd;
@@ -2159,8 +2158,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
       /* download data */
       bytecount = (curl_off_t)sb.st_size;
       data->req.maxdownload =  (curl_off_t)sb.st_size;
-      result = Curl_setup_transfer(conn, FIRSTSOCKET,
-                                   bytecount, FALSE, NULL, -1, NULL);
+      Curl_setup_transfer(conn, FIRSTSOCKET, bytecount, FALSE, NULL, -1, NULL);
 
       /* not set by Curl_setup_transfer to preserve keepon bits */
       conn->writesockfd = conn->sockfd;
index 564de49163a71012a9f35dfdc3b9c60fb0cf8153..3c288b66e0ec3ea4ccf1adb4e94419a5d322115f 100644 (file)
@@ -797,10 +797,9 @@ static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
     state->state = TFTP_STATE_FIN;
     setpacketevent(&state->spacket, TFTP_EVENT_ERROR);
     setpacketblock(&state->spacket, state->block);
-    sbytes = sendto(state->sockfd, (void *)state->spacket.data,
-                    4, SEND_4TH_ARG,
-                    (struct sockaddr *)&state->remote_addr,
-                    state->remote_addrlen);
+    (void)sendto(state->sockfd, (void *)state->spacket.data, 4, SEND_4TH_ARG,
+                 (struct sockaddr *)&state->remote_addr,
+                 state->remote_addrlen);
     /* don't bother with the return code, but if the socket is still up we
      * should be a good TFTP client and let the server know we're done */
     state->state = TFTP_STATE_FIN;
@@ -1295,7 +1294,7 @@ static CURLcode tftp_easy_statemach(struct connectdata *conn)
   }
 
   /* Tell curl we're done */
-  result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+  Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
 
   return(result);
 }
@@ -1329,7 +1328,7 @@ static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done)
     *done = (bool)(state->state == TFTP_STATE_FIN);
     if(*done)
       /* Tell curl we're done */
-      result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+      Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
   }
   else {
     /* no timeouts to handle, check our socket */
@@ -1351,7 +1350,7 @@ static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done)
       *done = (bool)(state->state == TFTP_STATE_FIN);
       if(*done)
         /* Tell curl we're done */
-        result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
+        Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
     }
     /* if rc == 0, then select() timed out */
   }
index 8985892df8f6407544526a778ddb2ab6a99e3f29..92a59d038d381908caa739af4690105cf8b2ad10 100644 (file)
@@ -2169,7 +2169,7 @@ CURLcode Curl_perform(struct SessionHandle *data)
  * Curl_setup_transfer() is called to setup some basic properties for the
  * upcoming transfer.
  */
-CURLcode
+void
 Curl_setup_transfer(
   struct connectdata *conn, /* connection data */
   int sockindex,            /* socket index to read from or -1 */
@@ -2214,9 +2214,8 @@ Curl_setup_transfer(
   /* we want header and/or body, if neither then don't do this! */
   if(k->getheader || !data->set.opt_no_body) {
 
-    if(conn->sockfd != CURL_SOCKET_BAD) {
+    if(conn->sockfd != CURL_SOCKET_BAD)
       k->keepon |= KEEP_RECV;
-    }
 
     if(conn->writesockfd != CURL_SOCKET_BAD) {
       /* HTTP 1.1 magic:
@@ -2246,5 +2245,4 @@ Curl_setup_transfer(
     } /* if(conn->writesockfd != CURL_SOCKET_BAD) */
   } /* if(k->getheader || !data->set.opt_no_body) */
 
-  return CURLE_OK;
 }
index 4c2bc9e0236dcb072782274046f36c492ff827a9..790e1e3ef880829b031e741599df2fc4f2623395 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -49,7 +49,7 @@ CURLcode Curl_reconnect_request(struct connectdata **connp);
 CURLcode Curl_retry_request(struct connectdata *conn, char **url);
 
 /* This sets up a forthcoming transfer */
-CURLcode
+void
 Curl_setup_transfer (struct connectdata *data,
                int sockindex,           /* socket index to read from or -1 */
                curl_off_t size,         /* -1 if unknown at this point */
index 6dc267204aba8d506f83b1e47db7d3dcc1446b06..a84e69d3584873ba675dce7ae937d09a8cdc0aaf 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -4779,9 +4779,8 @@ static CURLcode create_conn(struct SessionHandle *data,
         return result;
       }
 
-      result = Curl_setup_transfer(conn, -1, -1, FALSE,
-                                   NULL, /* no download */
-                                   -1, NULL); /* no upload */
+      Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */
+                          -1, NULL); /* no upload */
     }
 
     return result;