Commit 3239f059 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

moved the SSL pending function to the proper place and name

parent 45bac25d
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -600,3 +600,16 @@ int Curl_ssl_check_cxn(struct connectdata *conn)
  return -1; /* connection status unknown */
#endif /* USE_SSLEAY */
}

bool Curl_ssl_data_pending(struct connectdata *conn,
                           int connindex)
{
#ifdef USE_SSLEAY
  /* OpenSSL-specific */
  if(conn->ssl[connindex].handle)
    /* SSL is in use */
    return SSL_pending(conn->ssl[connindex].handle);
#endif
  return FALSE; /* nothing pending */

}
+4 −0
Original line number Diff line number Diff line
@@ -71,9 +71,13 @@ int Curl_ssl_check_cxn(struct connectdata *conn);

CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex);

bool Curl_ssl_data_pending(struct connectdata *conn,
                           int connindex);

#if !defined(USE_SSL) && !defined(SSLGEN_C)
/* set up blank macros for none-SSL builds */
#define Curl_ssl_close_all(x)
#define Curl_ssl_data_pending(x) 0
#endif

#define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */
+1 −11
Original line number Diff line number Diff line
@@ -273,20 +273,10 @@ CURLcode Curl_readrewind(struct connectdata *conn)
  return CURLE_OK;
}

#ifdef USE_SSLEAY
/* FIX: this is nasty OpenSSL-specific code that really shouldn't be here */
static int data_pending(struct connectdata *conn)
{
  if(conn->ssl[FIRSTSOCKET].handle)
    /* SSL is in use */
    return SSL_pending(conn->ssl[FIRSTSOCKET].handle);

  return 0; /* nothing */
  return Curl_ssl_data_pending(conn, FIRSTSOCKET);
}
#else
/* non-SSL never have pending data */
#define data_pending(x) 0
#endif

#ifndef MIN
#define MIN(a,b) (a < b ? a : b)