Expose the SSL_connect() and SSL_accept() functions.
This commit is contained in:
parent
79cf5ee9db
commit
1d363ed0b4
|
@ -21,11 +21,6 @@
|
|||
|
||||
extern struct hub_info* g_hub;
|
||||
|
||||
#ifdef SSL_SUPPORT
|
||||
static ssize_t net_con_ssl_accept(struct net_connection* con);
|
||||
static ssize_t net_con_ssl_connect(struct net_connection* con);
|
||||
#endif
|
||||
|
||||
static inline int net_con_flag_get(struct net_connection* con, unsigned int flag)
|
||||
{
|
||||
return con->flags & flag;
|
||||
|
@ -253,7 +248,7 @@ ssize_t net_con_recv(struct net_connection* con, void* buf, size_t len)
|
|||
}
|
||||
|
||||
#ifdef SSL_SUPPORT
|
||||
static ssize_t net_con_ssl_accept(struct net_connection* con)
|
||||
ssize_t net_con_ssl_accept(struct net_connection* con)
|
||||
{
|
||||
ssize_t ret = SSL_accept(con->ssl);
|
||||
if (ret > 0)
|
||||
|
@ -267,7 +262,7 @@ static ssize_t net_con_ssl_accept(struct net_connection* con)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t net_con_ssl_connect(struct net_connection* con)
|
||||
ssize_t net_con_ssl_connect(struct net_connection* con)
|
||||
{
|
||||
ssize_t ret = SSL_connect(con->ssl);
|
||||
if (ret > 0)
|
||||
|
@ -280,5 +275,6 @@ static ssize_t net_con_ssl_connect(struct net_connection* con)
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
#endif /* SSL_SUPPORT */
|
||||
|
||||
|
||||
|
|
|
@ -58,5 +58,17 @@ extern ssize_t net_con_send(struct net_connection* con, const void* buf, size_t
|
|||
*/
|
||||
extern ssize_t net_con_recv(struct net_connection* con, void* buf, size_t len);
|
||||
|
||||
#ifdef SSL_SUPPORT
|
||||
/**
|
||||
* Start SSL_accept()
|
||||
*/
|
||||
extern ssize_t net_con_ssl_accept(struct net_connection*);
|
||||
|
||||
/**
|
||||
* Start SSL_connect()
|
||||
*/
|
||||
extern ssize_t net_con_ssl_connect(struct net_connection*);
|
||||
#endif /* SSL_SUPPORT */
|
||||
|
||||
#endif /* HAVE_UHUB_NETWORK_CONNECTION_H */
|
||||
|
||||
|
|
Loading…
Reference in New Issue