[polypaudio-commits] r760 - in /trunk/src/polypcore: socket-client.c winsock.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed Apr 19 04:56:27 PDT 2006


Author: ossman
Date: Wed Apr 19 13:56:26 2006
New Revision: 760

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=760&root=polypaudio&view=rev
Log:
Minor fixes for the way Windows handles sockets.

Modified:
    trunk/src/polypcore/socket-client.c
    trunk/src/polypcore/winsock.h

Modified: trunk/src/polypcore/socket-client.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/socket-client.c?rev=760&root=polypaudio&r1=759&r2=760&view=diff
==============================================================================
--- trunk/src/polypcore/socket-client.c (original)
+++ trunk/src/polypcore/socket-client.c Wed Apr 19 13:56:26 2006
@@ -151,7 +151,7 @@
         errno = error;
         goto finish;
     }
-        
+
     io = pa_iochannel_new(c->mainloop, c->fd, c->fd);
     assert(io);
     
@@ -187,8 +187,13 @@
     pa_make_nonblock_fd(c->fd);
     
     if ((r = connect(c->fd, sa, len)) < 0) {
+#ifdef OS_IS_WIN32
+        if (WSAGetLastError() != EWOULDBLOCK) {
+            pa_log_debug(__FILE__": connect(): %d", WSAGetLastError());
+#else
         if (errno != EINPROGRESS) {
-            /*pa_log(__FILE__": connect(): %s", strerror(errno));*/
+            pa_log_debug(__FILE__": connect(): %s (%d)", strerror(errno), errno);
+#endif
             return -1;
         }
 
@@ -473,9 +478,11 @@
                 struct hostent *host = NULL;
                 struct sockaddr_in s;
 
-		/* FIXME: PF_INET6 support */
-                if (hints.ai_family != PF_INET)
+                /* FIXME: PF_INET6 support */
+                if (hints.ai_family == PF_INET6) {
+                    pa_log_error(__FILE__": IPv6 is not supported on Windows");
                     goto finish;
+                }
 
                 host = gethostbyname(a.path_or_host);
                 if (!host) {

Modified: trunk/src/polypcore/winsock.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/winsock.h?rev=760&root=polypaudio&r1=759&r2=760&view=diff
==============================================================================
--- trunk/src/polypcore/winsock.h (original)
+++ trunk/src/polypcore/winsock.h Wed Apr 19 13:56:26 2006
@@ -13,6 +13,7 @@
 #define ETIMEDOUT       WSAETIMEDOUT
 #define ECONNREFUSED    WSAECONNREFUSED
 #define EHOSTUNREACH    WSAEHOSTUNREACH
+#define EWOULDBLOCK     WSAEWOULDBLOCK
 
 #endif
 




More information about the pulseaudio-commits mailing list