diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-07-21 00:15:32 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-07-21 00:15:32 +0000 |
commit | aa4d05250b7150dae8ba8f1225e12c17f69b4b42 (patch) | |
tree | d99085c5a7434673569ba6e8506b12f349d46d58 /src/cadet | |
parent | 50da4d6aef9b3ca75fce5e4a6091f563b62c2ff3 (diff) | |
download | gnunet-aa4d05250b7150dae8ba8f1225e12c17f69b4b42.tar.gz gnunet-aa4d05250b7150dae8ba8f1225e12c17f69b4b42.zip |
Force sending of KX messages even when connection queue is full
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/gnunet-service-cadet_peer.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 11b3fc9a8..e07aebd2f 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c | |||
@@ -1208,7 +1208,7 @@ GCP_queue_add (struct CadetPeer *peer, void *cls, uint16_t type, | |||
1208 | struct CadetConnection *c, int fwd, | 1208 | struct CadetConnection *c, int fwd, |
1209 | GCP_sent cont, void *cont_cls) | 1209 | GCP_sent cont, void *cont_cls) |
1210 | { | 1210 | { |
1211 | struct CadetPeerQueue *queue; | 1211 | struct CadetPeerQueue *q; |
1212 | int error_level; | 1212 | int error_level; |
1213 | int priority; | 1213 | int priority; |
1214 | int call_core; | 1214 | int call_core; |
@@ -1243,26 +1243,27 @@ GCP_queue_add (struct CadetPeer *peer, void *cls, uint16_t type, | |||
1243 | 1243 | ||
1244 | LOG (GNUNET_ERROR_TYPE_DEBUG, "priority %d\n", priority); | 1244 | LOG (GNUNET_ERROR_TYPE_DEBUG, "priority %d\n", priority); |
1245 | 1245 | ||
1246 | call_core = NULL == c ? GNUNET_YES : GCC_is_sendable (c, fwd); | 1246 | call_core = (NULL == c || type == GNUNET_MESSAGE_TYPE_CADET_KX) ? |
1247 | queue = GNUNET_new (struct CadetPeerQueue); | 1247 | GNUNET_YES : GCC_is_sendable (c, fwd); |
1248 | queue->cls = cls; | 1248 | q = GNUNET_new (struct CadetPeerQueue); |
1249 | queue->type = type; | 1249 | q->cls = cls; |
1250 | queue->payload_type = payload_type; | 1250 | q->type = type; |
1251 | queue->payload_id = payload_id; | 1251 | q->payload_type = payload_type; |
1252 | queue->size = size; | 1252 | q->payload_id = payload_id; |
1253 | queue->peer = peer; | 1253 | q->size = size; |
1254 | queue->c = c; | 1254 | q->peer = peer; |
1255 | queue->fwd = fwd; | 1255 | q->c = c; |
1256 | queue->callback = cont; | 1256 | q->fwd = fwd; |
1257 | queue->callback_cls = cont_cls; | 1257 | q->callback = cont; |
1258 | q->callback_cls = cont_cls; | ||
1258 | if (100 > priority) | 1259 | if (100 > priority) |
1259 | { | 1260 | { |
1260 | GNUNET_CONTAINER_DLL_insert_tail (peer->queue_head, peer->queue_tail, queue); | 1261 | GNUNET_CONTAINER_DLL_insert_tail (peer->queue_head, peer->queue_tail, q); |
1261 | peer->queue_n++; | 1262 | peer->queue_n++; |
1262 | } | 1263 | } |
1263 | else | 1264 | else |
1264 | { | 1265 | { |
1265 | GNUNET_CONTAINER_DLL_insert (peer->queue_head, peer->queue_tail, queue); | 1266 | GNUNET_CONTAINER_DLL_insert (peer->queue_head, peer->queue_tail, q); |
1266 | call_core = GNUNET_YES; | 1267 | call_core = GNUNET_YES; |
1267 | } | 1268 | } |
1268 | 1269 | ||
@@ -1273,13 +1274,11 @@ GCP_queue_add (struct CadetPeer *peer, void *cls, uint16_t type, | |||
1273 | GCP_2s (peer), size); | 1274 | GCP_2s (peer), size); |
1274 | peer->core_transmit = | 1275 | peer->core_transmit = |
1275 | GNUNET_CORE_notify_transmit_ready (core_handle, | 1276 | GNUNET_CORE_notify_transmit_ready (core_handle, |
1276 | GNUNET_NO, get_priority (queue), | 1277 | GNUNET_NO, get_priority (q), |
1277 | GNUNET_TIME_UNIT_FOREVER_REL, | 1278 | GNUNET_TIME_UNIT_FOREVER_REL, |
1278 | GNUNET_PEER_resolve2 (peer->id), | 1279 | GNUNET_PEER_resolve2 (peer->id), |
1279 | size, | 1280 | size, &queue_send, peer); |
1280 | &queue_send, | 1281 | q->start_waiting = GNUNET_TIME_absolute_get (); |
1281 | peer); | ||
1282 | queue->start_waiting = GNUNET_TIME_absolute_get (); | ||
1283 | } | 1282 | } |
1284 | else if (GNUNET_NO == call_core) | 1283 | else if (GNUNET_NO == call_core) |
1285 | { | 1284 | { |
@@ -1294,7 +1293,7 @@ GCP_queue_add (struct CadetPeer *peer, void *cls, uint16_t type, | |||
1294 | 1293 | ||
1295 | } | 1294 | } |
1296 | queue_debug (peer, GNUNET_ERROR_TYPE_DEBUG); | 1295 | queue_debug (peer, GNUNET_ERROR_TYPE_DEBUG); |
1297 | return queue; | 1296 | return q; |
1298 | } | 1297 | } |
1299 | 1298 | ||
1300 | 1299 | ||