static void
clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_TRANSPORT_disconnect (p1.th);
- p1.th = NULL;
- GNUNET_TRANSPORT_disconnect (p2.th);
- p2.th = NULL;
+ if (p1.th != NULL)
+ {
+ GNUNET_TRANSPORT_disconnect (p1.th);
+ p1.th = NULL;
+ }
+ if (p2.th != NULL)
+ {
+ GNUNET_TRANSPORT_disconnect (p2.th);
+ p2.th = NULL;
+ }
GNUNET_SCHEDULER_shutdown (sched);
}
return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Peers connected, shutting down.\n");
- GNUNET_assert (ok == 4);
ok = 0;
- GNUNET_SCHEDULER_cancel (sched,
- timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
- GNUNET_SCHEDULER_add_now (sched,
- &clean_up, NULL);
+ if (timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ {
+ GNUNET_SCHEDULER_cancel (sched,
+ timeout_task);
+ timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ }
+ GNUNET_SCHEDULER_add_delayed (sched,
+ GNUNET_TIME_UNIT_MINUTES,
+ &clean_up, NULL);
}
return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received HELLO, starting hostlist service.\n");
- GNUNET_assert ( (ok >= 2) && (ok <= 3) );
- ok++;
GNUNET_ARM_start_services (p->cfg, sched, "hostlist", NULL);
}
[transport]
PORT = 12965
PLUGINS = tcp
-#DEBUG = YES
+DEBUG = YES
[arm]
PORT = 12966
HTTPPORT = 12980
SERVERS = http://localhost:12981/
OPTIONS = -b -p
+DEBUG = YES
#BINARY = /home/grothoff/bin/gnunet-daemon-hostlist
[topology]
[transport]
PORT = 22965
PLUGINS = tcp
-#DEBUG = YES
+DEBUG = YES
[arm]
PORT = 22966
HTTPPORT = 12981
SERVERS = http://localhost:12980/
OPTIONS = -b -p
+DEBUG = YES
#BINARY = /home/grothoff/bin/gnunet-daemon-hostlist
[topology]
if (buf == NULL)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+#if DEBUG_PEERINFO
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
_
("Failed to transmit message of type %u to `%s' service.\n"),
ntohs (msg->type), "peerinfo");
+#endif
GNUNET_free (msg);
GNUNET_CLIENT_disconnect (cc->client);
GNUNET_free (cc);
GNUNET_CLIENT_notify_transmit_ready (client,
ntohs (pam->header.size),
ADD_PEER_TIMEOUT,
- GNUNET_YES,
+ GNUNET_NO,
©_and_free, cc);
}
#include "gnunet_time_lib.h"
#include "gnunet_transport_service.h"
-#define DEBUG_TRANSPORT GNUNET_NO
+#define DEBUG_TRANSPORT GNUNET_YES
/**
* For how long do we allow unused bandwidth
if (buf == NULL)
{
#if DEBUG_TRANSPORT
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Could not transmit to transport service, cancelling pending requests\n");
#endif
th = h->connect_ready_head;
}
GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL));
GNUNET_free (th);
- if (h->connect_ready_head != NULL) schedule_transmission (h); /* FIXME: is this ok? */
+ if (h->connect_ready_head != NULL)
+ schedule_transmission (h); /* FIXME: is this ok? */
return 0;
}
#if DEBUG_TRANSPORT
ret = 0;
h->network_handle = NULL;
h->transmission_scheduled = GNUNET_NO;
- do
+ while ((h->connect_ready_head != NULL) &&
+ (h->connect_ready_head->notify_size <= size))
{
th = h->connect_ready_head;
if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK)
n->last_sent += ret;
size -= ret;
}
- while ((h->connect_ready_head != NULL) &&
- (h->connect_ready_head->notify_size <= size));
if (h->connect_ready_head != NULL)
schedule_transmission (h);
#if DEBUG_TRANSPORT
while (NULL != (n = handle->neighbours))
{
handle->neighbours = n->next;
+ if (NULL != (th = n->transmit_handle))
+ {
+ if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK)
+ {
+ GNUNET_SCHEDULER_cancel (handle->sched, th->notify_delay_task);
+ th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ }
+ th->notify (th->notify_cls, 0, NULL);
+ GNUNET_free (th);
+ }
GNUNET_free (n);
}
while (NULL != (hwl = handle->hwl_head))