common: ssl_tls_write / read return 0 on socket close
This commit is contained in:
parent
1f27a4d850
commit
75fd3fcf89
@ -743,6 +743,10 @@ ssl_tls_read(struct ssl_tls *tls, char *data, int length)
|
|||||||
g_sck_can_send(tls->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT);
|
g_sck_can_send(tls->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* socket closed */
|
||||||
|
case SSL_ERROR_ZERO_RETURN:
|
||||||
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ssl_tls_print_error("SSL_read", tls->ssl, status);
|
ssl_tls_print_error("SSL_read", tls->ssl, status);
|
||||||
status = -1;
|
status = -1;
|
||||||
@ -792,6 +796,10 @@ ssl_tls_write(struct ssl_tls *tls, const char *data, int length)
|
|||||||
g_sck_can_send(tls->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT);
|
g_sck_can_send(tls->trans->sck, SSL_WANT_READ_WRITE_TIMEOUT);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* socket closed */
|
||||||
|
case SSL_ERROR_ZERO_RETURN:
|
||||||
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ssl_tls_print_error("SSL_write", tls->ssl, status);
|
ssl_tls_print_error("SSL_write", tls->ssl, status);
|
||||||
status = -1;
|
status = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user