diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-23 15:01:43 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-23 15:01:43 +0000 |
commit | 1fdeba9daed312148ce1f92f688bf15971a1903d (patch) | |
tree | d708b60c1552f1e8b1a2b5b91925d040575f0d68 /src/transport | |
parent | e8bd1e4c796bb51ed94817c1b5f69197dbfcfcbc (diff) | |
download | gnunet-1fdeba9daed312148ce1f92f688bf15971a1903d.tar.gz gnunet-1fdeba9daed312148ce1f92f688bf15971a1903d.zip |
- fix
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 34 | ||||
-rw-r--r-- | src/transport/template_cfg_peer1.conf | 2 | ||||
-rw-r--r-- | src/transport/template_cfg_peer2.conf | 2 |
3 files changed, 22 insertions, 16 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index f67bbd915..0b858a51f 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -717,7 +717,6 @@ static void | |||
717 | call_continuation (struct UDP_MessageWrapper *udpw, int result) | 717 | call_continuation (struct UDP_MessageWrapper *udpw, int result) |
718 | { | 718 | { |
719 | size_t overhead; | 719 | size_t overhead; |
720 | struct UDP_MessageWrapper dummy; | ||
721 | 720 | ||
722 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 721 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
723 | "Calling continuation for %u byte message to `%s' with result %s\n", | 722 | "Calling continuation for %u byte message to `%s' with result %s\n", |
@@ -860,15 +859,6 @@ call_continuation (struct UDP_MessageWrapper *udpw, int result) | |||
860 | GNUNET_STATISTICS_update (plugin->env->stats, | 859 | GNUNET_STATISTICS_update (plugin->env->stats, |
861 | "# UDP, fragmented msgs, fragments bytes, sent, failure", | 860 | "# UDP, fragmented msgs, fragments bytes, sent, failure", |
862 | udpw->msg_size, GNUNET_NO); | 861 | udpw->msg_size, GNUNET_NO); |
863 | |||
864 | dummy.msg_type = MSG_FRAGMENTED_COMPLETE; | ||
865 | dummy.msg_buf = NULL; | ||
866 | dummy.msg_size = udpw->frag_ctx->on_wire_size; | ||
867 | dummy.payload_size = udpw->frag_ctx->payload_size; | ||
868 | dummy.frag_ctx = udpw->frag_ctx; | ||
869 | dummy.session = udpw->session; | ||
870 | call_continuation (&dummy, GNUNET_SYSERR); | ||
871 | |||
872 | break; | 862 | break; |
873 | case MSG_ACK: | 863 | case MSG_ACK: |
874 | /* ACK message: failed to send */ | 864 | /* ACK message: failed to send */ |
@@ -1977,9 +1967,6 @@ read_process_ack (struct Plugin *plugin, | |||
1977 | char *addr, | 1967 | char *addr, |
1978 | socklen_t fromlen) | 1968 | socklen_t fromlen) |
1979 | { | 1969 | { |
1980 | struct UDP_MessageWrapper dummy; | ||
1981 | struct UDP_MessageWrapper *udpw; | ||
1982 | struct UDP_MessageWrapper *tmp; | ||
1983 | const struct GNUNET_MessageHeader *ack; | 1970 | const struct GNUNET_MessageHeader *ack; |
1984 | const struct UDP_ACK_Message *udp_ack; | 1971 | const struct UDP_ACK_Message *udp_ack; |
1985 | struct LookupContext l_ctx; | 1972 | struct LookupContext l_ctx; |
@@ -2202,19 +2189,31 @@ remove_timeout_messages_and_select (struct UDP_MessageWrapper *head, | |||
2202 | if (GNUNET_TIME_UNIT_ZERO.rel_value == remaining.rel_value) | 2189 | if (GNUNET_TIME_UNIT_ZERO.rel_value == remaining.rel_value) |
2203 | { | 2190 | { |
2204 | /* Message timed out */ | 2191 | /* Message timed out */ |
2205 | call_continuation (udpw, GNUNET_SYSERR); | ||
2206 | switch (udpw->msg_type) { | 2192 | switch (udpw->msg_type) { |
2207 | case MSG_UNFRAGMENTED: | 2193 | case MSG_UNFRAGMENTED: |
2194 | GNUNET_STATISTICS_update (plugin->env->stats, | ||
2195 | "# UDP, total, bytes, sent, timeout", | ||
2196 | udpw->msg_size, GNUNET_NO); | ||
2197 | GNUNET_STATISTICS_update (plugin->env->stats, | ||
2198 | "# UDP, total, messages, sent, timeout", | ||
2199 | 1, GNUNET_NO); | ||
2208 | /* Not fragmented message */ | 2200 | /* Not fragmented message */ |
2209 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2201 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2210 | "Message for peer `%s' with size %u timed out\n", | 2202 | "Message for peer `%s' with size %u timed out\n", |
2211 | GNUNET_i2s(&udpw->session->target), udpw->payload_size); | 2203 | GNUNET_i2s(&udpw->session->target), udpw->payload_size); |
2204 | call_continuation (udpw, GNUNET_SYSERR); | ||
2212 | /* Remove message */ | 2205 | /* Remove message */ |
2213 | dequeue (plugin, udpw); | 2206 | dequeue (plugin, udpw); |
2214 | GNUNET_free (udpw); | 2207 | GNUNET_free (udpw); |
2215 | break; | 2208 | break; |
2216 | case MSG_FRAGMENTED: | 2209 | case MSG_FRAGMENTED: |
2217 | /* Fragmented message */ | 2210 | /* Fragmented message */ |
2211 | GNUNET_STATISTICS_update (plugin->env->stats, | ||
2212 | "# UDP, total, bytes, sent, timeout", | ||
2213 | udpw->frag_ctx->on_wire_size, GNUNET_NO); | ||
2214 | GNUNET_STATISTICS_update (plugin->env->stats, | ||
2215 | "# UDP, total, messages, sent, timeout", | ||
2216 | 1, GNUNET_NO); | ||
2218 | call_continuation (udpw, GNUNET_SYSERR); | 2217 | call_continuation (udpw, GNUNET_SYSERR); |
2219 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2218 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2220 | "Fragment for message for peer `%s' with size %u timed out\n", | 2219 | "Fragment for message for peer `%s' with size %u timed out\n", |
@@ -2224,9 +2223,16 @@ remove_timeout_messages_and_select (struct UDP_MessageWrapper *head, | |||
2224 | fragmented_message_done (udpw->frag_ctx, GNUNET_SYSERR); | 2223 | fragmented_message_done (udpw->frag_ctx, GNUNET_SYSERR); |
2225 | break; | 2224 | break; |
2226 | case MSG_ACK: | 2225 | case MSG_ACK: |
2226 | GNUNET_STATISTICS_update (plugin->env->stats, | ||
2227 | "# UDP, total, bytes, sent, timeout", | ||
2228 | udpw->msg_size, GNUNET_NO); | ||
2229 | GNUNET_STATISTICS_update (plugin->env->stats, | ||
2230 | "# UDP, total, messages, sent, timeout", | ||
2231 | 1, GNUNET_NO); | ||
2227 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2232 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2228 | "ACK Message for peer `%s' with size %u timed out\n", | 2233 | "ACK Message for peer `%s' with size %u timed out\n", |
2229 | GNUNET_i2s(&udpw->session->target), udpw->payload_size); | 2234 | GNUNET_i2s(&udpw->session->target), udpw->payload_size); |
2235 | call_continuation (udpw, GNUNET_SYSERR); | ||
2230 | dequeue (plugin, udpw); | 2236 | dequeue (plugin, udpw); |
2231 | GNUNET_free (udpw); | 2237 | GNUNET_free (udpw); |
2232 | break; | 2238 | break; |
diff --git a/src/transport/template_cfg_peer1.conf b/src/transport/template_cfg_peer1.conf index 05309d53c..3b2ad6f94 100644 --- a/src/transport/template_cfg_peer1.conf +++ b/src/transport/template_cfg_peer1.conf | |||
@@ -37,7 +37,7 @@ PORT = 12002 | |||
37 | UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock | 37 | UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock |
38 | 38 | ||
39 | [transport] | 39 | [transport] |
40 | #PREFIX = valgrind --leak-check=full | 40 | PREFIX = valgrind --leak-check=full |
41 | PORT = 12001 | 41 | PORT = 12001 |
42 | #DEBUG = YES | 42 | #DEBUG = YES |
43 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock | 43 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock |
diff --git a/src/transport/template_cfg_peer2.conf b/src/transport/template_cfg_peer2.conf index 210ee51c5..017266d09 100644 --- a/src/transport/template_cfg_peer2.conf +++ b/src/transport/template_cfg_peer2.conf | |||
@@ -38,7 +38,7 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock | |||
38 | TRUST = $SERVICEHOME/data/credit/ | 38 | TRUST = $SERVICEHOME/data/credit/ |
39 | 39 | ||
40 | [transport] | 40 | [transport] |
41 | #PREFIX = valgrind --leak-check=full | 41 | PREFIX = valgrind --leak-check=full |
42 | PORT = 12010 | 42 | PORT = 12010 |
43 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock | 43 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock |
44 | 44 | ||