mirror of
https://github.com/curl/curl.git
synced 2024-11-21 01:16:58 +08:00
moved the SSL pending function to the proper place and name
This commit is contained in:
parent
45bac25d90
commit
3239f059b8
13
lib/sslgen.c
13
lib/sslgen.c
@ -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 */
|
||||
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user