mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-17 06:23:00 +02:00
asterisk addon: update to 11.10.2
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
Upstream issue 18345
|
||||
Link: https://issues.asterisk.org/jira/browse/ASTERISK-18345
|
||||
Patch-By: Filip Jenicek
|
||||
|
||||
Submitted upstream: 2012-05-31 09:12
|
||||
For Asterisk version: 1.8.4
|
||||
|
||||
The HOOK_T ssl_read function should behave the same way as the system read function
|
||||
by blocking and waiting for (more) data from the SSL subsystem. Failure to do this
|
||||
will drop data on the floor and ultimately disconnect SSL clients.
|
||||
|
||||
--- asterisk/main/tcptls.c
|
||||
+++ asterisk/main/tcptls.c
|
||||
@@ -55,6 +55,14 @@
|
||||
static HOOK_T ssl_read(void *cookie, char *buf, LEN_T len)
|
||||
{
|
||||
int i = SSL_read(cookie, buf, len-1);
|
||||
+
|
||||
+ /* ssl_read should block and wait for the SSL layer to provide all data */
|
||||
+ while (i < 0 && SSL_get_error(cookie, i) == SSL_ERROR_WANT_READ) {
|
||||
+ ast_debug(1, "SSL_read - data not ready.\n");
|
||||
+ if (ast_wait_for_input(SSL_get_fd(cookie), 5000) <= 0) return 0;
|
||||
+ i = SSL_read(cookie, buf, len-1);
|
||||
+ }
|
||||
+
|
||||
#if 0
|
||||
if (i >= 0)
|
||||
buf[i] = '\0';
|
||||
Reference in New Issue
Block a user