From d0e22a6ee4d161fa73ef02ca2d91763acfd0d5c1 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 4 Mar 2012 22:30:50 +0000 Subject: -die ifdef debug, die --- src/lib/eventloop.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/src/lib/eventloop.c b/src/lib/eventloop.c index 5ef2282b..be76dddb 100644 --- a/src/lib/eventloop.c +++ b/src/lib/eventloop.c @@ -25,7 +25,6 @@ */ #include "gnunet_gtk.h" -#define DEBUG_EVENTLOOP GNUNET_NO /** * Initial size of our poll array cache. @@ -437,11 +436,9 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds, if (error_code == ERROR_IO_PENDING) { -#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); -#endif ml->cached_poll_array[fd_counter].fd = (intptr_t) fh->oOverlapRead->hEvent; /* On W32 .events makes no sense - g_poll will just OR its @@ -465,11 +462,9 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds, } else { -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding the read ready event to the array as %d\n", nhandles); -#endif ml->cached_poll_array[fd_counter].fd = (intptr_t) ml->hEventReadReady; ml->cached_poll_array[fd_counter].events = G_IO_IN; @@ -522,11 +517,9 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds, if ((rfds != NULL) && (rfds->sds.fd_count > 0)) { -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding the socket read event to the array as %d\n", fd_counter); -#endif ml->cached_poll_array[fd_counter].fd = (intptr_t) ml->hEventRead; ml->cached_poll_array[fd_counter].events = G_IO_IN; for (i = 0; i < rfds->sds.fd_count; i++) @@ -539,11 +532,9 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds, { int wakeup = 0; -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding the socket write event to the array as %d\n", fd_counter); -#endif ml->cached_poll_array[fd_counter].fd = (intptr_t) ml->hEventWrite; ml->cached_poll_array[fd_counter].events = G_IO_OUT; for (ui = 0; ui < wfds->sds.fd_count; ui++) @@ -553,11 +544,9 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds, status = send (wfds->sds.fd_array[ui], NULL, 0, 0); error = GetLastError (); -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "pre-send to the socket %u returned %d (%u)\n", ui, status, error); -#endif if (status == 0 || (error != WSAEWOULDBLOCK && error != WSAENOTCONN)) wakeup = 1; WSAEventSelect (wfds->sds.fd_array[ui], ml->hEventWrite, @@ -570,11 +559,9 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds, } if ((efds != NULL) && (efds->sds.fd_count > 0)) { -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding the socket error event to the array as %d\n", fd_counter); -#endif ml->cached_poll_array[fd_counter].fd = (intptr_t) ml->hEventException; ml->cached_poll_array[fd_counter].events = G_IO_ERR; for (ui = 0; ui < efds->sds.fd_count; ui++) @@ -615,24 +602,17 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds, #if WINDOWS if (pre_ret > 0) { -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "pre_ret is %d, setting delay to 0\n", pre_ret); -#endif delay = 0; } #endif -#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); -#endif - poll_result = g_poll (ml->cached_poll_array, fd_counter + need_gfds, delay); -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "g_poll returned : %d\n", poll_result); -#endif if (-1 == poll_result) return GNUNET_SYSERR; @@ -692,18 +672,14 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds, select_ret = select (max_nfds, &aread, &awrite, &aexcept, &tvslice); if (select_ret == -1) select_ret = 0; -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "select() returned %d\n", select_ret); -#endif } if (always_ready_write_fd >= 0 && ml->cached_poll_array[always_ready_write_fd].revents & G_IO_OUT) { GNUNET_CONTAINER_slist_append (ml->handles_write, wfds->handles); result += GNUNET_CONTAINER_slist_count (ml->handles_write); -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Added write pipe\n"); -#endif } for (i = 0; i < read_handles; i++) { @@ -717,11 +693,9 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds, bret = PeekNamedPipe (ml->read_array[i]->h, NULL, 0, NULL, &waitstatus, NULL); error = GetLastError (); -#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); -#endif if (bret == 0 || (ml->cached_poll_array[i].revents & G_IO_ERR)) { if (efds != NULL) @@ -752,16 +726,12 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds, ml->read_array[i], sizeof (struct GNUNET_DISK_FileHandle)); result += 1; -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Added read Pipe 0x%x (0x%x)\n", ml->read_array[i], ml->read_array[i]->h); -#endif } waitstatus = WaitForSingleObject (ml->hEventWrite, 0); -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Wait for the write event returned %d\n", waitstatus); -#endif if (waitstatus == WAIT_OBJECT_0) { for (ui = 0; ui < wfds->sds.fd_count; ui++) @@ -776,11 +746,9 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds, status = send (wfds->sds.fd_array[ui], NULL, 0, 0); error = GetLastError (); -#if DEBUG_EVENTLOOP GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "send to the socket %u returned %d (%u)\n", ui, status, error); -#endif if (status == 0 || (error != WSAEWOULDBLOCK && error != WSAENOTCONN) || (status == -1 && gso_result == 0 && error == WSAENOTCONN && so_error == WSAECONNREFUSED)) -- cgit v1.2.3