Commit 11f3c51e authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Get get-ftp-response function is now using Curl_read() for reading from a

socket. Curl_ConnectHTTPProxyTunnel changed prototype.
parent 1a329b98
Loading
Loading
Loading
Loading
+11 −16
Original line number Original line Diff line number Diff line
@@ -221,7 +221,7 @@ int Curl_GetFTPResponse(int sockfd, char *buf,
                        int *ftpcode)
                        int *ftpcode)
{
{
  int nread;
  int nread;
  int keepon=TRUE;
  size_t keepon=TRUE;
  char *ptr;
  char *ptr;
  int timeout = 3600; /* in seconds */
  int timeout = 3600; /* in seconds */
  struct timeval interval;
  struct timeval interval;
@@ -272,22 +272,17 @@ int Curl_GetFTPResponse(int sockfd, char *buf,
        break;
        break;
      case 0: /* timeout */
      case 0: /* timeout */
        error = SELECT_TIMEOUT;
        error = SELECT_TIMEOUT;
        infof(data, "Transfer aborted due to timeout\n");
        failf(data, "Transfer aborted due to timeout");
        failf(data, "Transfer aborted due to timeout");
        break;
        break;
      default:
      default:
#ifdef USE_SSLEAY
        /*
        if (data->ssl.use) {
         * This code previously didn't use the kerberos sec_read() code
          keepon = SSL_read(data->ssl.handle, ptr, 1);
         * to read, but when we use Curl_read() it may do so. Do confirm
        }
         * that this is still ok and then remove this comment!
        else {
         */
#endif
        if(CURLE_OK != Curl_read(conn, sockfd, ptr, 1, &keepon))
          keepon = sread(sockfd, ptr, 1);
          keepon = FALSE;
#ifdef USE_SSLEAY
        else if ((*ptr == '\n') || (*ptr == '\r'))
        }
#endif /* USE_SSLEAY */

        if ((*ptr == '\n') || (*ptr == '\r'))
          keepon = FALSE;
          keepon = FALSE;
      }
      }
      if(keepon) {
      if(keepon) {
@@ -372,7 +367,7 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)


  if (data->bits.tunnel_thru_httpproxy) {
  if (data->bits.tunnel_thru_httpproxy) {
    /* We want "seamless" FTP operations through HTTP proxy tunnel */
    /* We want "seamless" FTP operations through HTTP proxy tunnel */
    result = Curl_ConnectHTTPProxyTunnel(data, data->firstsocket,
    result = Curl_ConnectHTTPProxyTunnel(conn, data->firstsocket,
                                         data->hostname, data->remote_port);
                                         data->hostname, data->remote_port);
    if(CURLE_OK != result)
    if(CURLE_OK != result)
      return result;
      return result;
@@ -979,7 +974,7 @@ CURLcode _ftp(struct connectdata *conn)


      if (data->bits.tunnel_thru_httpproxy) {
      if (data->bits.tunnel_thru_httpproxy) {
        /* We want "seamless" FTP operations through HTTP proxy tunnel */
        /* We want "seamless" FTP operations through HTTP proxy tunnel */
        result = Curl_ConnectHTTPProxyTunnel(data, data->secondarysocket,
        result = Curl_ConnectHTTPProxyTunnel(conn, data->secondarysocket,
                                             newhost, newport);
                                             newhost, newport);
        if(CURLE_OK != result)
        if(CURLE_OK != result)
          return result;
          return result;