Loading lib/http.c +5 −3 Original line number Diff line number Diff line Loading @@ -1028,9 +1028,11 @@ CURLcode Curl_http_done(struct connectdata *conn) else if(HTTPREQ_PUT == data->set.httpreq) conn->bytecount = http->readbytecount + http->writebytecount; if(0 == (http->readbytecount + conn->headerbytecount)) { /* nothing was read from the HTTP server, this can't be right so we return an error here */ if(!conn->bits.retry && !(http->readbytecount + conn->headerbytecount)) { /* If this connection isn't simply closed to be retried, AND nothing was read from the HTTP server, this can't be right so we return an error here */ failf(data, "Empty reply from server"); return CURLE_GOT_NOTHING; } Loading lib/if2ip.c +2 −0 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ #ifdef HAVE_NET_IF_H #include <net/if.h> #endif #ifdef HAVE_SYS_IOCTL_H #include <sys/ioctl.h> #endif /* -- if2ip() -- */ #ifdef HAVE_NETDB_H Loading lib/transfer.c +11 −0 Original line number Diff line number Diff line Loading @@ -29,7 +29,9 @@ #include <stdarg.h> #include <stdlib.h> #include <ctype.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #include <sys/stat.h> #include <errno.h> Loading @@ -44,7 +46,9 @@ #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> #endif #include <sys/time.h> #ifdef HAVE_UNISTD_H #include <unistd.h> Loading @@ -56,7 +60,9 @@ #ifdef HAVE_NET_IF_H #include <net/if.h> #endif #ifdef HAVE_SYS_IOCTL_H #include <sys/ioctl.h> #endif #include <signal.h> #ifdef HAVE_SYS_PARAM_H Loading Loading @@ -1910,6 +1916,11 @@ CURLcode Curl_perform(struct SessionHandle *data) newurl = strdup(conn->data->change.url); conn->bits.close = TRUE; /* close this connection */ conn->bits.retry = TRUE; /* mark this as a connection we're about to retry. Marking it this way should prevent i.e HTTP transfers to return error just because nothing has been transfered! */ } else /* Loading lib/urldata.h +2 −0 Original line number Diff line number Diff line Loading @@ -296,6 +296,8 @@ struct ConnectBits { bool tcpconnect; /* the tcp stream (or simimlar) is connected, this is set the first time on the first connect function call */ bool retry; /* this connection is about to get closed and then re-attempted at another connection. */ }; /* Loading Loading
lib/http.c +5 −3 Original line number Diff line number Diff line Loading @@ -1028,9 +1028,11 @@ CURLcode Curl_http_done(struct connectdata *conn) else if(HTTPREQ_PUT == data->set.httpreq) conn->bytecount = http->readbytecount + http->writebytecount; if(0 == (http->readbytecount + conn->headerbytecount)) { /* nothing was read from the HTTP server, this can't be right so we return an error here */ if(!conn->bits.retry && !(http->readbytecount + conn->headerbytecount)) { /* If this connection isn't simply closed to be retried, AND nothing was read from the HTTP server, this can't be right so we return an error here */ failf(data, "Empty reply from server"); return CURLE_GOT_NOTHING; } Loading
lib/if2ip.c +2 −0 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ #ifdef HAVE_NET_IF_H #include <net/if.h> #endif #ifdef HAVE_SYS_IOCTL_H #include <sys/ioctl.h> #endif /* -- if2ip() -- */ #ifdef HAVE_NETDB_H Loading
lib/transfer.c +11 −0 Original line number Diff line number Diff line Loading @@ -29,7 +29,9 @@ #include <stdarg.h> #include <stdlib.h> #include <ctype.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif #include <sys/stat.h> #include <errno.h> Loading @@ -44,7 +46,9 @@ #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> #endif #include <sys/time.h> #ifdef HAVE_UNISTD_H #include <unistd.h> Loading @@ -56,7 +60,9 @@ #ifdef HAVE_NET_IF_H #include <net/if.h> #endif #ifdef HAVE_SYS_IOCTL_H #include <sys/ioctl.h> #endif #include <signal.h> #ifdef HAVE_SYS_PARAM_H Loading Loading @@ -1910,6 +1916,11 @@ CURLcode Curl_perform(struct SessionHandle *data) newurl = strdup(conn->data->change.url); conn->bits.close = TRUE; /* close this connection */ conn->bits.retry = TRUE; /* mark this as a connection we're about to retry. Marking it this way should prevent i.e HTTP transfers to return error just because nothing has been transfered! */ } else /* Loading
lib/urldata.h +2 −0 Original line number Diff line number Diff line Loading @@ -296,6 +296,8 @@ struct ConnectBits { bool tcpconnect; /* the tcp stream (or simimlar) is connected, this is set the first time on the first connect function call */ bool retry; /* this connection is about to get closed and then re-attempted at another connection. */ }; /* Loading