Skip to content

Commit

Permalink
Abort DTLS handshake if DTLSv1_handle_timeout returns an error
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Apr 29, 2022
1 parent 1e94efc commit b63e422
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/dtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,14 @@ gboolean janus_dtls_retry(gpointer stack) {
/* Notify event handlers */
janus_dtls_notify_state_change(dtls);
/* Retransmit the packet */
DTLSv1_handle_timeout(dtls->ssl);
int res = DTLSv1_handle_timeout(dtls->ssl);
if(res == -1 && SSL_get_error(dtls->ssl, res) != SSL_ERROR_WANT_WRITE) {
/* DTLSv1_handle_timeout returned an unrecoverable error, fail right away
* Ref.: https://webrtc-review.googlesource.com/c/src/+/260100 */
JANUS_LOG(LOG_ERR, "[%"SCNu64"] DTLSv1_handle_timeout failed...\n", handle->handle_id);
janus_ice_webrtc_hangup(handle, "DTLS error");
goto stoptimer;
}
}
return TRUE;

Expand Down

0 comments on commit b63e422

Please sign in to comment.