From: Christian Grothoff Date: Sun, 14 Nov 2010 06:08:56 +0000 (+0000) Subject: hxing X-Git-Tag: initial-import-from-subversion-38251~19740 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5f662c4f39ec7c1a0370f35b6a88c0d1bc866f75;p=oweals%2Fgnunet.git hxing --- diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index 4e4d61431..034f80060 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c @@ -1153,7 +1153,11 @@ handle_client_init (void *cls, while (c != NULL) { if (client == c->client_handle) - break; + { + GNUNET_break (0); + GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); + return; + } c = c->next; } msize = ntohs (message->size); @@ -1167,19 +1171,16 @@ handle_client_init (void *cls, im = (const struct InitMessage *) message; types = (const uint16_t *) &im[1]; msize -= sizeof (struct InitMessage); - if (c == NULL) - { - c = GNUNET_malloc (sizeof (struct Client) + msize); - c->client_handle = client; - c->next = clients; - clients = c; - c->tcnt = msize / sizeof (uint16_t); - c->types = (const uint16_t *) &c[1]; - wtypes = (uint16_t *) &c[1]; - for (i=0;itcnt;i++) - wtypes[i] = ntohs (types[i]); - c->options = ntohl (im->options); - } + c = GNUNET_malloc (sizeof (struct Client) + msize); + c->client_handle = client; + c->next = clients; + clients = c; + c->tcnt = msize / sizeof (uint16_t); + c->types = (const uint16_t *) &c[1]; + wtypes = (uint16_t *) &c[1]; + for (i=0;itcnt;i++) + wtypes[i] = ntohs (types[i]); + c->options = ntohl (im->options); #if DEBUG_CORE_CLIENT GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client %p is interested in %u message types\n",