Author: gonzalo
Date: 2005-04-16 23:10:36 -0400 (Sat, 16 Apr 2005)
New Revision: 43135

Modified:
   trunk/mono/mono/io-layer/ChangeLog
   trunk/mono/mono/io-layer/sockets.c
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/socket-io.c
   trunk/mono/mono/metadata/threadpool.c
Log:
2005-04-16 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.

        * io-layer/sockets.c: FIONBIO with a TRUE argument means we want
        non-blocking IO, not the other way around.

        * metadata/threadpool.c: removed hack to workaround the bug above.

        Fixes bug #74618.


Modified: trunk/mono/mono/io-layer/ChangeLog
===================================================================
--- trunk/mono/mono/io-layer/ChangeLog  2005-04-16 23:01:31 UTC (rev 43134)
+++ trunk/mono/mono/io-layer/ChangeLog  2005-04-17 03:10:36 UTC (rev 43135)
@@ -1,5 +1,10 @@
 2005-04-16 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
+       * io-layer/sockets.c: FIONBIO with a TRUE argument means we want
+       non-blocking IO, not the other way around.
+
+2005-04-16 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
        * handles.c:
        * io.c:
        * handles-private.h: GetFileType wasn't checking if we have memory

Modified: trunk/mono/mono/io-layer/sockets.c
===================================================================
--- trunk/mono/mono/io-layer/sockets.c  2005-04-16 23:01:31 UTC (rev 43134)
+++ trunk/mono/mono/io-layer/sockets.c  2005-04-17 03:10:36 UTC (rev 43135)
@@ -856,9 +856,9 @@
                ret = fcntl (fd, F_GETFL, 0);
                if (ret != -1) {
                        if (*(gboolean *)arg) {
+                               ret |= O_NONBLOCK;
+                       } else {
                                ret &= ~O_NONBLOCK;
-                       } else {
-                               ret |= O_NONBLOCK;
                        }
                        ret = fcntl (fd, F_SETFL, ret);
                }

Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2005-04-16 23:01:31 UTC (rev 43134)
+++ trunk/mono/mono/metadata/ChangeLog  2005-04-17 03:10:36 UTC (rev 43135)
@@ -1,3 +1,11 @@
+2005-04-16 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+       * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
+
+       * metadata/threadpool.c: removed hack to workaround the bug above.
+
+       Fixes bug #74618.
+
 2005-04-16  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * reflection.c reflection.h: Fix handling of parameter defaults in 
dynamic

Modified: trunk/mono/mono/metadata/socket-io.c
===================================================================
--- trunk/mono/mono/metadata/socket-io.c        2005-04-16 23:01:31 UTC (rev 
43134)
+++ trunk/mono/mono/metadata/socket-io.c        2005-04-17 03:10:36 UTC (rev 
43135)
@@ -709,6 +709,12 @@
        MONO_ARCH_SAVE_REGS;
 
        *error = 0;
+
+       /*
+        * block == TRUE/FALSE means we will block/not block.
+        * But the ioctlsocket call takes TRUE/FALSE for non-block/block
+        */
+       block = !block;
        
        ret = ioctlsocket (sock, FIONBIO, (gulong *) &block);
        if(ret==SOCKET_ERROR) {

Modified: trunk/mono/mono/metadata/threadpool.c
===================================================================
--- trunk/mono/mono/metadata/threadpool.c       2005-04-16 23:01:31 UTC (rev 
43134)
+++ trunk/mono/mono/metadata/threadpool.c       2005-04-17 03:10:36 UTC (rev 
43135)
@@ -301,13 +301,6 @@
 #ifdef EPOLL_DEBUG
                g_print ("Dispatching event %d on socket %d\n", event, 
state->handle);
 #endif
-#ifdef PLATFORM_WIN32
-               {
-               int block;
-               block = state->blocking;
-               ioctlsocket (state->handle, FIONBIO, (gulong *) &block);
-               }
-#endif
                InterlockedIncrement (&pending_io_items);
                start_io_thread_or_queue (state->ares);
        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to