[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r20257 - gnunet-gtk/src/lib
From: |
gnunet |
Subject: |
[GNUnet-SVN] r20257 - gnunet-gtk/src/lib |
Date: |
Sun, 4 Mar 2012 23:30:50 +0100 |
Author: grothoff
Date: 2012-03-04 23:30:50 +0100 (Sun, 04 Mar 2012)
New Revision: 20257
Modified:
gnunet-gtk/src/lib/eventloop.c
Log:
-die ifdef debug, die
Modified: gnunet-gtk/src/lib/eventloop.c
===================================================================
--- gnunet-gtk/src/lib/eventloop.c 2012-03-04 22:28:22 UTC (rev 20256)
+++ gnunet-gtk/src/lib/eventloop.c 2012-03-04 22:30:50 UTC (rev 20257)
@@ -25,7 +25,6 @@
*/
#include "gnunet_gtk.h"
-#define DEBUG_EVENTLOOP GNUNET_NO
/**
* Initial size of our poll array cache.
@@ -437,11 +436,9 @@
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 @@
}
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 @@
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 @@
{
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 @@
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 @@
}
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 @@
#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 @@
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 @@
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 @@
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 @@
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))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r20257 - gnunet-gtk/src/lib,
gnunet <=