]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6854 #resolve
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 25 Sep 2014 16:43:57 +0000 (21:43 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 25 Sep 2014 16:44:02 +0000 (21:44 +0500)
libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/tport/ws.c
src/mod/endpoints/mod_verto/ws.c

index cb2691c2a158a24bb360ff770e9f8bf8ecb3a615..63605e55a1162377cea4c377902b44aec9869507 100644 (file)
@@ -1 +1 @@
-Wed Sep 24 01:09:42 CDT 2014
+Thu Sep 25 21:43:53 CDT 2014
index 2fcd7021c089ddbaaf31caa6e05e2fefb74aff68..7f4318e54335285c648abf04a3b8c31b2878747a 100644 (file)
@@ -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;
        }
 
index 2fcd7021c089ddbaaf31caa6e05e2fefb74aff68..7f4318e54335285c648abf04a3b8c31b2878747a 100644 (file)
@@ -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;
        }