aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-02-14 22:56:35 +0000
committerChristian Grothoff <christian@grothoff.org>2010-02-14 22:56:35 +0000
commit56c6242f0937451f47ae03f91b3bc6adc599592d (patch)
treefb61e56fc175bc346b0d31bc9371d9a4239be6bd
parent3e2673ea17900dc4f078bb8b147678ca66e783d7 (diff)
downloadgnunet-56c6242f0937451f47ae03f91b3bc6adc599592d.tar.gz
gnunet-56c6242f0937451f47ae03f91b3bc6adc599592d.zip
fixing non-terminating loop
-rw-r--r--src/transport/plugin_transport_tcp.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index c302971cb..76c9b6df0 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -572,7 +572,7 @@ disconnect_session (struct Session *session)
572static ssize_t 572static ssize_t
573tcp_plugin_send (void *cls, 573tcp_plugin_send (void *cls,
574 const struct GNUNET_PeerIdentity *target, 574 const struct GNUNET_PeerIdentity *target,
575 char *msg, 575 const char *msg,
576 size_t msgbuf_size, 576 size_t msgbuf_size,
577 uint32_t priority, 577 uint32_t priority,
578 struct GNUNET_TIME_Relative timeout, 578 struct GNUNET_TIME_Relative timeout,
@@ -722,23 +722,30 @@ tcp_plugin_disconnect (void *cls, const struct GNUNET_PeerIdentity *target)
722 "Asked to cancel session with `%4s'\n", 722 "Asked to cancel session with `%4s'\n",
723 GNUNET_i2s (target)); 723 GNUNET_i2s (target));
724#endif 724#endif
725 while (NULL != (session = find_session_by_target (plugin, target))) 725 session = plugin->sessions;
726 while (NULL != session)
726 { 727 {
727 pm = session->pending_messages; 728 if (0 == memcmp (target,
728 while (pm != NULL) 729 &session->target,
730 sizeof (struct GNUNET_PeerIdentity)))
729 { 731 {
730 pm->transmit_cont = NULL; 732 pm = session->pending_messages;
731 pm->transmit_cont_cls = NULL; 733 while (pm != NULL)
732 pm = pm->next; 734 {
735 pm->transmit_cont = NULL;
736 pm->transmit_cont_cls = NULL;
737 pm = pm->next;
738 }
739 if (session->client != NULL)
740 {
741 GNUNET_SERVER_client_drop (session->client);
742 session->client = NULL;
743 }
744 /* rest of the clean-up of the session will be done as part of
745 disconnect_notify which should be triggered any time now
746 (or which may be triggering this call in the first place) */
733 } 747 }
734 if (session->client != NULL) 748 session = session->next;
735 {
736 GNUNET_SERVER_client_drop (session->client);
737 session->client = NULL;
738 }
739 /* rest of the clean-up of the session will be done as part of
740 disconnect_notify which should be triggered any time now
741 (or which may be triggering this call in the first place) */
742 } 749 }
743} 750}
744 751