diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-06-05 18:27:45 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-06-05 18:27:45 +0000 |
commit | 231af2b9e9f19d407cd174eeca2013d1363bf553 (patch) | |
tree | 83f95375dcc97aac0842a8d17a5a8a08d160ecf7 | |
parent | fef2121e77d87168e98d3e3e62b200263bcf5e02 (diff) | |
download | gnunet-231af2b9e9f19d407cd174eeca2013d1363bf553.tar.gz gnunet-231af2b9e9f19d407cd174eeca2013d1363bf553.zip |
better
-rw-r--r-- | src/transport/gnunet-service-transport.c | 3 | ||||
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 6d160a76e..c44d5ef04 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -915,6 +915,7 @@ transmit_send_continuation (void *cls, | |||
915 | 915 | ||
916 | GNUNET_assert (mq != NULL); | 916 | GNUNET_assert (mq != NULL); |
917 | n = mq->neighbour; | 917 | n = mq->neighbour; |
918 | GNUNET_assert (n != NULL); | ||
918 | GNUNET_assert (0 == | 919 | GNUNET_assert (0 == |
919 | memcmp (&n->id, target, | 920 | memcmp (&n->id, target, |
920 | sizeof (struct GNUNET_PeerIdentity))); | 921 | sizeof (struct GNUNET_PeerIdentity))); |
@@ -2299,6 +2300,7 @@ plugin_env_receive (void *cls, | |||
2299 | _ | 2300 | _ |
2300 | ("Dropping incoming message due to repeated bandwidth quota violations.\n")); | 2301 | ("Dropping incoming message due to repeated bandwidth quota violations.\n")); |
2301 | /* TODO: call stats */ | 2302 | /* TODO: call stats */ |
2303 | GNUNET_assert (NULL != service_context->neighbour); | ||
2302 | return service_context; | 2304 | return service_context; |
2303 | } | 2305 | } |
2304 | switch (ntohs (message->type)) | 2306 | switch (ntohs (message->type)) |
@@ -2346,6 +2348,7 @@ plugin_env_receive (void *cls, | |||
2346 | } | 2348 | } |
2347 | GNUNET_free (im); | 2349 | GNUNET_free (im); |
2348 | } | 2350 | } |
2351 | GNUNET_assert (NULL != service_context->neighbour); | ||
2349 | return service_context; | 2352 | return service_context; |
2350 | } | 2353 | } |
2351 | 2354 | ||
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 9d82bead9..6ebb257a1 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -1004,7 +1004,7 @@ tcp_plugin_send (void *cls, | |||
1004 | struct PendingMessage *pme; | 1004 | struct PendingMessage *pme; |
1005 | 1005 | ||
1006 | if (session == NULL) | 1006 | if (session == NULL) |
1007 | session = find_session_by_target (plugin, target); | 1007 | session = find_session_by_target (plugin, target); |
1008 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + ntohs (msg->size)); | 1008 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + ntohs (msg->size)); |
1009 | pm->msg = (struct GNUNET_MessageHeader *) &pm[1]; | 1009 | pm->msg = (struct GNUNET_MessageHeader *) &pm[1]; |
1010 | memcpy (pm->msg, msg, ntohs (msg->size)); | 1010 | memcpy (pm->msg, msg, ntohs (msg->size)); |
@@ -1029,6 +1029,7 @@ tcp_plugin_send (void *cls, | |||
1029 | session->expecting_welcome = GNUNET_YES; | 1029 | session->expecting_welcome = GNUNET_YES; |
1030 | session->still_connecting = GNUNET_YES; | 1030 | session->still_connecting = GNUNET_YES; |
1031 | session->pending_messages = pm; | 1031 | session->pending_messages = pm; |
1032 | session->service_context = service_context; | ||
1032 | GNUNET_PEERINFO_for_all (plugin->env->cfg, | 1033 | GNUNET_PEERINFO_for_all (plugin->env->cfg, |
1033 | plugin->env->sched, | 1034 | plugin->env->sched, |
1034 | target, | 1035 | target, |
@@ -1037,6 +1038,7 @@ tcp_plugin_send (void *cls, | |||
1037 | } | 1038 | } |
1038 | GNUNET_assert (session != NULL); | 1039 | GNUNET_assert (session != NULL); |
1039 | GNUNET_assert (session->still_connecting == GNUNET_NO); | 1040 | GNUNET_assert (session->still_connecting == GNUNET_NO); |
1041 | session->service_context = service_context; | ||
1040 | /* append pm to pending_messages list */ | 1042 | /* append pm to pending_messages list */ |
1041 | pme = session->pending_messages; | 1043 | pme = session->pending_messages; |
1042 | if (pme == NULL) | 1044 | if (pme == NULL) |