FS-10150: [freeswitch-core] Reduce writes to closed ssl sockets

This commit is contained in:
Anthony Minessale 2017-04-06 17:06:35 -05:00
parent 9e73d51a27
commit 014f40d0b8
3 changed files with 12 additions and 6 deletions

View File

@ -448,10 +448,12 @@ KS_DECLARE(ks_ssize_t) kws_raw_write(kws_t *kws, void *data, ks_size_t bytes)
}
if (r == -1) {
ssl_err = SSL_get_error(kws->ssl, r);
if ((ssl_err = SSL_get_error(kws->ssl, r)) != SSL_ERROR_WANT_WRITE) {
break;
}
}
} while (--sanity > 0 && ((r == -1 && ssl_err == SSL_ERROR_WANT_WRITE) || (kws->block && wrote < bytes)));
} while (--sanity > 0 && kws->block && wrote < bytes);
if (ssl_err) {
r = ssl_err * -1;

View File

@ -442,10 +442,12 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes)
}
if (r == -1) {
ssl_err = SSL_get_error(wsh->ssl, r);
if ((ssl_err = SSL_get_error(wsh->ssl, r)) != SSL_ERROR_WANT_WRITE) {
break;
}
}
} while (--sanity > 0 && ((r == -1 && ssl_err == SSL_ERROR_WANT_WRITE) || (wsh->block && wrote < bytes)));
} while (--sanity > 0 && wsh->block && wrote < bytes);
if (ssl_err) {
r = ssl_err * -1;

View File

@ -442,10 +442,12 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes)
}
if (r == -1) {
ssl_err = SSL_get_error(wsh->ssl, r);
if ((ssl_err = SSL_get_error(wsh->ssl, r)) != SSL_ERROR_WANT_WRITE) {
break;
}
}
} while (--sanity > 0 && ((r == -1 && ssl_err == SSL_ERROR_WANT_WRITE) || (wsh->block && wrote < bytes)));
} while (--sanity > 0 && wsh->block && wrote < bytes);
if (ssl_err) {
r = ssl_err * -1;