gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r16560 - gnunet-gtk/src/lib


From: gnunet
Subject: [GNUnet-SVN] r16560 - gnunet-gtk/src/lib
Date: Mon, 15 Aug 2011 17:14:21 +0200

Author: grothoff
Date: 2011-08-15 17:14:20 +0200 (Mon, 15 Aug 2011)
New Revision: 16560

Modified:
   gnunet-gtk/src/lib/eventloop.c
Log:
fix

Modified: gnunet-gtk/src/lib/eventloop.c
===================================================================
--- gnunet-gtk/src/lib/eventloop.c      2011-08-15 15:10:48 UTC (rev 16559)
+++ gnunet-gtk/src/lib/eventloop.c      2011-08-15 15:14:20 UTC (rev 16560)
@@ -25,6 +25,7 @@
  */
 #include "gnunet_gtk.h"
 
+#define DEBUG_EVENTLOOP GNUNET_YES
 
 /** 
  * Initial size of our poll array cache.
@@ -239,6 +240,8 @@
 {
   struct GNUNET_GTK_MainLoop *ml = cls;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Dummy task was scheduled\n");
   ml->dummy_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
                                                 &keepalive_task,
                                                 ml);
@@ -391,7 +394,7 @@
                      DWORD error_code = GetLastError();
                      if (error_code == ERROR_IO_PENDING)
                        {
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
                          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                                      "Adding the pipe's 0x%x overlapped event 
to the array as %d\n", 
                                      fh->h, nhandles);
@@ -417,7 +420,7 @@
                    }
                  else
                    {
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
                      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                                  "Adding the read ready event to the array as 
%d\n",
                                  nhandles);
@@ -470,7 +473,7 @@
       
       if ( (rfds != NULL) && (rfds->sds.fd_count > 0) )
        {
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
                      "Adding the socket read event to the array as %d\n",
                      fd_counter);
@@ -485,7 +488,7 @@
       if ( (wfds != NULL) && (wfds->sds.fd_count > 0) )
        {
          int wakeup = 0;
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                      "Adding the socket write event to the array as %d\n", 
                      fd_counter);
@@ -498,7 +501,7 @@
              int status;
              status = send (wfds->sds.fd_array[i], NULL, 0, 0);
              error = GetLastError ();
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
              GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
                          "pre-send to the socket %d returned %d (%u)\n", 
                          i, status, error);
@@ -514,7 +517,7 @@
        }
       if ( (efds != NULL) && (efds->sds.fd_count > 0) )
        {
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
                      "Adding the socket error event to the array as %d\n",
                      fd_counter);
@@ -540,7 +543,7 @@
                                        &delay,
                                        &ml->cached_poll_array[fd_counter], 
                                        ml->cached_poll_array_size - 
fd_counter);
-      if (ml->cached_poll_array_size < need_gfds + fd_counter)
+      if (ml->cached_poll_array_size >= need_gfds + fd_counter)
        break;
       resize_cached_poll_array (ml,
                                fd_counter + need_gfds);
@@ -558,7 +561,7 @@
 #if WINDOWS
   if (pre_ret > 0)
     {
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "pre_ret is %d, setting delay to 0\n",
                  pre_ret);
@@ -567,7 +570,7 @@
     }
 #endif
 
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
              "We have %d of our FDs and %d of GMC ones, going to wait %6dms\n",
              fd_counter, need_gfds, delay);
@@ -576,7 +579,7 @@
   poll_result = g_poll (ml->cached_poll_array,
                        fd_counter + need_gfds, 
                        delay);
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "g_poll returned : %d\n", 
              poll_result);
@@ -630,7 +633,7 @@
       select_ret = select (max_nfds, &aread, &awrite, &aexcept, &tvslice);
       if (select_ret == -1)
        select_ret = 0;
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
                  "select() returned %d\n", 
                  select_ret);
@@ -640,7 +643,7 @@
     {
       GNUNET_CONTAINER_slist_append (ml->handles_write, wfds->handles);
       result += GNUNET_CONTAINER_slist_count (ml->handles_write);
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Added write pipe\n");
 #endif
     }
@@ -654,7 +657,7 @@
       waitstatus = 0;
       bret = PeekNamedPipe (ml->read_array[i]->h, NULL, 0, NULL, &waitstatus, 
NULL);
       error = GetLastError ();
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
                  "Peek at read pipe %d (0x%x) returned %d (%d bytes available) 
GLE %u\n", 
                  i, ml->read_array[i]->h, bret, waitstatus, error);
@@ -686,7 +689,7 @@
                                  GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
                                  ml->read_array[i], sizeof (struct 
GNUNET_DISK_FileHandle));
       result += 1;
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
                  "Added read Pipe 0x%x (0x%x)\n", 
                  ml->read_array[i],
@@ -694,7 +697,7 @@
 #endif
     }
   waitstatus = WaitForSingleObject (ml->hEventWrite, 0);
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Wait for the write event returned %d\n", 
              waitstatus);
@@ -712,7 +715,7 @@
                                       (char *) &so_error, &sizeof_so_error);
          status = send (wfds->sds.fd_array[i], NULL, 0, 0);
          error = GetLastError ();
-#if DEBUG_NETWORK
+#if DEBUG_EVENTLOOP
          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
                      "send to the socket %d returned %d (%u)\n", 
                      i, status, error);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]