mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-20 14:29:05 +03:00
Merge pull request #132 from mrdeep1/coap_session_send-assert
coap_openssl.c: client assert error if DTLS error closed socket
This commit is contained in:
1 file changed
+5
@@ -140,6 +140,11 @@ static int coap_dgram_write(BIO *a, const char *in, int inl) {
|
||||
coap_ssl_data *data = (coap_ssl_data *)BIO_get_data(a);
|
||||
|
||||
if (data->session) {
|
||||
if (data->session->sock.flags == COAP_SOCKET_EMPTY && data->session->endpoint == NULL) {
|
||||
/* socket was closed on client due to error */
|
||||
BIO_clear_retry_flags(a);
|
||||
return -1;
|
||||
}
|
||||
ret = (int)coap_session_send(data->session, (unsigned char*)in, (size_t)inl);
|
||||
BIO_clear_retry_flags(a);
|
||||
if (ret <= 0)
|
||||
|
||||
Reference in new issue
Block a user