aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_peer.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-18 11:43:09 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-18 11:43:09 +0100
commit965d792189fa54bc9423f643cd8dccb681632b41 (patch)
tree7a7b72c753deaf7adc20951a046b4cde9c5e69d5 /src/cadet/gnunet-service-cadet_peer.c
parenta1bd2dcc29c126023dbd1ddf83d7514859d1775b (diff)
downloadgnunet-965d792189fa54bc9423f643cd8dccb681632b41.tar.gz
gnunet-965d792189fa54bc9423f643cd8dccb681632b41.zip
introduce CadetEncryptedMessageIdentifier instead of over-using uint32_t
Diffstat (limited to 'src/cadet/gnunet-service-cadet_peer.c')
-rw-r--r--src/cadet/gnunet-service-cadet_peer.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c
index 2c2c552c6..2b11040a5 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -103,9 +103,9 @@ struct CadetPeerQueue {
103 uint16_t payload_type; 103 uint16_t payload_type;
104 104
105 /** 105 /**
106 *ID of the payload (PID, ACK #, ...). 106 * ID of the payload (PID, ACK #, ...).
107 */ 107 */
108 uint16_t payload_id; 108 struct CadetEncryptedMessageIdentifier payload_id;
109 109
110 /** 110 /**
111 * Connection this message was sent on. 111 * Connection this message was sent on.
@@ -1110,7 +1110,9 @@ call_peer_cont (struct CadetPeerQueue *q, int sent)
1110 GNUNET_STRINGS_relative_time_to_string (wait_time, GNUNET_NO)); 1110 GNUNET_STRINGS_relative_time_to_string (wait_time, GNUNET_NO));
1111 q->cont (q->cont_cls, 1111 q->cont (q->cont_cls,
1112 q->c, q->c_fwd, sent, 1112 q->c, q->c_fwd, sent,
1113 q->type, q->payload_type, q->payload_id, 1113 q->type,
1114 q->payload_type,
1115 q->payload_id,
1114 q->size, wait_time); 1116 q->size, wait_time);
1115 q->cont = NULL; 1117 q->cont = NULL;
1116 } 1118 }
@@ -1173,7 +1175,7 @@ struct CadetPeerQueue *
1173GCP_send (struct CadetPeer *peer, 1175GCP_send (struct CadetPeer *peer,
1174 const struct GNUNET_MessageHeader *message, 1176 const struct GNUNET_MessageHeader *message,
1175 uint16_t payload_type, 1177 uint16_t payload_type,
1176 uint32_t payload_id, 1178 struct CadetEncryptedMessageIdentifier payload_id,
1177 struct CadetConnection *c, 1179 struct CadetConnection *c,
1178 int fwd, 1180 int fwd,
1179 GCP_sent cont, 1181 GCP_sent cont,
@@ -1188,7 +1190,8 @@ GCP_send (struct CadetPeer *peer,
1188 size = ntohs (message->size); 1190 size = ntohs (message->size);
1189 LOG (GNUNET_ERROR_TYPE_DEBUG, 1191 LOG (GNUNET_ERROR_TYPE_DEBUG,
1190 "que %s (%s %4u) on conn %s (%p) %s towards %s (size %u)\n", 1192 "que %s (%s %4u) on conn %s (%p) %s towards %s (size %u)\n",
1191 GC_m2s (type), GC_m2s (payload_type), payload_id, 1193 GC_m2s (type), GC_m2s (payload_type),
1194 ntohl (payload_id.pid),
1192 GCC_2s (c), c, GC_f2s (fwd), GCP_2s (peer), size); 1195 GCC_2s (c), c, GC_f2s (fwd), GCP_2s (peer), size);
1193 1196
1194 if (NULL == peer->connections) 1197 if (NULL == peer->connections)
@@ -1227,8 +1230,11 @@ GCP_send (struct CadetPeer *peer,
1227 { 1230 {
1228 LOG (GNUNET_ERROR_TYPE_WARNING, 1231 LOG (GNUNET_ERROR_TYPE_WARNING,
1229 "DD %s (%s %u) on conn %s %s (random drop for testing)\n", 1232 "DD %s (%s %u) on conn %s %s (random drop for testing)\n",
1230 GC_m2s (q->type), GC_m2s (q->payload_type), 1233 GC_m2s (q->type),
1231 q->payload_id, GCC_2s (c), GC_f2s (q->c_fwd)); 1234 GC_m2s (q->payload_type),
1235 ntohl (q->payload_id.pid),
1236 GCC_2s (c),
1237 GC_f2s (q->c_fwd));
1232 q->drop_task = GNUNET_SCHEDULER_add_now (&drop_cb, 1238 q->drop_task = GNUNET_SCHEDULER_add_now (&drop_cb,
1233 q); 1239 q);
1234 return q; 1240 return q;