[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17323 - gnunet/src/core
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17323 - gnunet/src/core |
Date: |
Mon, 10 Oct 2011 13:54:10 +0200 |
Author: grothoff
Date: 2011-10-10 13:54:09 +0200 (Mon, 10 Oct 2011)
New Revision: 17323
Modified:
gnunet/src/core/gnunet-service-core.h
gnunet/src/core/gnunet-service-core_clients.c
Log:
cleaner
Modified: gnunet/src/core/gnunet-service-core.h
===================================================================
--- gnunet/src/core/gnunet-service-core.h 2011-10-10 11:51:16 UTC (rev
17322)
+++ gnunet/src/core/gnunet-service-core.h 2011-10-10 11:54:09 UTC (rev
17323)
@@ -83,11 +83,6 @@
int was_solicited;
/**
- * Is corking allowed (set only once we have the real message).
- */
- int cork;
-
- /**
* How many bytes does the client intend to send?
*/
uint16_t msize;
Modified: gnunet/src/core/gnunet-service-core_clients.c
===================================================================
--- gnunet/src/core/gnunet-service-core_clients.c 2011-10-10 11:51:16 UTC
(rev 17322)
+++ gnunet/src/core/gnunet-service-core_clients.c 2011-10-10 11:54:09 UTC
(rev 17323)
@@ -351,6 +351,25 @@
/**
+ * Closure for the 'client_tokenizer_callback'.
+ */
+struct TokenizerContext
+{
+
+ /**
+ * Active request handle for the message.
+ */
+ struct GSC_ClientActiveRequest *car;
+
+ /**
+ * Is corking allowed (set only once we have the real message).
+ */
+ int cork;
+
+};
+
+
+/**
* Handle CORE_SEND request.
*
* @param cls unused
@@ -363,7 +382,7 @@
{
const struct SendMessage *sm;
struct GSC_Client *c;
- struct GSC_ClientActiveRequest *car;
+ struct TokenizerContext tc;
uint16_t msize;
msize = ntohs (message->size);
@@ -385,8 +404,8 @@
GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
return;
}
- car = GNUNET_CONTAINER_multihashmap_get (c->requests, &sm->peer.hashPubKey);
- if (NULL == car)
+ tc.car = GNUNET_CONTAINER_multihashmap_get (c->requests,
&sm->peer.hashPubKey);
+ if (NULL == tc.car)
{
/* client did not request transmission first! */
GNUNET_break (0);
@@ -396,17 +415,17 @@
GNUNET_assert (GNUNET_YES ==
GNUNET_CONTAINER_multihashmap_remove (c->requests,
&sm->peer.hashPubKey,
- car));
- car->cork = ntohl (sm->cork);
+ tc.car));
+ tc.cork = ntohl (sm->cork);
GNUNET_SERVER_mst_receive (client_mst,
- car,
+ &tc,
(const char*) &sm[1], msize,
GNUNET_YES,
GNUNET_NO);
if (0 !=
- memcmp (&car->target, &GSC_my_identity, sizeof (struct
GNUNET_PeerIdentity)))
- GSC_SESSIONS_dequeue_request (car);
- GNUNET_free (car);
+ memcmp (&tc.car->target, &GSC_my_identity, sizeof (struct
GNUNET_PeerIdentity)))
+ GSC_SESSIONS_dequeue_request (tc.car);
+ GNUNET_free (tc.car);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
@@ -425,7 +444,8 @@
client_tokenizer_callback (void *cls, void *client,
const struct GNUNET_MessageHeader *message)
{
- struct GSC_ClientActiveRequest *car = client;
+ struct TokenizerContext *tc = cls;
+ struct GSC_ClientActiveRequest *car = tc->car;
if (0 ==
memcmp (&car->target, &GSC_my_identity, sizeof (struct
GNUNET_PeerIdentity)))
@@ -442,7 +462,7 @@
GNUNET_CORE_OPTION_SEND_HDR_INBOUND |
GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND);
}
else
- GSC_SESSIONS_transmit (car, message, car->cork);
+ GSC_SESSIONS_transmit (car, message, tc->cork);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17323 - gnunet/src/core,
gnunet <=