Commit bc8fc980 authored by Howard Chu's avatar Howard Chu Committed by Daniel Stenberg
Browse files

sendrecv: make them two pairs of send/recv to properly deal with FTPS

FTP(S) use two connections that can be set to different recv and
send functions independently, so by introducing recv+send pairs
in the same manner we already have sockets/connections we can
work with FTPS fine.

This commit fixes the FTPS regression introduced in change d64bd82b.
parent 016ce4b1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -633,8 +633,8 @@ gtls_connect_step3(struct connectdata *conn,
  infof(data, "\t MAC: %s\n", ptr);

  conn->ssl[sockindex].state = ssl_connection_complete;
  conn->recv = gtls_recv;
  conn->send = gtls_send;
  conn->recv[sockindex] = gtls_recv;
  conn->send[sockindex] = gtls_send;

  {
    /* we always unconditionally get the session id here, as even if we
+2 −2
Original line number Diff line number Diff line
@@ -1339,8 +1339,8 @@ CURLcode Curl_nss_connect(struct connectdata *conn, int sockindex)
  }

  connssl->state = ssl_connection_complete;
  conn->recv = nss_recv;
  conn->send = nss_send;
  conn->recv[sockindex] = nss_recv;
  conn->send[sockindex] = nss_send;

  display_conn_info(conn, connssl->handle);

+2 −2
Original line number Diff line number Diff line
@@ -302,8 +302,8 @@ Curl_polarssl_connect(struct connectdata *conn,
  }

  conn->ssl[sockindex].state = ssl_connection_complete;
  conn->recv = polarssl_recv;
  conn->send = polarssl_send;
  conn->recv[sockindex] = polarssl_recv;
  conn->send[sockindex] = polarssl_send;

  /* Save the current session data for possible re-use */
  {
+2 −2
Original line number Diff line number Diff line
@@ -268,8 +268,8 @@ CURLcode Curl_qsossl_connect(struct connectdata * conn, int sockindex)
  }
  if (rc == CURLE_OK) {
    connssl->state = ssl_connection_complete;
    conn->recv = qsossl_recv;
    conn->send = qsossl_send;
    conn->recv[sockindex] = qsossl_recv;
    conn->send[sockindex] = qsossl_send;
  }

  return rc;
+4 −2
Original line number Diff line number Diff line
@@ -466,8 +466,10 @@ Curl_sec_login(struct connectdata *conn)
    conn->mech = *m;
    conn->sec_complete = 1;
    if (conn->data_prot != prot_clear) {
      conn->recv = sec_read;
      conn->send = _sec_send;
      conn->recv[FIRSTSOCKET] = sec_read;
      conn->send[FIRSTSOCKET] = _sec_send;
      conn->recv[SECONDARYSOCKET] = sec_read;
      conn->send[SECONDARYSOCKET] = _sec_send;
    }
    conn->command_prot = prot_safe;
    /* Set the requested protection level */
Loading