mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-30 18:17:09 +03:00
coap_gnutls.c: coap_tls_read() support retrying the read
Support the case of GNUTLS_E_AGAIN for retrying the read at a later point
This commit is contained in:
1 parent
19822b5765
commit
0e0c7ba1d4
1 file changed
+5
-1
+5
-1
@@ -1652,9 +1652,13 @@ ssize_t coap_tls_read(coap_session_t *c_session,
|
||||
ret = gnutls_record_recv(g_env->g_session, data, (int)data_len);
|
||||
if (ret <= 0) {
|
||||
switch (ret) {
|
||||
case GNUTLS_E_SUCCESS:
|
||||
case 0:
|
||||
c_session->dtls_event = COAP_EVENT_DTLS_CLOSED;
|
||||
break;
|
||||
case GNUTLS_E_AGAIN:
|
||||
errno = EAGAIN;
|
||||
ret = 0;
|
||||
break;
|
||||
default:
|
||||
coap_log(LOG_WARNING,
|
||||
"coap_tls_read: gnutls_record_recv "
|
||||
|
||||
Reference in new issue
Block a user