FS-10150: [freeswitch-core] Reduce writes to closed ssl sockets -- same fix for non-ssl sockets #resolve

This commit is contained in:
Anthony Minessale 2017-04-21 15:43:40 -05:00 committed by Mike Jerris
parent 47af36ff83
commit fa6e6c4e0c
3 changed files with 17 additions and 5 deletions

View File

@ -1 +1 @@
Thu Apr 6 17:08:19 CDT 2017
Thu Jun 1 14:43:20 EDT 2017

View File

@ -455,7 +455,13 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes)
ms_sleep(1);
}
} while (--sanity > 0 && ((r == -1 && xp_is_blocking(xp_errno())) || (wsh->block && wrote < bytes)));
if (r == -1) {
if (!xp_is_blocking(xp_errno())) {
break;
}
}
} while (--sanity > 0 && wsh->block && wrote < bytes);
//if (r<0) {
//printf("wRITE FAIL: %s\n", strerror(errno));

View File

@ -454,9 +454,15 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes)
if (sanity < 2000) {
ms_sleep(1);
}
} while (--sanity > 0 && ((r == -1 && xp_is_blocking(xp_errno())) || (wsh->block && wrote < bytes)));
if (r == -1) {
if (!xp_is_blocking(xp_errno())) {
break;
}
}
} while (--sanity > 0 && wsh->block && wrote < bytes);
//if (r<0) {
//printf("wRITE FAIL: %s\n", strerror(errno));
//}