[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r34605 - gnunet/src/cadet
From: |
gnunet |
Subject: |
[GNUnet-SVN] r34605 - gnunet/src/cadet |
Date: |
Mon, 15 Dec 2014 08:18:13 +0100 |
Author: bartpolot
Date: 2014-12-15 08:18:13 +0100 (Mon, 15 Dec 2014)
New Revision: 34605
Modified:
gnunet/src/cadet/gnunet-service-cadet_connection.c
gnunet/src/cadet/gnunet-service-cadet_peer.c
Log:
- fix PID management on send
Modified: gnunet/src/cadet/gnunet-service-cadet_connection.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_connection.c 2014-12-15 07:18:12 UTC
(rev 34604)
+++ gnunet/src/cadet/gnunet-service-cadet_connection.c 2014-12-15 07:18:13 UTC
(rev 34605)
@@ -582,8 +582,8 @@
LOG (GNUNET_ERROR_TYPE_DEBUG, "connection message_sent\n");
fc = fwd ? &c->fwd_fc : &c->bck_fc;
- LOG (GNUNET_ERROR_TYPE_DEBUG, " %ssent %s %s\n",
- sent ? "" : "not ", GC_f2s (fwd), GC_m2s (type));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " %ssent %s %s pid %u\n",
+ sent ? "" : "not ", GC_f2s (fwd), GC_m2s (type), pid);
if (NULL != q)
{
forced = q->forced;
@@ -2018,7 +2018,7 @@
if (GNUNET_NO == GC_is_pid_bigger (pid, fc->last_pid_recv))
{
GNUNET_STATISTICS_update (stats, "# duplicate PID", 1, GNUNET_NO);
- LOG (GNUNET_ERROR_TYPE_DEBUG,
+ LOG (GNUNET_ERROR_TYPE_WARNING,
" PID %u not expected (%u+), dropping!\n",
pid, fc->last_pid_recv + 1);
return GNUNET_OK;
Modified: gnunet/src/cadet/gnunet-service-cadet_peer.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_peer.c 2014-12-15 07:18:12 UTC
(rev 34604)
+++ gnunet/src/cadet/gnunet-service-cadet_peer.c 2014-12-15 07:18:13 UTC
(rev 34605)
@@ -966,23 +966,23 @@
* @param queue Queue element for the message.
* @param buf Core buffer to fill.
* @param size Size remaining in @c buf.
+ * @param[out] pid In case its an encrypted payload, set payload.
*
* @return Bytes written to @c buf.
*/
static size_t
-fill_buf (struct CadetPeerQueue *queue, void *buf, size_t size)
+fill_buf (struct CadetPeerQueue *queue, void *buf, size_t size, uint32_t *pid)
{
struct CadetConnection *c = queue->c;
- uint32_t pid;
size_t msg_size;
switch (queue->type)
{
case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED:
- pid = GCC_get_pid (queue->c, queue->fwd);
- LOG (GNUNET_ERROR_TYPE_DEBUG, " payload ID %u\n", pid);
+ *pid = GCC_get_pid (queue->c, queue->fwd);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " payload ID %u\n", *pid);
msg_size = send_core_data_raw (queue->cls, size, buf);
- ((struct GNUNET_CADET_Encrypted *) buf)->pid = htonl (pid);
+ ((struct GNUNET_CADET_Encrypted *) buf)->pid = htonl (*pid);
break;
case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_DESTROY:
case GNUNET_MESSAGE_TYPE_CADET_CONNECTION_BROKEN:
@@ -1095,7 +1095,7 @@
LOG (GNUNET_ERROR_TYPE_DEBUG, " size %u ok (%u/%u)\n",
queue->size, total_size, size);
- msg_size = fill_buf (queue, (void *) dst, size);
+ msg_size = fill_buf (queue, (void *) dst, size, &pid);
if (0 < drop_percent &&
GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 101) <
drop_percent)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r34605 - gnunet/src/cadet,
gnunet <=