Fixed accept/connect state event propagation.
Also removed some unused states and flags.
This commit is contained in:
parent
b1f2c93738
commit
c43acd97bd
@ -20,11 +20,6 @@
|
||||
#define NET_WANT_READ NET_EVENT_READ
|
||||
#define NET_WANT_WRITE NET_EVENT_WRITE
|
||||
#define NET_WANT_ACCEPT NET_EVENT_READ
|
||||
#define NET_WANT_SSL_READ 0x0010
|
||||
#define NET_WANT_SSL_WRITE 0x0020
|
||||
#define NET_WANT_SSL_ACCEPT 0x0040
|
||||
#define NET_WANT_SSL_CONNECT 0x0080
|
||||
#define NET_WANT_SSL_X509_LOOKUP 0x0100
|
||||
|
||||
#define NET_SSL_ANY NET_WANT_SSL_READ | NET_WANT_SSL_WRITE | NET_WANT_SSL_ACCEPT | NET_WANT_SSL_CONNECT | NET_WANT_SSL_X509_LOOKUP
|
||||
|
||||
|
@ -320,9 +320,6 @@ void net_ssl_destroy(struct net_connection* con)
|
||||
void net_ssl_callback(struct net_connection* con, int events)
|
||||
{
|
||||
struct net_ssl_openssl* handle = get_handle(con);
|
||||
int ret;
|
||||
uint32_t flags = con->flags;
|
||||
con->flags &= ~NET_SSL_ANY; /* reset the SSL related flags */
|
||||
|
||||
switch (handle->state)
|
||||
{
|
||||
@ -335,15 +332,12 @@ void net_ssl_callback(struct net_connection* con, int events)
|
||||
break;
|
||||
|
||||
case tls_st_accepting:
|
||||
if (net_con_ssl_accept(con) < 0)
|
||||
{
|
||||
if (net_con_ssl_accept(con) != 0)
|
||||
con->callback(con, NET_EVENT_READ, con->ptr);
|
||||
}
|
||||
break;
|
||||
|
||||
case tls_st_connecting:
|
||||
ret = net_con_ssl_connect(con);
|
||||
if (ret != 0)
|
||||
if (net_con_ssl_connect(con) != 0)
|
||||
con->callback(con, NET_EVENT_READ, con->ptr);
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user