mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 16:15:04 +00:00
FS-5887 --resolve
This commit is contained in:
parent
bf78270540
commit
0d19abfbdb
@ -1 +1 @@
|
|||||||
Tue Oct 8 12:10:32 CDT 2013
|
Fri Oct 18 23:59:59 CDT 2013
|
||||||
|
@ -334,8 +334,7 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes)
|
|||||||
#else
|
#else
|
||||||
if (x++) Sleep(10);
|
if (x++) Sleep(10);
|
||||||
#endif
|
#endif
|
||||||
} while (r == -1 && (errno == EAGAIN || errno == EINTR || errno == EWOULDBLOCK ||
|
} while (r == -1 && xp_is_blocking(xp_errno()) && x < 100);
|
||||||
errno == 35 || errno == 730035 || errno == 2 || errno == 60) && x < 100);
|
|
||||||
|
|
||||||
if (x >= 100) {
|
if (x >= 100) {
|
||||||
r = -1;
|
r = -1;
|
||||||
@ -364,7 +363,7 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
r = send(wsh->sock, data, bytes, 0);
|
r = send(wsh->sock, data, bytes, 0);
|
||||||
} while (r == -1 && (errno == EAGAIN || errno == EINTR));
|
} while (r == -1 && xp_is_blocking(xp_errno()));
|
||||||
|
|
||||||
//if (r<0) {
|
//if (r<0) {
|
||||||
//printf("wRITE FAIL: %s\n", strerror(errno));
|
//printf("wRITE FAIL: %s\n", strerror(errno));
|
||||||
@ -789,4 +788,28 @@ ssize_t ws_write_frame(wsh_t *wsh, ws_opcode_t oc, void *data, size_t bytes)
|
|||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
|
int xp_errno(void)
|
||||||
|
{
|
||||||
|
return WSAGetLastError();
|
||||||
|
}
|
||||||
|
|
||||||
|
int xp_is_blocking(int errcode)
|
||||||
|
{
|
||||||
|
return errcode == WSAEWOULDBLOCK || errcode == WSAEINPROGRESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
int xp_errno(void)
|
||||||
|
{
|
||||||
|
return errno;
|
||||||
|
}
|
||||||
|
|
||||||
|
int xp_is_blocking(int errcode)
|
||||||
|
{
|
||||||
|
return errcode == EAGAIN || errcode == EWOULDBLOCK || errcode == EINPROGRESS || errcode == EINTR;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -91,6 +91,8 @@ void ws_destroy(wsh_t *wsh);
|
|||||||
void init_ssl(void);
|
void init_ssl(void);
|
||||||
void deinit_ssl(void);
|
void deinit_ssl(void);
|
||||||
|
|
||||||
|
int xp_errno(void);
|
||||||
|
int xp_is_blocking(int errcode);
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
static inline uint64_t get_unaligned_uint64(const void *p)
|
static inline uint64_t get_unaligned_uint64(const void *p)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user