aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2016-11-04 09:47:18 +0000
committerBart Polot <bart@net.in.tum.de>2016-11-04 09:47:18 +0000
commit4b982bd8f236ae5d6f229a7038bcbe3198a1408a (patch)
tree0f2c8e696386f728efd2f301acc3141b2df744e3 /src
parentc45150e1f9f90dc9bc56c4fb008ae7b24ab65499 (diff)
downloadgnunet-4b982bd8f236ae5d6f229a7038bcbe3198a1408a.tar.gz
gnunet-4b982bd8f236ae5d6f229a7038bcbe3198a1408a.zip
- always return a queue handle
Diffstat (limited to 'src')
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c56
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c4
2 files changed, 26 insertions, 34 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 533372efa..bdf208a1a 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -1083,9 +1083,8 @@ send_broken (struct CadetConnection *c,
1083 msg.reserved = htonl (0); 1083 msg.reserved = htonl (0);
1084 msg.peer1 = *id1; 1084 msg.peer1 = *id1;
1085 msg.peer2 = *id2; 1085 msg.peer2 = *id2;
1086 GNUNET_assert (NULL == 1086 (void) GCC_send_prebuilt_message (&msg.header, UINT16_MAX, 0, c, fwd,
1087 GCC_send_prebuilt_message (&msg.header, UINT16_MAX, 0, c, fwd, 1087 GNUNET_YES, NULL, NULL);
1088 GNUNET_YES, NULL, NULL));
1089 GCC_check_connections (); 1088 GCC_check_connections ();
1090} 1089}
1091 1090
@@ -2044,14 +2043,11 @@ GCC_handle_create (struct CadetPeer *peer,
2044 } 2043 }
2045 else 2044 else
2046 { 2045 {
2047 /* It's for somebody else! Retransmit. */ 2046 LOG (GNUNET_ERROR_TYPE_DEBUG, " not for us, retransmitting...\n");
2048 LOG (GNUNET_ERROR_TYPE_DEBUG, " Retransmitting.\n");
2049 GCP_add_path (dest_peer, path_duplicate (path), GNUNET_NO); 2047 GCP_add_path (dest_peer, path_duplicate (path), GNUNET_NO);
2050 GCP_add_path_to_origin (orig_peer, path_duplicate (path), GNUNET_NO); 2048 GCP_add_path_to_origin (orig_peer, path_duplicate (path), GNUNET_NO);
2051 GNUNET_assert (NULL == 2049 (void) GCC_send_prebuilt_message (&msg->header, 0, 0, c,
2052 GCC_send_prebuilt_message (&msg->header, 0, 0, c, 2050 GNUNET_YES, GNUNET_YES, NULL, NULL);
2053 GNUNET_YES, GNUNET_YES,
2054 NULL, NULL));
2055 } 2051 }
2056 path_destroy (path); 2052 path_destroy (path);
2057 GCC_check_connections (); 2053 GCC_check_connections ();
@@ -2171,13 +2167,13 @@ GCC_handle_confirm (struct CadetPeer *peer,
2171 if (CADET_TUNNEL_WAITING == GCT_get_cstate (c->t)) 2167 if (CADET_TUNNEL_WAITING == GCT_get_cstate (c->t))
2172 GCT_change_cstate (c->t, CADET_TUNNEL_READY); 2168 GCT_change_cstate (c->t, CADET_TUNNEL_READY);
2173 GCC_check_connections (); 2169 GCC_check_connections ();
2174 return;
2175 } 2170 }
2176 2171 else
2177 LOG (GNUNET_ERROR_TYPE_DEBUG, " not for us, retransmitting...\n"); 2172 {
2178 GNUNET_assert (NULL == 2173 LOG (GNUNET_ERROR_TYPE_DEBUG, " not for us, retransmitting...\n");
2179 GCC_send_prebuilt_message (&msg->header, 0, 0, c, fwd, 2174 (void) GCC_send_prebuilt_message (&msg->header, 0, 0, c, fwd,
2180 GNUNET_YES, NULL, NULL)); 2175 GNUNET_YES, NULL, NULL);
2176 }
2181 GCC_check_connections (); 2177 GCC_check_connections ();
2182} 2178}
2183 2179
@@ -2244,9 +2240,8 @@ GCC_handle_broken (struct CadetPeer *peer,
2244 } 2240 }
2245 else 2241 else
2246 { 2242 {
2247 GNUNET_assert (NULL == 2243 (void) GCC_send_prebuilt_message (&msg->header, 0, 0, c, fwd,
2248 GCC_send_prebuilt_message (&msg->header, 0, 0, c, fwd, 2244 GNUNET_YES, NULL, NULL);
2249 GNUNET_YES, NULL, NULL));
2250 connection_cancel_queues (c, !fwd); 2245 connection_cancel_queues (c, !fwd);
2251 } 2246 }
2252 GCC_check_connections (); 2247 GCC_check_connections ();
@@ -2295,9 +2290,8 @@ GCC_handle_destroy (struct CadetPeer *peer,
2295 2290
2296 if (GNUNET_NO == GCC_is_terminal (c, fwd)) 2291 if (GNUNET_NO == GCC_is_terminal (c, fwd))
2297 { 2292 {
2298 GNUNET_assert (NULL == 2293 (void) GCC_send_prebuilt_message (&msg->header, 0, 0, c, fwd,
2299 GCC_send_prebuilt_message (&msg->header, 0, 0, c, fwd, 2294 GNUNET_YES, NULL, NULL);
2300 GNUNET_YES, NULL, NULL));
2301 } 2295 }
2302 else if (0 == c->pending_messages) 2296 else if (0 == c->pending_messages)
2303 { 2297 {
@@ -2618,8 +2612,8 @@ GCC_handle_kx (struct CadetPeer *peer,
2618 /* Message not for us: forward to next hop */ 2612 /* Message not for us: forward to next hop */
2619 LOG (GNUNET_ERROR_TYPE_DEBUG, " not for us, retransmitting...\n"); 2613 LOG (GNUNET_ERROR_TYPE_DEBUG, " not for us, retransmitting...\n");
2620 GNUNET_STATISTICS_update (stats, "# messages forwarded", 1, GNUNET_NO); 2614 GNUNET_STATISTICS_update (stats, "# messages forwarded", 1, GNUNET_NO);
2621 GNUNET_assert (NULL == GCC_send_prebuilt_message (&msg->header, 0, 0, c, fwd, 2615 (void) GCC_send_prebuilt_message (&msg->header, 0, 0, c, fwd,
2622 GNUNET_NO, NULL, NULL)); 2616 GNUNET_NO, NULL, NULL);
2623 GCC_check_connections (); 2617 GCC_check_connections ();
2624} 2618}
2625 2619
@@ -2678,8 +2672,8 @@ GCC_handle_encrypted (struct CadetPeer *peer,
2678 /* Message not for us: forward to next hop */ 2672 /* Message not for us: forward to next hop */
2679 LOG (GNUNET_ERROR_TYPE_DEBUG, " not for us, retransmitting...\n"); 2673 LOG (GNUNET_ERROR_TYPE_DEBUG, " not for us, retransmitting...\n");
2680 GNUNET_STATISTICS_update (stats, "# messages forwarded", 1, GNUNET_NO); 2674 GNUNET_STATISTICS_update (stats, "# messages forwarded", 1, GNUNET_NO);
2681 GNUNET_assert (NULL == GCC_send_prebuilt_message (&msg->header, 0, 0, c, fwd, 2675 (void) GCC_send_prebuilt_message (&msg->header, 0, 0, c, fwd,
2682 GNUNET_NO, NULL, NULL)); 2676 GNUNET_NO, NULL, NULL);
2683 GCC_check_connections (); 2677 GCC_check_connections ();
2684} 2678}
2685 2679
@@ -3342,7 +3336,7 @@ GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
3342 q->cont_cls = cont_cls; 3336 q->cont_cls = cont_cls;
3343 GNUNET_CONTAINER_DLL_insert (fc->q_head, fc->q_tail, q); 3337 GNUNET_CONTAINER_DLL_insert (fc->q_head, fc->q_tail, q);
3344 GCC_check_connections (); 3338 GCC_check_connections ();
3345 return (NULL == cont) ? NULL : q; 3339 return q;
3346} 3340}
3347 3341
3348 3342
@@ -3511,13 +3505,11 @@ GCC_send_destroy (struct CadetConnection *c)
3511 GCC_2s (c)); 3505 GCC_2s (c));
3512 3506
3513 if (GNUNET_NO == GCC_is_terminal (c, GNUNET_YES)) 3507 if (GNUNET_NO == GCC_is_terminal (c, GNUNET_YES))
3514 GNUNET_assert (NULL == GCC_send_prebuilt_message (&msg.header, UINT16_MAX, 3508 (void) GCC_send_prebuilt_message (&msg.header, UINT16_MAX, 0, c,
3515 0, c, GNUNET_YES, 3509 GNUNET_YES, GNUNET_YES, NULL, NULL);
3516 GNUNET_YES, NULL, NULL));
3517 if (GNUNET_NO == GCC_is_terminal (c, GNUNET_NO)) 3510 if (GNUNET_NO == GCC_is_terminal (c, GNUNET_NO))
3518 GNUNET_assert (NULL == GCC_send_prebuilt_message (&msg.header, UINT16_MAX, 3511 (void) GCC_send_prebuilt_message (&msg.header, UINT16_MAX, 0, c,
3519 0, c, GNUNET_NO, 3512 GNUNET_NO, GNUNET_YES, NULL, NULL);
3520 GNUNET_YES, NULL, NULL));
3521 mark_destroyed (c); 3513 mark_destroyed (c);
3522 GCC_check_connections (); 3514 GCC_check_connections ();
3523} 3515}
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index 9934a856f..a19c1523e 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -1416,8 +1416,8 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message,
1416 1416
1417 if (NULL == cont) 1417 if (NULL == cont)
1418 { 1418 {
1419 GNUNET_break (NULL == GCC_send_prebuilt_message (msg, type, mid, c, fwd, 1419 (void) GCC_send_prebuilt_message (msg, type, mid, c, fwd,
1420 force, NULL, NULL)); 1420 force, NULL, NULL);
1421 return NULL; 1421 return NULL;
1422 } 1422 }
1423 if (NULL == existing_q) 1423 if (NULL == existing_q)