]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5887 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 18 Oct 2013 19:00:28 +0000 (00:00 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 18 Oct 2013 19:00:28 +0000 (00:00 +0500)
libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/tport/ws.c
libs/sofia-sip/libsofia-sip-ua/tport/ws.h

index 36fa387d657d342bc96ea8a06686b144f0e8e1c5..a528d9c44781b7509dcbabdefc99cbbbdfaaf6a2 100644 (file)
@@ -1 +1 @@
-Tue Oct  8 12:10:32 CDT 2013
+Fri Oct 18 23:59:59 CDT 2013
index a8d056c8955ec3bd5bd0366963aedddf0d118d2f..a6b73406e49fccf318bcca81dc86fd30a3847204 100644 (file)
@@ -334,8 +334,7 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes)
 #else
                if (x++) Sleep(10);
 #endif
-               } while (r == -1 && (errno == EAGAIN || errno == EINTR || errno == EWOULDBLOCK || 
-                                                        errno == 35 || errno == 730035 || errno == 2 || errno == 60) && x < 100);
+       } while (r == -1 && xp_is_blocking(xp_errno()) && x < 100);
        
        if (x >= 100) {
                r = -1;
@@ -364,7 +363,7 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes)
 
        do {
                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) {
                //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;
 }
 
+#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
\ No newline at end of file
index 11e6b93068e5a696c8c38e696937b9c86041d396..8c0a50733e993568486dd0c49173461ee68fd0e7 100644 (file)
@@ -91,6 +91,8 @@ void ws_destroy(wsh_t *wsh);
 void init_ssl(void);
 void deinit_ssl(void);
 
+int xp_errno(void);
+int xp_is_blocking(int errcode);
 
 #ifndef _MSC_VER
 static inline uint64_t get_unaligned_uint64(const void *p)