aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r--src/transport/gnunet-service-transport.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 7cb5869e9..ad4aec8ca 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -873,6 +873,10 @@ transmit_send_continuation (void *cls,
873 rl->transmit_ready = GNUNET_YES; 873 rl->transmit_ready = GNUNET_YES;
874 if (mq->client != NULL) 874 if (mq->client != NULL)
875 { 875 {
876 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
877 "Notifying client %p about failed transission to peer `%4s'.\n",
878 mq->client,
879 GNUNET_i2s(target));
876 send_ok_msg.header.size = htons (sizeof (send_ok_msg)); 880 send_ok_msg.header.size = htons (sizeof (send_ok_msg));
877 send_ok_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK); 881 send_ok_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK);
878 send_ok_msg.success = htonl (result); 882 send_ok_msg.success = htonl (result);
@@ -885,6 +889,8 @@ transmit_send_continuation (void *cls,
885 another message (if available) */ 889 another message (if available) */
886 if (result == GNUNET_OK) 890 if (result == GNUNET_OK)
887 try_transmission_to_peer (n); 891 try_transmission_to_peer (n);
892 else
893 disconnect_neighbour (n);
888} 894}
889 895
890 896
@@ -1867,13 +1873,15 @@ disconnect_neighbour (struct NeighbourList *n)
1867 /* notify all clients about disconnect */ 1873 /* notify all clients about disconnect */
1868 notify_clients_disconnect (&n->id); 1874 notify_clients_disconnect (&n->id);
1869 1875
1870 /* clean up all plugins, cancel connections & pending transmissions */ 1876 /* clean up all plugins, cancel connections and pending transmissions */
1871 while (NULL != (rpos = n->plugins)) 1877 while (NULL != (rpos = n->plugins))
1872 { 1878 {
1873 n->plugins = rpos->next; 1879 n->plugins = rpos->next;
1874 GNUNET_assert (rpos->neighbour == n); 1880 GNUNET_assert (rpos->neighbour == n);
1875 rpos->plugin->api->cancel (rpos->plugin->api->cls, 1881 rpos->plugin->api->cancel (rpos->plugin->api->cls,
1876 rpos->plugin_handle, rpos, &n->id); 1882 rpos->plugin_handle,
1883 rpos,
1884 &n->id);
1877 GNUNET_free (rpos); 1885 GNUNET_free (rpos);
1878 } 1886 }
1879 1887
@@ -2040,14 +2048,19 @@ plugin_env_receive (void *cls,
2040 } 2048 }
2041 if (message == NULL) 2049 if (message == NULL)
2042 { 2050 {
2051#if DEBUG_TRANSPORT
2052 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
2053 "Receive failed from `%4s', triggering disconnect\n",
2054 GNUNET_i2s(&n->id));
2055#endif
2056 /* TODO: call stats */
2057 disconnect_neighbour (n);
2043 if ((service_context != NULL) && 2058 if ((service_context != NULL) &&
2044 (service_context->plugin_handle == plugin_context)) 2059 (service_context->plugin_handle == plugin_context))
2045 { 2060 {
2046 service_context->connected = GNUNET_NO; 2061 service_context->connected = GNUNET_NO;
2047 service_context->plugin_handle = NULL; 2062 service_context->plugin_handle = NULL;
2048 } 2063 }
2049 /* TODO: call stats */
2050 disconnect_neighbour (n);
2051 return NULL; 2064 return NULL;
2052 } 2065 }
2053#if DEBUG_TRANSPORT 2066#if DEBUG_TRANSPORT
@@ -2362,8 +2375,10 @@ handle_try_connect (void *cls,
2362 tcm = (const struct TryConnectMessage *) message; 2375 tcm = (const struct TryConnectMessage *) message;
2363#if DEBUG_TRANSPORT 2376#if DEBUG_TRANSPORT
2364 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2377 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2365 "Received `%s' request from client asking to connect to `%4s'\n", 2378 "Received `%s' request from client %p asking to connect to `%4s'\n",
2366 "TRY_CONNECT", GNUNET_i2s (&tcm->peer)); 2379 "TRY_CONNECT",
2380 client,
2381 GNUNET_i2s (&tcm->peer));
2367#endif 2382#endif
2368 if (NULL == find_neighbour (&tcm->peer)) 2383 if (NULL == find_neighbour (&tcm->peer))
2369 setup_new_neighbour (&tcm->peer); 2384 setup_new_neighbour (&tcm->peer);