aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-10-19 11:42:17 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-10-19 11:42:17 +0000
commit98d9b3a2eed2893dd2f5db717d49bbb7bd72e170 (patch)
treea86cfc0b666dc5e7db9197f785f1f4465a293817 /src
parent516e7a65d004bba19fe6df1ec6c64f8792a3e4bd (diff)
downloadgnunet-98d9b3a2eed2893dd2f5db717d49bbb7bd72e170.tar.gz
gnunet-98d9b3a2eed2893dd2f5db717d49bbb7bd72e170.zip
coverity
Diffstat (limited to 'src')
-rw-r--r--src/transport/plugin_transport_udp.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index c456bd461..3f9738055 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -780,6 +780,9 @@ call_continuation (struct UDP_MessageWrapper *udpw, int result)
780 GNUNET_STATISTICS_update (plugin->env->stats, 780 GNUNET_STATISTICS_update (plugin->env->stats,
781 "# UDP, fragmented msgs, fragments bytes, sent, success", 781 "# UDP, fragmented msgs, fragments bytes, sent, success",
782 udpw->msg_size, GNUNET_NO); 782 udpw->msg_size, GNUNET_NO);
783 GNUNET_STATISTICS_update (plugin->env->stats,
784 "# UDP, fragmented msgs, messages, pending",
785 -1, GNUNET_NO);
783 break; 786 break;
784 case MSG_ACK: 787 case MSG_ACK:
785 /* No continuation */ 788 /* No continuation */
@@ -842,6 +845,7 @@ call_continuation (struct UDP_MessageWrapper *udpw, int result)
842 GNUNET_STATISTICS_update (plugin->env->stats, 845 GNUNET_STATISTICS_update (plugin->env->stats,
843 "# UDP, fragmented msgs, fragments bytes, sent, failure", 846 "# UDP, fragmented msgs, fragments bytes, sent, failure",
844 udpw->msg_size, GNUNET_NO); 847 udpw->msg_size, GNUNET_NO);
848
845 break; 849 break;
846 case MSG_ACK: 850 case MSG_ACK:
847 /* ACK message: failed to send */ 851 /* ACK message: failed to send */
@@ -2159,22 +2163,31 @@ remove_timeout_messages_and_select (struct UDP_MessageWrapper *head,
2159 { 2163 {
2160 /* Message timed out */ 2164 /* Message timed out */
2161 call_continuation (udpw, GNUNET_SYSERR); 2165 call_continuation (udpw, GNUNET_SYSERR);
2162 if (NULL == udpw->frag_ctx) 2166 switch (udpw->msg_type) {
2163 { 2167 case MSG_UNFRAGMENTED:
2164 /* Not fragmented message */ 2168 /* Not fragmented message */
2165 LOG (GNUNET_ERROR_TYPE_DEBUG, 2169 LOG (GNUNET_ERROR_TYPE_DEBUG,
2166 "Message for peer `%s' with size %u timed out\n", 2170 "Message for peer `%s' with size %u timed out\n",
2167 GNUNET_i2s(&udpw->session->target), udpw->payload_size); 2171 GNUNET_i2s(&udpw->session->target), udpw->payload_size);
2168 } 2172 break;
2169 else 2173 case MSG_FRAGMENTED:
2170 {
2171 /* Fragmented message */ 2174 /* Fragmented message */
2175 call_continuation (udpw, GNUNET_SYSERR);
2172 LOG (GNUNET_ERROR_TYPE_DEBUG, 2176 LOG (GNUNET_ERROR_TYPE_DEBUG,
2173 "Fragment for message for peer `%s' with size %u timed out\n", 2177 "Fragment for message for peer `%s' with size %u timed out\n",
2174 GNUNET_i2s(&udpw->session->target), udpw->frag_ctx->payload_size); 2178 GNUNET_i2s(&udpw->session->target), udpw->frag_ctx->payload_size);
2175 udpw->session->last_expected_delay = GNUNET_FRAGMENT_context_destroy (udpw->frag_ctx->frag); 2179 udpw->session->last_expected_delay = GNUNET_FRAGMENT_context_destroy (udpw->frag_ctx->frag);
2176 GNUNET_free (udpw->frag_ctx); 2180 GNUNET_free (udpw->frag_ctx);
2177 udpw->session->frag_ctx = NULL; 2181 udpw->session->frag_ctx = NULL;
2182
2183 break;
2184 case MSG_ACK:
2185 LOG (GNUNET_ERROR_TYPE_DEBUG,
2186 "ACK Message for peer `%s' with size %u timed out\n",
2187 GNUNET_i2s(&udpw->session->target), udpw->payload_size);
2188 break;
2189 default:
2190 break;
2178 } 2191 }
2179 2192
2180 GNUNET_STATISTICS_update (plugin->env->stats, 2193 GNUNET_STATISTICS_update (plugin->env->stats,