Commit 981df70a authored by Simon Morlat's avatar Simon Morlat

Fix: don't send tls keepalive after an EWOULDBLOCK event. This makes a crash...

Fix: don't send tls keepalive after an EWOULDBLOCK event. This makes a crash in an assert because the write is never retried.
Furthermore, it makes no sense to send a keepalive if there is data already pending.
parent f2b5ed37
......@@ -11,7 +11,7 @@ dnl information on the package
dnl ---------------------------
dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
AC_INIT([sofia-sip], [1.13.32bc])
AC_INIT([sofia-sip], [1.13.33bc])
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.13])
......
......@@ -839,6 +839,12 @@ static int tport_tls_ping(tport_t *self, su_time_t now)
if (tport_has_queued(self))
return 0;
if ((tls_events(tlstp->tlstp_context, 0) & SU_WAIT_OUT) != 0){
/* We had an EWOULDBLOCK on write which is pending poll() to notify when it's ready to write again.
* In this situation there is no need and this is dangerous to write a keepalive. */
return 0;
}
n = tls_write(tlstp->tlstp_context, "\r\n\r\n", 4);
if (n == -1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment