[Win32] Don't exceed handle array bounds. Warn if there would be too many
authorTor Lillqvist <tml@iki.fi>
Fri, 15 Aug 2003 05:06:16 +0000 (05:06 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 15 Aug 2003 05:06:16 +0000 (05:06 +0000)
2003-08-15  Tor Lillqvist  <tml@iki.fi>

* glib/gmain.c (g_poll): [Win32] Don't exceed handle array
bounds. Warn if there would be too many handles to wait
for. (WaitForMultipleObjects() has a relatively low limit of 64
handles. The Win32 IO channel code should be fixed not to need to
wait for one handle per file or socket being watched. Later.)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gmain.c

index 83984b6..6b3a18e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-08-15  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gmain.c (g_poll): [Win32] Don't exceed handle array
+       bounds. Warn if there would be too many handles to wait
+       for. (WaitForMultipleObjects() has a relatively low limit of 64
+       handles. The Win32 IO channel code should be fixed not to need to
+       wait for one handle per file or socket being watched. Later.)
+
 2003-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * glib/Makefile.am
index 83984b6..6b3a18e 100644 (file)
@@ -1,3 +1,11 @@
+2003-08-15  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gmain.c (g_poll): [Win32] Don't exceed handle array
+       bounds. Warn if there would be too many handles to wait
+       for. (WaitForMultipleObjects() has a relatively low limit of 64
+       handles. The Win32 IO channel code should be fixed not to need to
+       wait for one handle per file or socket being watched. Later.)
+
 2003-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * glib/Makefile.am
index 83984b6..6b3a18e 100644 (file)
@@ -1,3 +1,11 @@
+2003-08-15  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gmain.c (g_poll): [Win32] Don't exceed handle array
+       bounds. Warn if there would be too many handles to wait
+       for. (WaitForMultipleObjects() has a relatively low limit of 64
+       handles. The Win32 IO channel code should be fixed not to need to
+       wait for one handle per file or socket being watched. Later.)
+
 2003-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * glib/Makefile.am
index 83984b6..6b3a18e 100644 (file)
@@ -1,3 +1,11 @@
+2003-08-15  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gmain.c (g_poll): [Win32] Don't exceed handle array
+       bounds. Warn if there would be too many handles to wait
+       for. (WaitForMultipleObjects() has a relatively low limit of 64
+       handles. The Win32 IO channel code should be fixed not to need to
+       wait for one handle per file or socket being watched. Later.)
+
 2003-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * glib/Makefile.am
index 83984b6..6b3a18e 100644 (file)
@@ -1,3 +1,11 @@
+2003-08-15  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gmain.c (g_poll): [Win32] Don't exceed handle array
+       bounds. Warn if there would be too many handles to wait
+       for. (WaitForMultipleObjects() has a relatively low limit of 64
+       handles. The Win32 IO channel code should be fixed not to need to
+       wait for one handle per file or socket being watched. Later.)
+
 2003-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * glib/Makefile.am
index 83984b6..6b3a18e 100644 (file)
@@ -1,3 +1,11 @@
+2003-08-15  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gmain.c (g_poll): [Win32] Don't exceed handle array
+       bounds. Warn if there would be too many handles to wait
+       for. (WaitForMultipleObjects() has a relatively low limit of 64
+       handles. The Win32 IO channel code should be fixed not to need to
+       wait for one handle per file or socket being watched. Later.)
+
 2003-08-13  Tor Lillqvist  <tml@iki.fi>
 
        * glib/Makefile.am
index 699c68b..a3a9dc9 100644 (file)
@@ -273,6 +273,11 @@ g_poll (GPollFD *fds,
       {
        if (f->fd == G_WIN32_MSG_HANDLE)
          poll_msgs = TRUE;
+       else if (nhandles == MAXIMUM_WAIT_OBJECTS)
+         {
+           g_warning (G_STRLOC ": Too many handles to wait for!\n");
+           break;
+         }
        else
          {
 #ifdef G_MAIN_POLL_DEBUG