[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16525 - gnunet-gtk/src/lib
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16525 - gnunet-gtk/src/lib |
Date: |
Mon, 15 Aug 2011 14:37:14 +0200 |
Author: grothoff
Date: 2011-08-15 14:37:13 +0200 (Mon, 15 Aug 2011)
New Revision: 16525
Modified:
gnunet-gtk/src/lib/eventloop.c
Log:
fixfix
Modified: gnunet-gtk/src/lib/eventloop.c
===================================================================
--- gnunet-gtk/src/lib/eventloop.c 2011-08-15 12:31:59 UTC (rev 16524)
+++ gnunet-gtk/src/lib/eventloop.c 2011-08-15 12:37:13 UTC (rev 16525)
@@ -223,7 +223,7 @@
resize_cached_poll_array (struct GNUNET_GTK_MainLoop *ml,
guint new_size)
{
- ml->cached_poll_array = g_new (GPollFD, new_size);
+ ml->cached_poll_array = g_renew (GPollFD, ml->cached_poll_array, new_size);
ml->cached_poll_array_size = new_size;
}
@@ -338,7 +338,7 @@
ml->cached_poll_array[fd_counter].fd = i;
ml->cached_poll_array[fd_counter].events = (isset[0] ? G_IO_IN |
G_IO_HUP | G_IO_ERR : 0)
| (isset[1] ? G_IO_OUT | G_IO_ERR : 0) | (isset[2] ? G_IO_ERR : 0);
- fd_counter += 1;
+ fd_counter++;
}
if (need_realloc)
{
@@ -365,7 +365,8 @@
}
if (ml->read_array_length < GNUNET_CONTAINER_slist_count (rfds->handles))
{
- ml->read_array = GNUNET_realloc (ml->read_array,
GNUNET_CONTAINER_slist_count (rfds->handles) * sizeof (struct
GNUNET_DISK_FileHandle *));
+ ml->read_array = GNUNET_realloc (ml->read_array,
+ GNUNET_CONTAINER_slist_count
(rfds->handles) * sizeof (struct GNUNET_DISK_FileHandle *));
ml->read_array_length = GNUNET_CONTAINER_slist_count (rfds->handles);
}
if (rfds != NULL)
@@ -384,7 +385,9 @@
if (error_code == ERROR_IO_PENDING)
{
#if DEBUG_NETWORK
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding the
pipe's 0x%x overlapped event to the array as %d\n", fh->h, nhandles);
+ 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
@@ -408,7 +411,9 @@
else
{
#if DEBUG_NETWORK
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding the read
ready event to the array as %d\n", nhandles);
+ 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;
@@ -459,7 +464,9 @@
if (rfds != NULL && rfds->sds.fd_count > 0)
{
#if DEBUG_NETWORK
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding the socket read event to
the array as %d\n", fd_counter);
+ 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;
@@ -472,7 +479,9 @@
{
int wakeup = 0;
#if DEBUG_NETWORK
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding the socket write event
to the array as %d\n", fd_counter);
+ 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;
@@ -483,7 +492,9 @@
status = send (wfds->sds.fd_array[i], NULL, 0, 0);
error = GetLastError ();
#if DEBUG_NETWORK
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "pre-send to the socket %d
returned %d (%u)\n", i, status, error);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "pre-send to the socket %d returned %d (%u)\n",
+ i, status, error);
#endif
if (status == 0 || (error != WSAEWOULDBLOCK && error !=
WSAENOTCONN))
wakeup = 1;
@@ -497,7 +508,9 @@
if (efds != NULL && efds->sds.fd_count > 0)
{
#if DEBUG_NETWORK
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding the socket error event
to the array as %d\n", fd_counter);
+ 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;
@@ -530,19 +543,25 @@
if (pre_ret > 0)
{
#if DEBUG_NETWORK
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "pre_ret is %d, setting delay to
0\n", pre_ret);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "pre_ret is %d, setting delay to 0\n",
+ pre_ret);
#endif
delay = 0;
}
#if DEBUG_NETWORK
- 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);
+ 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_NETWORK
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "g_poll returned : %d\n", poll_result);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "g_poll returned : %d\n",
+ poll_result);
#endif
/* Take care of GUI events.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16525 - gnunet-gtk/src/lib,
gnunet <=