mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
Merge branch 'master' of ssh://stash.freeswitch.org:7999/fs/freeswitch
This commit is contained in:
@@ -332,19 +332,22 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block)
|
||||
ssize_t r;
|
||||
int err = 0;
|
||||
|
||||
wsh->x++;
|
||||
if (wsh->x > 250) ms_sleep(1);
|
||||
|
||||
if (wsh->ssl) {
|
||||
do {
|
||||
r = SSL_read(wsh->ssl, data, bytes);
|
||||
|
||||
ms_sleep(10);
|
||||
|
||||
if (r == -1) {
|
||||
err = SSL_get_error(wsh->ssl, r);
|
||||
|
||||
|
||||
if (!block && err == SSL_ERROR_WANT_READ) {
|
||||
r = -2;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (block) ms_sleep(10);
|
||||
}
|
||||
|
||||
} while (r == -1 && err == SSL_ERROR_WANT_READ && wsh->x < 100);
|
||||
@@ -354,10 +357,17 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block)
|
||||
|
||||
do {
|
||||
r = recv(wsh->sock, data, bytes, 0);
|
||||
ms_sleep(10);
|
||||
if (r == -1) {
|
||||
if (!block && xp_is_blocking(xp_errno())) {
|
||||
r = -2;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (block) ms_sleep(10);
|
||||
}
|
||||
} while (r == -1 && xp_is_blocking(xp_errno()) && wsh->x < 100);
|
||||
|
||||
if (wsh->x >= 100) {
|
||||
if (wsh->x >= 1000 || (block && wsh->x >= 100)) {
|
||||
r = -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -4203,7 +4203,11 @@ SWITCH_DECLARE(switch_status_t) switch_channel_get_variables(switch_channel_t *c
|
||||
{
|
||||
switch_status_t status;
|
||||
switch_mutex_lock(channel->profile_mutex);
|
||||
status = switch_event_dup(event, channel->variables);
|
||||
if (channel->variables) {
|
||||
status = switch_event_dup(event, channel->variables);
|
||||
} else {
|
||||
status = switch_event_create(event, SWITCH_EVENT_CHANNEL_DATA);
|
||||
}
|
||||
switch_mutex_unlock(channel->profile_mutex);
|
||||
return status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user