Skip to content

Commit

Permalink
error code cleanup, use the new SEND/RECV errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Apr 10, 2002
1 parent 536ea60 commit e8109b0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,15 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
} /* while there's buffer left and loop is requested */

if(error)
return CURLE_READ_ERROR;
return CURLE_RECV_ERROR;

if(200 != httperror) {
if(407 == httperror)
/* Added Nov 6 1998 */
failf(data, "Proxy requires authorization!");
else
failf(data, "Received error code %d from proxy", httperror);
return CURLE_READ_ERROR;
return CURLE_RECV_ERROR;
}

infof (data, "Proxy replied to CONNECT request\n");
Expand Down
6 changes: 3 additions & 3 deletions lib/sendf.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ CURLcode Curl_write(struct connectdata *conn, int sockfd,
}
/* a true error */
failf(conn->data, "SSL_write() return error %d\n", err);
return CURLE_WRITE_ERROR;
return CURLE_SEND_ERROR;
}
bytes_written = rc;
}
Expand Down Expand Up @@ -266,7 +266,7 @@ CURLcode Curl_write(struct connectdata *conn, int sockfd,
#endif

*written = bytes_written;
return (-1 != bytes_written)?CURLE_OK:CURLE_WRITE_ERROR;
return (-1 != bytes_written)?CURLE_OK:CURLE_SEND_ERROR;
}

/* client_write() sends data to the write callback(s)
Expand Down Expand Up @@ -349,7 +349,7 @@ int Curl_read(struct connectdata *conn,
break;
default:
failf(conn->data, "SSL read error: %d", err);
return CURLE_READ_ERROR;
return CURLE_RECV_ERROR;
}
} while(loop);
if(loop && SSL_pending(conn->ssl.handle))
Expand Down
6 changes: 3 additions & 3 deletions lib/transfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
newbuff = (char *)realloc(data->state.headerbuff, newsize);
if(!newbuff) {
failf (data, "Failed to alloc memory for big header!");
return CURLE_READ_ERROR;
return CURLE_OUT_OF_MEMORY;
}
data->state.headersize=newsize;
data->state.headerbuff = newbuff;
Expand Down Expand Up @@ -274,7 +274,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
newbuff = (char *)realloc(data->state.headerbuff, newsize);
if(!newbuff) {
failf (data, "Failed to alloc memory for big header!");
return CURLE_READ_ERROR;
return CURLE_OUT_OF_MEMORY;
}
data->state.headersize= newsize;
data->state.headerbuff = newbuff;
Expand Down Expand Up @@ -696,7 +696,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
return CURLE_WRITE_ERROR;
}
failf(data, "Received problem in the chunky parser");
return CURLE_READ_ERROR;
return CURLE_RECV_ERROR;
}
else if(CHUNKE_STOP == res) {
/* we're done reading chunks! */
Expand Down
4 changes: 2 additions & 2 deletions lib/url.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
break;
default:
/* unknown tag and its companion, just ignore: */
return CURLE_READ_ERROR; /* correct this */
return CURLE_FAILED_INIT; /* correct this */
}
return CURLE_OK;
}
Expand Down Expand Up @@ -2363,7 +2363,7 @@ CURLcode Curl_do(struct connectdata **connp)

/* This was formerly done in transfer.c, but we better do it here */

if((CURLE_WRITE_ERROR == result) && conn->bits.reuse) {
if((CURLE_SEND_ERROR == result) && conn->bits.reuse) {
/* This was a re-use of a connection and we got a write error in the
* DO-phase. Then we DISCONNECT this connection and have another attempt
* to CONNECT and then DO again! The retry cannot possibly find another
Expand Down

0 comments on commit e8109b0

Please sign in to comment.