diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-30 09:59:05 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-30 09:59:05 +0000 |
commit | 71100696bec461d248b481e280a9ee64f9c8f6e4 (patch) | |
tree | fe7f31b99d3642368257fca0cc00747c6e8b8642 /src/transport/gnunet-service-transport_clients.c | |
parent | ee8c4976c44abcf0e6181c56494a380cea4474b4 (diff) | |
download | gnunet-71100696bec461d248b481e280a9ee64f9c8f6e4.tar.gz gnunet-71100696bec461d248b481e280a9ee64f9c8f6e4.zip |
foundit
Diffstat (limited to 'src/transport/gnunet-service-transport_clients.c')
-rw-r--r-- | src/transport/gnunet-service-transport_clients.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c index 6a29edc34..a3254998d 100644 --- a/src/transport/gnunet-service-transport_clients.c +++ b/src/transport/gnunet-service-transport_clients.c | |||
@@ -155,7 +155,6 @@ setup_client (struct GNUNET_SERVER_Client *client) | |||
155 | struct TransportClient *tc; | 155 | struct TransportClient *tc; |
156 | 156 | ||
157 | GNUNET_assert (lookup_client (client) == NULL); | 157 | GNUNET_assert (lookup_client (client) == NULL); |
158 | |||
159 | tc = GNUNET_malloc (sizeof (struct TransportClient)); | 158 | tc = GNUNET_malloc (sizeof (struct TransportClient)); |
160 | tc->client = client; | 159 | tc->client = client; |
161 | 160 | ||
@@ -479,6 +478,16 @@ clients_handle_send (void *cls, struct GNUNET_SERVER_Client *client, | |||
479 | struct SendTransmitContinuationContext *stcc; | 478 | struct SendTransmitContinuationContext *stcc; |
480 | uint16_t size; | 479 | uint16_t size; |
481 | uint16_t msize; | 480 | uint16_t msize; |
481 | struct TransportClient *tc; | ||
482 | |||
483 | tc = lookup_client (client); | ||
484 | if (NULL == tc) | ||
485 | { | ||
486 | /* client asked for transmission before 'START' */ | ||
487 | GNUNET_break (0); | ||
488 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | ||
489 | return; | ||
490 | } | ||
482 | 491 | ||
483 | size = ntohs (message->size); | 492 | size = ntohs (message->size); |
484 | if (size < | 493 | if (size < |
@@ -524,7 +533,7 @@ clients_handle_send (void *cls, struct GNUNET_SERVER_Client *client, | |||
524 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 533 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
525 | stcc = GNUNET_malloc (sizeof (struct SendTransmitContinuationContext)); | 534 | stcc = GNUNET_malloc (sizeof (struct SendTransmitContinuationContext)); |
526 | stcc->target = obm->peer; | 535 | stcc->target = obm->peer; |
527 | stcc->client = client; | 536 | stcc->client = client; // !!!! |
528 | GNUNET_SERVER_client_keep (client); | 537 | GNUNET_SERVER_client_keep (client); |
529 | GST_neighbours_send (&obm->peer, obmm, msize, | 538 | GST_neighbours_send (&obm->peer, obmm, msize, |
530 | GNUNET_TIME_relative_ntoh (obm->timeout), | 539 | GNUNET_TIME_relative_ntoh (obm->timeout), |
@@ -893,7 +902,10 @@ GST_clients_unicast (struct GNUNET_SERVER_Client *client, | |||
893 | 902 | ||
894 | tc = lookup_client (client); | 903 | tc = lookup_client (client); |
895 | if (NULL == tc) | 904 | if (NULL == tc) |
896 | tc = setup_client (client); | 905 | { |
906 | GNUNET_break (0); | ||
907 | return; | ||
908 | } | ||
897 | unicast (tc, msg, may_drop); | 909 | unicast (tc, msg, may_drop); |
898 | } | 910 | } |
899 | 911 | ||