[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31553 - gnunet/src/dv
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31553 - gnunet/src/dv |
Date: |
Wed, 18 Dec 2013 23:57:37 +0100 |
Author: grothoff
Date: 2013-12-18 23:57:37 +0100 (Wed, 18 Dec 2013)
New Revision: 31553
Modified:
gnunet/src/dv/dv_api.c
gnunet/src/dv/gnunet-service-dv.c
Log:
-fix transmission logic in DV API
Modified: gnunet/src/dv/dv_api.c
===================================================================
--- gnunet/src/dv/dv_api.c 2013-12-18 21:45:37 UTC (rev 31552)
+++ gnunet/src/dv/dv_api.c 2013-12-18 22:57:37 UTC (rev 31553)
@@ -198,6 +198,15 @@
/**
+ * Start sending messages from our queue to the service.
+ *
+ * @param sh service handle
+ */
+static void
+start_transmit (struct GNUNET_DV_ServiceHandle *sh);
+
+
+/**
* Gives a message from our queue to the DV service.
*
* @param cls handle to the dv service (`struct GNUNET_DV_ServiceHandle`)
@@ -236,15 +245,17 @@
ret += tsize;
if (NULL != th->cb)
{
- GNUNET_CONTAINER_DLL_insert (th->target->head,
- th->target->tail,
- th);
+ GNUNET_CONTAINER_DLL_insert_tail (th->target->head,
+ th->target->tail,
+ th);
}
else
{
GNUNET_free (th);
}
}
+ if (NULL != sh->th_head)
+ start_transmit (sh);
return ret;
}
@@ -691,9 +702,9 @@
/* use memcpy here as 'target' may not be sufficiently aligned */
memcpy (&sm->target, target, sizeof (struct GNUNET_PeerIdentity));
memcpy (&sm[1], msg, ntohs (msg->size));
- GNUNET_CONTAINER_DLL_insert (sh->th_head,
- sh->th_tail,
- th);
+ GNUNET_CONTAINER_DLL_insert_tail (sh->th_head,
+ sh->th_tail,
+ th);
start_transmit (sh);
return th;
}
Modified: gnunet/src/dv/gnunet-service-dv.c
===================================================================
--- gnunet/src/dv/gnunet-service-dv.c 2013-12-18 21:45:37 UTC (rev 31552)
+++ gnunet/src/dv/gnunet-service-dv.c 2013-12-18 22:57:37 UTC (rev 31553)
@@ -1961,6 +1961,10 @@
if (NULL == route)
{
/* got disconnected */
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "No route to %s, dropping local message of type %u\n",
+ GNUNET_i2s (&msg->target),
+ ntohs (payload->type));
GNUNET_STATISTICS_update (stats,
"# local messages discarded (no route)",
1, GNUNET_NO);
@@ -1969,8 +1973,9 @@
return;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Forwarding %u bytes to %s\n",
+ "Forwarding %u bytes of type %u to %s\n",
ntohs (payload->size),
+ ntohs (payload->type),
GNUNET_i2s (&msg->target));
forward_payload (route->next_hop,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31553 - gnunet/src/dv,
gnunet <=