aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_connection.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-09 07:10:37 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-09 07:10:37 +0100
commitdaf0c12b555bc2baf59b97a7279a8f3f5db16511 (patch)
tree258fdfe960affac59f3cdecf807d6679df20dfc2 /src/cadet/gnunet-service-cadet_connection.c
parent73b0f06dd9112163e4a1f89f3218ff0ecddbcd76 (diff)
downloadgnunet-daf0c12b555bc2baf59b97a7279a8f3f5db16511.tar.gz
gnunet-daf0c12b555bc2baf59b97a7279a8f3f5db16511.zip
fix crashes caused by DLL removes preceeding DLL inserts
Diffstat (limited to 'src/cadet/gnunet-service-cadet_connection.c')
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 1c500f716..fa2bb962b 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -685,7 +685,7 @@ conn_message_sent (void *cls,
685 LOG (GNUNET_ERROR_TYPE_INFO, 685 LOG (GNUNET_ERROR_TYPE_INFO,
686 ">>> %s (%s %4u) on conn %s (%p) %s [%5u] in queue %s\n", 686 ">>> %s (%s %4u) on conn %s (%p) %s [%5u] in queue %s\n",
687 GC_m2s (type), GC_m2s (payload_type), pid, GCC_2s (c), c, 687 GC_m2s (type), GC_m2s (payload_type), pid, GCC_2s (c), c,
688 GC_f2s(fwd), size, 688 GC_f2s (fwd), size,
689 GNUNET_STRINGS_relative_time_to_string (wait, GNUNET_YES)); 689 GNUNET_STRINGS_relative_time_to_string (wait, GNUNET_YES));
690 690
691 /* If c is NULL, nothing to update. */ 691 /* If c is NULL, nothing to update. */
@@ -3264,7 +3264,10 @@ GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
3264 c->pending_messages++; 3264 c->pending_messages++;
3265 3265
3266 q = GNUNET_new (struct CadetConnectionQueue); 3266 q = GNUNET_new (struct CadetConnectionQueue);
3267 q->cont = cont;
3268 q->cont_cls = cont_cls;
3267 q->forced = force; 3269 q->forced = force;
3270 GNUNET_CONTAINER_DLL_insert (fc->q_head, fc->q_tail, q);
3268 q->peer_q = GCP_send (get_hop (c, fwd), message, 3271 q->peer_q = GCP_send (get_hop (c, fwd), message,
3269 payload_type, payload_id, 3272 payload_type, payload_id,
3270 c, fwd, 3273 c, fwd,
@@ -3272,13 +3275,11 @@ GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
3272 if (NULL == q->peer_q) 3275 if (NULL == q->peer_q)
3273 { 3276 {
3274 LOG (GNUNET_ERROR_TYPE_DEBUG, "dropping msg on %s, NULL q\n", GCC_2s (c)); 3277 LOG (GNUNET_ERROR_TYPE_DEBUG, "dropping msg on %s, NULL q\n", GCC_2s (c));
3278 GNUNET_CONTAINER_DLL_remove (fc->q_head, fc->q_tail, q);
3275 GNUNET_free (q); 3279 GNUNET_free (q);
3276 GCC_check_connections (); 3280 GCC_check_connections ();
3277 return NULL; 3281 return NULL;
3278 } 3282 }
3279 q->cont = cont;
3280 q->cont_cls = cont_cls;
3281 GNUNET_CONTAINER_DLL_insert (fc->q_head, fc->q_tail, q);
3282 GCC_check_connections (); 3283 GCC_check_connections ();
3283 return q; 3284 return q;
3284} 3285}