diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-06-11 08:42:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-06-11 08:42:40 +0000 |
commit | 48fa0ba8abea2464b2df67247ae1bd50d0f1f934 (patch) | |
tree | dae4c813f027986748b1b3d2a3f84f8d2a7eb00c /src | |
parent | 09c50fa070ad81f2d213975782b2948a7cb82428 (diff) | |
download | gnunet-48fa0ba8abea2464b2df67247ae1bd50d0f1f934.tar.gz gnunet-48fa0ba8abea2464b2df67247ae1bd50d0f1f934.zip |
-send proper termination on error
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-service-transport_clients.c | 10 | ||||
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 6 | ||||
-rw-r--r-- | src/transport/transport_api_address_to_string.c | 12 |
3 files changed, 16 insertions, 12 deletions
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c index 3cf890c02..a4812e260 100644 --- a/src/transport/gnunet-service-transport_clients.c +++ b/src/transport/gnunet-service-transport_clients.c | |||
@@ -987,8 +987,14 @@ clients_handle_address_to_string (void *cls, | |||
987 | atsm.res = htonl (GNUNET_SYSERR); | 987 | atsm.res = htonl (GNUNET_SYSERR); |
988 | atsm.addr_len = htonl (0); | 988 | atsm.addr_len = htonl (0); |
989 | GNUNET_SERVER_transmit_context_append_message (tc, | 989 | GNUNET_SERVER_transmit_context_append_message (tc, |
990 | (const struct GNUNET_MessageHeader *) &atsm); | 990 | &atsm.header); |
991 | GNUNET_SERVER_transmit_context_run (tc, rtimeout); | 991 | atsm.header.size = ntohs (sizeof (struct AddressToStringResultMessage)); |
992 | atsm.header.type = ntohs (GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING_REPLY); | ||
993 | atsm.res = htonl (GNUNET_OK); | ||
994 | atsm.addr_len = htonl (0); | ||
995 | GNUNET_SERVER_transmit_context_append_message (tc, | ||
996 | &atsm.header); | ||
997 | GNUNET_SERVER_transmit_context_run (tc, GNUNET_TIME_UNIT_FOREVER_REL); | ||
992 | return; | 998 | return; |
993 | } | 999 | } |
994 | actx = GNUNET_new (struct AddressToStringContext); | 1000 | actx = GNUNET_new (struct AddressToStringContext); |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index ca90d461d..31100d748 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -1636,7 +1636,8 @@ tcp_plugin_disconnect (void *cls, const struct GNUNET_PeerIdentity *target) | |||
1636 | { | 1636 | { |
1637 | struct Plugin *plugin = cls; | 1637 | struct Plugin *plugin = cls; |
1638 | 1638 | ||
1639 | LOG(GNUNET_ERROR_TYPE_DEBUG, "Disconnecting peer `%4s'\n", | 1639 | LOG(GNUNET_ERROR_TYPE_DEBUG, |
1640 | "Disconnecting peer `%4s'\n", | ||
1640 | GNUNET_i2s (target)); | 1641 | GNUNET_i2s (target)); |
1641 | GNUNET_CONTAINER_multipeermap_get_multiple (plugin->sessionmap, target, | 1642 | GNUNET_CONTAINER_multipeermap_get_multiple (plugin->sessionmap, target, |
1642 | &session_disconnect_it, plugin); | 1643 | &session_disconnect_it, plugin); |
@@ -2275,7 +2276,8 @@ handle_tcp_data (void *cls, struct GNUNET_SERVER_Client *client, | |||
2275 | } | 2276 | } |
2276 | else | 2277 | else |
2277 | { | 2278 | { |
2278 | LOG(GNUNET_ERROR_TYPE_DEBUG, "Throttling receiving from `%s' for %s\n", | 2279 | LOG(GNUNET_ERROR_TYPE_DEBUG, |
2280 | "Throttling receiving from `%s' for %s\n", | ||
2279 | GNUNET_i2s (&session->target), | 2281 | GNUNET_i2s (&session->target), |
2280 | GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES)); | 2282 | GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES)); |
2281 | GNUNET_SERVER_disable_receive_done_warning (client); | 2283 | GNUNET_SERVER_disable_receive_done_warning (client); |
diff --git a/src/transport/transport_api_address_to_string.c b/src/transport/transport_api_address_to_string.c index afd0c7deb..e36904212 100644 --- a/src/transport/transport_api_address_to_string.c +++ b/src/transport/transport_api_address_to_string.c | |||
@@ -76,8 +76,7 @@ address_response_processor (void *cls, | |||
76 | alucb->cb (alucb->cb_cls, | 76 | alucb->cb (alucb->cb_cls, |
77 | NULL, | 77 | NULL, |
78 | GNUNET_SYSERR); | 78 | GNUNET_SYSERR); |
79 | GNUNET_CLIENT_disconnect (alucb->client); | 79 | GNUNET_TRANSPORT_address_to_string_cancel (alucb); |
80 | GNUNET_free (alucb); | ||
81 | return; | 80 | return; |
82 | } | 81 | } |
83 | GNUNET_break (ntohs (msg->type) == | 82 | GNUNET_break (ntohs (msg->type) == |
@@ -90,8 +89,7 @@ address_response_processor (void *cls, | |||
90 | alucb->cb (alucb->cb_cls, | 89 | alucb->cb (alucb->cb_cls, |
91 | NULL, | 90 | NULL, |
92 | GNUNET_SYSERR); | 91 | GNUNET_SYSERR); |
93 | GNUNET_CLIENT_disconnect (alucb->client); | 92 | GNUNET_TRANSPORT_address_to_string_cancel (alucb); |
94 | GNUNET_free (alucb); | ||
95 | return; | 93 | return; |
96 | } | 94 | } |
97 | atsm = (const struct AddressToStringResultMessage *) msg; | 95 | atsm = (const struct AddressToStringResultMessage *) msg; |
@@ -126,8 +124,7 @@ address_response_processor (void *cls, | |||
126 | alucb->cb (alucb->cb_cls, | 124 | alucb->cb (alucb->cb_cls, |
127 | NULL, | 125 | NULL, |
128 | GNUNET_OK); | 126 | GNUNET_OK); |
129 | GNUNET_CLIENT_disconnect (alucb->client); | 127 | GNUNET_TRANSPORT_address_to_string_cancel (alucb); |
130 | GNUNET_free (alucb); | ||
131 | return; | 128 | return; |
132 | } | 129 | } |
133 | address = (const char *) &atsm[1]; | 130 | address = (const char *) &atsm[1]; |
@@ -139,8 +136,7 @@ address_response_processor (void *cls, | |||
139 | alucb->cb (alucb->cb_cls, | 136 | alucb->cb (alucb->cb_cls, |
140 | NULL, | 137 | NULL, |
141 | GNUNET_SYSERR); | 138 | GNUNET_SYSERR); |
142 | GNUNET_CLIENT_disconnect (alucb->client); | 139 | GNUNET_TRANSPORT_address_to_string_cancel (alucb); |
143 | GNUNET_free (alucb); | ||
144 | return; | 140 | return; |
145 | } | 141 | } |
146 | /* expect more replies */ | 142 | /* expect more replies */ |