Commit e8109b09 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

error code cleanup, use the new SEND/RECV errors

parent 536ea60d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -392,7 +392,7 @@ 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)
@@ -400,7 +400,7 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
      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");
+3 −3
Original line number Diff line number Diff line
@@ -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;
  }
@@ -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)
@@ -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))
+3 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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;
@@ -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! */
+2 −2
Original line number Diff line number Diff line
@@ -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;
}
@@ -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