diff options
-rw-r--r-- | src/transport/gnunet-service-transport.c | 7 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 13 | ||||
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 10 |
3 files changed, 19 insertions, 11 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 0a56c85a1..5bde153e4 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -243,6 +243,13 @@ plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
243 | 243 | ||
244 | GNUNET_free (im); | 244 | GNUNET_free (im); |
245 | } | 245 | } |
246 | else | ||
247 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
248 | _("Discarded %u bytes of type %u from %s via plugin %s: connection is down!\n"), | ||
249 | ntohs (message->size), | ||
250 | type, | ||
251 | GNUNET_i2s (peer), | ||
252 | plugin_name); | ||
246 | break; | 253 | break; |
247 | } | 254 | } |
248 | } | 255 | } |
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 3dc707923..9676366a6 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -798,9 +798,6 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
798 | 798 | ||
799 | if (GNUNET_YES != n->is_connected) | 799 | if (GNUNET_YES != n->is_connected) |
800 | return; /* not connected anymore anyway, shouldn't matter */ | 800 | return; /* not connected anymore anyway, shouldn't matter */ |
801 | |||
802 | //n->is_connected = GNUNET_NO; | ||
803 | |||
804 | /* fast disconnect unless ATS suggests a new address */ | 801 | /* fast disconnect unless ATS suggests a new address */ |
805 | GNUNET_SCHEDULER_cancel (n->timeout_task); | 802 | GNUNET_SCHEDULER_cancel (n->timeout_task); |
806 | n->timeout_task = | 803 | n->timeout_task = |
@@ -869,8 +866,6 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg, | |||
869 | cont (cont_cls, GNUNET_SYSERR); | 866 | cont (cont_cls, GNUNET_SYSERR); |
870 | return; | 867 | return; |
871 | } | 868 | } |
872 | |||
873 | |||
874 | GNUNET_assert (msg_size >= sizeof (struct GNUNET_MessageHeader)); | 869 | GNUNET_assert (msg_size >= sizeof (struct GNUNET_MessageHeader)); |
875 | GNUNET_STATISTICS_update (GST_stats, | 870 | GNUNET_STATISTICS_update (GST_stats, |
876 | gettext_noop | 871 | gettext_noop |
@@ -917,6 +912,14 @@ GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity | |||
917 | *do_forward = GNUNET_NO; | 912 | *do_forward = GNUNET_NO; |
918 | return GNUNET_TIME_UNIT_ZERO; | 913 | return GNUNET_TIME_UNIT_ZERO; |
919 | } | 914 | } |
915 | if (GNUNET_YES != n->is_connected) | ||
916 | { | ||
917 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
918 | _("Plugin gave us %d bytes of data but somehow the session is not marked as UP yet!\n"), | ||
919 | (int) size); | ||
920 | *do_forward = GNUNET_NO; | ||
921 | return GNUNET_TIME_UNIT_ZERO; | ||
922 | } | ||
920 | if (GNUNET_YES == GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, size)) | 923 | if (GNUNET_YES == GNUNET_BANDWIDTH_tracker_consume (&n->in_tracker, size)) |
921 | { | 924 | { |
922 | n->quota_violation_count++; | 925 | n->quota_violation_count++; |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 8856b9262..d3391e1b2 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -701,7 +701,7 @@ do_transmit (void *cls, size_t size, void *buf) | |||
701 | cbuf += pos->message_size; | 701 | cbuf += pos->message_size; |
702 | ret += pos->message_size; | 702 | ret += pos->message_size; |
703 | size -= pos->message_size; | 703 | size -= pos->message_size; |
704 | GNUNET_CONTAINER_DLL_insert_after (hd, tl, tl, pos); | 704 | GNUNET_CONTAINER_DLL_insert_tail (hd, tl, pos); |
705 | } | 705 | } |
706 | /* schedule 'continuation' before callbacks so that callbacks that | 706 | /* schedule 'continuation' before callbacks so that callbacks that |
707 | * cancel everything don't cause us to use a session that no longer | 707 | * cancel everything don't cause us to use a session that no longer |
@@ -1066,8 +1066,7 @@ tcp_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, | |||
1066 | pm->transmit_cont_cls = cont_cls; | 1066 | pm->transmit_cont_cls = cont_cls; |
1067 | 1067 | ||
1068 | /* append pm to pending_messages list */ | 1068 | /* append pm to pending_messages list */ |
1069 | GNUNET_CONTAINER_DLL_insert_after (session->pending_messages_head, | 1069 | GNUNET_CONTAINER_DLL_insert_tail (session->pending_messages_head, |
1070 | session->pending_messages_tail, | ||
1071 | session->pending_messages_tail, pm); | 1070 | session->pending_messages_tail, pm); |
1072 | 1071 | ||
1073 | GNUNET_assert (GNUNET_CONTAINER_multihashmap_put | 1072 | GNUNET_assert (GNUNET_CONTAINER_multihashmap_put |
@@ -1151,9 +1150,8 @@ tcp_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, | |||
1151 | pm->transmit_cont_cls = cont_cls; | 1150 | pm->transmit_cont_cls = cont_cls; |
1152 | 1151 | ||
1153 | /* append pm to pending_messages list */ | 1152 | /* append pm to pending_messages list */ |
1154 | GNUNET_CONTAINER_DLL_insert_after (session->pending_messages_head, | 1153 | GNUNET_CONTAINER_DLL_insert_tail (session->pending_messages_head, |
1155 | session->pending_messages_tail, | 1154 | session->pending_messages_tail, pm); |
1156 | session->pending_messages_tail, pm); | ||
1157 | #if DEBUG_TCP | 1155 | #if DEBUG_TCP |
1158 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", | 1156 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "tcp", |
1159 | "Asked to transmit %u bytes to `%s', added message to list.\n", | 1157 | "Asked to transmit %u bytes to `%s', added message to list.\n", |