Fix the TLS/SSL transport

This commit is contained in:
Přemysl Eric Janouch 2014-09-21 03:18:00 +02:00
parent aeb1012997
commit fa2780a40d
1 changed files with 3 additions and 2 deletions

View File

@ -1003,6 +1003,7 @@ transport_tls_init (struct unit *u)
struct transport_tls_data *data = xcalloc (1, sizeof *data); struct transport_tls_data *data = xcalloc (1, sizeof *data);
data->ssl = ssl; data->ssl = ssl;
// XXX: maybe set `ssl_rx_want_tx' to force a handshake?
u->transport_data = data; u->transport_data = data;
return true; return true;
} }
@ -1063,10 +1064,10 @@ transport_tls_on_readable (struct unit *u)
case SSL_ERROR_ZERO_RETURN: case SSL_ERROR_ZERO_RETURN:
return TRANSPORT_IO_EOF; return TRANSPORT_IO_EOF;
case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_READ:
return true; return TRANSPORT_IO_OK;
case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_WRITE:
data->ssl_rx_want_tx = true; data->ssl_rx_want_tx = true;
return true; return TRANSPORT_IO_OK;
case XSSL_ERROR_TRY_AGAIN: case XSSL_ERROR_TRY_AGAIN:
continue; continue;
default: default: