From 1d363ed0b46971d6abe36ce46fec57fb5bff64b8 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Mon, 3 Aug 2009 14:21:53 +0200 Subject: [PATCH] Expose the SSL_connect() and SSL_accept() functions. --- src/network/connection.c | 12 ++++-------- src/network/connection.h | 12 ++++++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/network/connection.c b/src/network/connection.c index 858e2e8..1205809 100644 --- a/src/network/connection.c +++ b/src/network/connection.c @@ -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 */ + diff --git a/src/network/connection.h b/src/network/connection.h index 8927e23..4365dad 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -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 */