diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 63605e55a1..31d9a658f9 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Thu Sep 25 21:43:53 CDT 2014 +Tue Sep 30 20:32:49 CDT 2014 diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c index 6fa69d2161..51ae0f13f7 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c @@ -352,7 +352,10 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block) goto end; } - if (block) ms_sleep(10); + if (block) { + wsh->x++; + ms_sleep(10); + } } } while (r == -1 && err == SSL_ERROR_WANT_READ && wsh->x < 100); @@ -361,14 +364,19 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block) } do { + r = recv(wsh->sock, data, bytes, 0); + if (r == -1) { if (!block && xp_is_blocking(xp_errno())) { r = -2; goto end; } - if (block) ms_sleep(10); + if (block) { + wsh->x++; + ms_sleep(10); + } } } while (r == -1 && xp_is_blocking(xp_errno()) && wsh->x < 100); diff --git a/src/mod/endpoints/mod_verto/ws.c b/src/mod/endpoints/mod_verto/ws.c index 6fa69d2161..51ae0f13f7 100644 --- a/src/mod/endpoints/mod_verto/ws.c +++ b/src/mod/endpoints/mod_verto/ws.c @@ -352,7 +352,10 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block) goto end; } - if (block) ms_sleep(10); + if (block) { + wsh->x++; + ms_sleep(10); + } } } while (r == -1 && err == SSL_ERROR_WANT_READ && wsh->x < 100); @@ -361,14 +364,19 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block) } do { + r = recv(wsh->sock, data, bytes, 0); + if (r == -1) { if (!block && xp_is_blocking(xp_errno())) { r = -2; goto end; } - if (block) ms_sleep(10); + if (block) { + wsh->x++; + ms_sleep(10); + } } } while (r == -1 && xp_is_blocking(xp_errno()) && wsh->x < 100);