/* The variable 'done' points to will be TRUE if the protocol-layer connect phase is done when this function returns, or FALSE if not.  */
static CURLcode ftp_connect(struct connectdata *conn, bool *done)
/* The variable 'done' points to will be TRUE if the protocol-layer connect phase is done when this function returns, or FALSE if not.  */
static CURLcode ftp_connect(struct connectdata *conn, bool *done)
{
  CURLcode result;
  struct ftp_conn *ftpc = &conn->proto.ftpc;
  struct pingpong *pp = &ftpc->pp;
  *done = FALSE;
  connkeep(conn, "FTP default");
  pp->response_time = RESP_TIMEOUT;
  pp->statemach_act = ftp_statemach_act;
  pp->endofresp = ftp_endofresp;
  pp->conn = conn;
  if(conn->handler->flags & PROTOPT_SSL) {
    result = Curl_ssl_connect(conn, FIRSTSOCKET);
    if(result)
      return result;
  }
  Curl_pp_init(pp);
  state(conn, FTP_WAIT220);
  result = ftp_multi_statemach(conn, done);
  return result;
}