-fix
authorChristian Grothoff <christian@grothoff.org>
Sun, 22 Jul 2012 20:46:09 +0000 (20:46 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 22 Jul 2012 20:46:09 +0000 (20:46 +0000)
src/gns/gnunet-dns2gns.c
src/gns/gnunet-gns-helper-service-w32.c

index 3c48c4268f895e9bb5f1b39a7e5ec07808bbe5f5..741c8dd00b62348562f827b796b960f30b6315cb 100644 (file)
@@ -188,7 +188,6 @@ do_timeout (void *cls,
  * lookup
  *
  * @param cls closure
- * @param name "name" of the original lookup
  * @param rd_count number of records
  * @param rd the records in reply
  */
index 198dfb851a2fbfda5d9842484b6e800fa438fbfb..d291e955738e6cf5680984988942f8542db9cd44 100644 (file)
@@ -104,8 +104,6 @@ struct TransmitCallbackContext
    */
   struct GNUNET_MessageHeader *msg;
 
-  size_t msgsize;
-
   /**
    * Handle for the transmission request.
    */
@@ -154,7 +152,7 @@ transmit_callback (void *cls, size_t size, void *buf)
 
   tcc->th = NULL;
   GNUNET_CONTAINER_DLL_remove (tcc_head, tcc_tail, tcc);
-  msize = tcc->msgsize;
+  msize = ntohs (tcc->msg->size);
   if (size == 0)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -180,7 +178,8 @@ transmit_callback (void *cls, size_t size, void *buf)
  * @param msg message to transmit, will be freed!
  */
 static void
-transmit (struct GNUNET_SERVER_Client *client, struct GNUNET_MessageHeader *msg, size_t msgsize)
+transmit (struct GNUNET_SERVER_Client *client, 
+         struct GNUNET_MessageHeader *msg)
 {
   struct TransmitCallbackContext *tcc;
 
@@ -194,11 +193,11 @@ transmit (struct GNUNET_SERVER_Client *client, struct GNUNET_MessageHeader *msg,
   }
   tcc = GNUNET_malloc (sizeof (struct TransmitCallbackContext));
   tcc->msg = msg;
-  tcc->msgsize = msgsize;
   tcc->client = client;
   if (NULL ==
       (tcc->th =
-       GNUNET_SERVER_notify_transmit_ready (client, msgsize,
+       GNUNET_SERVER_notify_transmit_ready (client, 
+                                           ntohs (msg->size),
                                             GNUNET_TIME_UNIT_FOREVER_REL,
                                             &transmit_callback, tcc)))
   {
@@ -249,9 +248,11 @@ MarshallWSAQUERYSETW (WSAQUERYSETW *qs, GUID *sc)
   MarshallPtr (qs->lpBlob, qs, BLOB);
 }
 
+
 static void
-process_ip_lookup_result (void* cls, uint32_t rd_count,
-    const struct GNUNET_NAMESTORE_RecordData *rd)
+process_ip_lookup_result (void* cls, 
+                         uint32_t rd_count,
+                         const struct GNUNET_NAMESTORE_RecordData *rd)
 {
   int i, j, csanum;
   struct request *rq = (struct request *) cls;
@@ -274,7 +275,7 @@ process_ip_lookup_result (void* cls, uint32_t rd_count,
     msg = GNUNET_malloc (size);
     msg->header.size = htons (size);
     msg->header.type = htons (GNUNET_MESSAGE_TYPE_W32RESOLVER_RESPONSE);
-    transmit (rq->client, &msg->header, msg->header.size);
+    transmit (rq->client, &msg->header);
     return;
   }
 
@@ -504,7 +505,7 @@ process_ip_lookup_result (void* cls, uint32_t rd_count,
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error in WSAQUERYSETW size calc: expected %lu, got %lu (recalc %lu)\n", size, (unsigned long) ((char *) ptr - (char *) msg), size_recalc);
   }
   MarshallWSAQUERYSETW (qs, &rq->sc);
-  transmit (rq->client, &msg->header, size);
+  transmit (rq->client, &msg->header);
 }
 
 static void