removing server from argument list, other minor fixes
authorChristian Grothoff <christian@grothoff.org>
Fri, 29 May 2009 02:39:55 +0000 (02:39 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 29 May 2009 02:39:55 +0000 (02:39 +0000)
28 files changed:
TODO
src/arm/gnunet-service-arm.c
src/core/core_api.c
src/core/gnunet-service-core.c
src/include/gnunet_server_lib.h
src/peerinfo/gnunet-service-peerinfo.c
src/resolver/gnunet-service-resolver.c
src/statistics/gnunet-service-statistics.c
src/statistics/statistics_api.c
src/transport/gnunet-service-transport.c
src/transport/plugin_transport_http.c
src/transport/plugin_transport_tcp.c
src/transport/transport_api.c
src/util/client.c
src/util/crypto_rsa.c
src/util/network.c
src/util/os_network.c
src/util/scheduler.c
src/util/server.c
src/util/service.c
src/util/test_client.c
src/util/test_crypto_ksk.c
src/util/test_crypto_rsa.c
src/util/test_network_addressing.c
src/util/test_server.c
src/util/test_server_disconnect.c
src/util/test_server_with_client.c
src/util/test_service.c

diff --git a/TODO b/TODO
index b91f1e74b9474fa790d6b2c5f00b89104e64c206..b0605709d2af02a470aa5259c523f6cba923f218 100644 (file)
--- a/TODO
+++ b/TODO
@@ -10,7 +10,6 @@ Core:
   => bootstrap should use plugins, possible multiple at the same time!
 
 Util:
-* Should "server" argument be given in event callbacks?
 * consider adding "get_time" to "configuration" API
 
 TESTCASES WANTED:
index 97d507890b1763f5bd8f796dc2f6002a28f71fb2..c9736982fee8627e6252e55b7f423ad6371bb1a1 100644 (file)
@@ -327,8 +327,7 @@ start_process (struct ServiceList *sl)
  * Start the specified service.
  */
 static void
-start_service (struct GNUNET_SERVER_Handle *server,
-               struct GNUNET_SERVER_Client *client, const char *servicename)
+start_service (struct GNUNET_SERVER_Client *client, const char *servicename)
 {
   struct ServiceList *sl;
   char *binary;
@@ -368,6 +367,7 @@ start_service (struct GNUNET_SERVER_Handle *server,
                   config, servicename);
       signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_DOWN);
       GNUNET_free (binary);
+      GNUNET_free (config);
       return;
     }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -403,8 +403,7 @@ free_and_signal (void *cls, struct ServiceList *pos)
  * Stop the specified service.
  */
 static void
-stop_service (struct GNUNET_SERVER_Handle *server,
-              struct GNUNET_SERVER_Client *client, const char *servicename)
+stop_service (struct GNUNET_SERVER_Client *client, const char *servicename)
 {
   struct ServiceList *pos;
   struct GNUNET_CLIENT_Connection *sc;
@@ -412,7 +411,7 @@ stop_service (struct GNUNET_SERVER_Handle *server,
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Preparing to stop `%s'\n", servicename);
   pos = find_name (servicename);
-  if (pos->kill_continuation != NULL)
+  if ((pos != NULL) && (pos->kill_continuation != NULL))
     {
       /* killing already in progress */
       signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_DOWN);
@@ -453,7 +452,6 @@ stop_service (struct GNUNET_SERVER_Handle *server,
  * Handle START-message.
  *
  * @param cls closure (always NULL)
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  * @return GNUNET_OK to keep the connection open,
@@ -461,7 +459,6 @@ stop_service (struct GNUNET_SERVER_Handle *server,
  */
 static void
 handle_start (void *cls,
-              struct GNUNET_SERVER_Handle *server,
               struct GNUNET_SERVER_Client *client,
               const struct GNUNET_MessageHeader *message)
 {
@@ -477,7 +474,7 @@ handle_start (void *cls,
       GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
       return;
     }
-  start_service (server, client, servicename);
+  start_service (client, servicename);
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
 }
 
@@ -486,7 +483,6 @@ handle_start (void *cls,
  * Handle STOP-message.
  *
  * @param cls closure (always NULL)
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  * @return GNUNET_OK to keep the connection open,
@@ -494,7 +490,6 @@ handle_start (void *cls,
  */
 static void
 handle_stop (void *cls,
-             struct GNUNET_SERVER_Handle *server,
              struct GNUNET_SERVER_Client *client,
              const struct GNUNET_MessageHeader *message)
 {
@@ -510,7 +505,7 @@ handle_stop (void *cls,
       GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
       return;
     }
-  stop_service (server, client, servicename);
+  stop_service (client, servicename);
 }
 
 
@@ -669,7 +664,7 @@ run (void *cls,
       pos = strtok (defaultservices, " ");
       while (pos != NULL)
         {
-          start_service (server, NULL, pos);
+          start_service (NULL, pos);
           pos = strtok (NULL, " ");
         }
       GNUNET_free (defaultservices);
index 10fa0ccdd22d52ad4e933e87b3c3117ddbf1de53..61836e5903a9a9f11813b56c32552cbc3a83d2d3 100644 (file)
@@ -732,8 +732,8 @@ transmit_start (void *cls, size_t size, void *buf)
   GNUNET_CLIENT_receive (h->client,
                          &init_reply_handler,
                          h,
-                         GNUNET_TIME_absolute_get_remaining (h->
-                                                             startup_timeout));
+                         GNUNET_TIME_absolute_get_remaining
+                         (h->startup_timeout));
   return sizeof (struct InitMessage) + h->hcnt * sizeof (uint16_t);
 }
 
index e9e076bcc6e114d4a1def24aaf9297e34f1db2f1..2fbb4ca0536c43b0951daff731d55695a112a9fd 100644 (file)
@@ -834,7 +834,6 @@ send_to_all_clients (const struct GNUNET_MessageHeader *msg, int can_drop)
  */
 static void
 handle_client_init (void *cls,
-                    struct GNUNET_SERVER_Handle *server,
                     struct GNUNET_SERVER_Client *client,
                     const struct GNUNET_MessageHeader *message)
 {
@@ -948,7 +947,6 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
  */
 static void
 handle_client_request_configure (void *cls,
-                                 struct GNUNET_SERVER_Handle *server,
                                  struct GNUNET_SERVER_Client *client,
                                  const struct GNUNET_MessageHeader *message)
 {
@@ -1102,8 +1100,9 @@ process_encrypted_neighbour_queue (struct Neighbour *n)
               "Asking transport for transmission of %u bytes to `%4s' in next %llu ms\n",
               n->encrypted_head->size,
               GNUNET_i2s (&n->peer),
-              GNUNET_TIME_absolute_get_remaining (n->encrypted_head->
-                                                  deadline).value);
+              GNUNET_TIME_absolute_get_remaining (n->
+                                                  encrypted_head->deadline).
+              value);
   n->th =
     GNUNET_TRANSPORT_notify_transmit_ready (transport, &n->peer,
                                             n->encrypted_head->size,
@@ -1307,6 +1306,7 @@ select_messages (struct Neighbour *n,
         }
       if (discard_low_prio)
         {
+          GNUNET_assert (min != NULL);
           /* remove lowest-priority entry from consideration */
           min->do_transmit = GNUNET_YES;        /* means: discard (for now) */
         }
@@ -1580,7 +1580,6 @@ process_plaintext_neighbour_queue (struct Neighbour *n)
  */
 static void
 handle_client_send (void *cls,
-                    struct GNUNET_SERVER_Handle *server,
                     struct GNUNET_SERVER_Client *client,
                     const struct GNUNET_MessageHeader *message);
 
@@ -1612,7 +1611,7 @@ send_connect_continuation (void *cls, size_t size, void *buf)
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Connection to peer `%4s' succeeded, retrying original send request\n",
               GNUNET_i2s (&sm->peer));
-  handle_client_send (NULL, NULL, NULL, &sm->header);
+  handle_client_send (NULL, NULL, &sm->header);
   GNUNET_free (sm);
   return 0;
 }
@@ -1623,7 +1622,6 @@ send_connect_continuation (void *cls, size_t size, void *buf)
  */
 static void
 handle_client_send (void *cls,
-                    struct GNUNET_SERVER_Handle *server,
                     struct GNUNET_SERVER_Client *client,
                     const struct GNUNET_MessageHeader *message)
 {
index 4e4f35e260157fbeac1799ddc04211d820f70621..44db9ce70440a62d119234693962458f87f70620 100644 (file)
@@ -64,13 +64,10 @@ struct GNUNET_SERVER_Client;
  * received.
  *
  * @param cls closure
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 typedef void (*GNUNET_SERVER_MessageCallback) (void *cls,
-                                               struct GNUNET_SERVER_Handle *
-                                               server,
                                                struct GNUNET_SERVER_Client *
                                                client,
                                                const struct
index b81c7b6eeb12cf2ff6012fe90120ed854c05c974..0d383c0f13d8277bca54cd6f2c7f0465f953df31 100644 (file)
@@ -385,9 +385,7 @@ bind_address (const struct GNUNET_PeerIdentity *peer,
  */
 static void
 send_to_each_host (const struct GNUNET_PeerIdentity *only,
-                   int trust_change,
-                   struct GNUNET_SERVER_Client *client,
-                   struct GNUNET_SERVER_Handle *server)
+                   int trust_change, struct GNUNET_SERVER_Client *client)
 {
   struct HostEntry *pos;
   struct InfoMessage *im;
@@ -550,13 +548,11 @@ cron_clean_data_hosts (void *cls,
  * Handle ADD-message.
  *
  * @param cls closure
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_add (void *cls,
-            struct GNUNET_SERVER_Handle *server,
             struct GNUNET_SERVER_Client *client,
             const struct GNUNET_MessageHeader *message)
 {
@@ -589,20 +585,18 @@ handle_add (void *cls,
  * Handle GET-message.
  *
  * @param cls closure
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_get (void *cls,
-            struct GNUNET_SERVER_Handle *server,
             struct GNUNET_SERVER_Client *client,
             const struct GNUNET_MessageHeader *message)
 {
   const struct ListPeerMessage *lpm;
 
   lpm = (const struct ListPeerMessage *) message;
-  send_to_each_host (&lpm->peer, ntohl (lpm->trust_change), client, server);
+  send_to_each_host (&lpm->peer, ntohl (lpm->trust_change), client);
 }
 
 
@@ -610,20 +604,18 @@ handle_get (void *cls,
  * Handle GET-ALL-message.
  *
  * @param cls closure
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_get_all (void *cls,
-                struct GNUNET_SERVER_Handle *server,
                 struct GNUNET_SERVER_Client *client,
                 const struct GNUNET_MessageHeader *message)
 {
   const struct ListAllPeersMessage *lpm;
 
   lpm = (const struct ListAllPeersMessage *) message;
-  send_to_each_host (NULL, ntohl (lpm->trust_change), client, server);
+  send_to_each_host (NULL, ntohl (lpm->trust_change), client);
 }
 
 
index dbdecdfe54a5f62b2b62a28042fe7fbccec124cf..ac50f02d061d122e2aaf4a5a7222ebd44c6a2f76 100644 (file)
@@ -368,13 +368,11 @@ get_ip_from_hostname (struct GNUNET_SERVER_Client *client,
  * Handle GET-message.
  *
  * @param cls closure
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_get (void *cls,
-            struct GNUNET_SERVER_Handle *server,
             struct GNUNET_SERVER_Client *client,
             const struct GNUNET_MessageHeader *message)
 {
index 0e7b4853d02659b1f717646a24035a2376b27de8..676db1b0244f46571bb1b9e17061a960068736a1 100644 (file)
@@ -259,7 +259,6 @@ matches (const struct StatsEntry *e, const char *service, const char *name)
  * Handle GET-message.
  *
  * @param cls closure
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  * @return GNUNET_OK to keep the connection open,
@@ -267,7 +266,6 @@ matches (const struct StatsEntry *e, const char *service, const char *name)
  */
 static void
 handle_get (void *cls,
-            struct GNUNET_SERVER_Handle *server,
             struct GNUNET_SERVER_Client *client,
             const struct GNUNET_MessageHeader *message)
 {
@@ -308,13 +306,11 @@ handle_get (void *cls,
  * Handle SET-message.
  *
  * @param cls closure
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_set (void *cls,
-            struct GNUNET_SERVER_Handle *server,
             struct GNUNET_SERVER_Client *client,
             const struct GNUNET_MessageHeader *message)
 {
index f68cf9396286e071f8497bceeee0b640602af644..be78d260a27db863a990dafcd730cdcabed5c121 100644 (file)
@@ -369,9 +369,8 @@ receive_stats (void *cls, const struct GNUNET_MessageHeader *msg)
           GNUNET_CLIENT_receive (h->client,
                                  &receive_stats,
                                  h,
-                                 GNUNET_TIME_absolute_get_remaining (h->
-                                                                     current->
-                                                                     timeout));
+                                 GNUNET_TIME_absolute_get_remaining
+                                 (h->current->timeout));
           return;
         }
       GNUNET_break (0);
@@ -422,8 +421,8 @@ transmit_get (struct GNUNET_STATISTICS_Handle *handle, size_t size, void *buf)
   GNUNET_CLIENT_receive (handle->client,
                          &receive_stats,
                          handle,
-                         GNUNET_TIME_absolute_get_remaining (handle->current->
-                                                             timeout));
+                         GNUNET_TIME_absolute_get_remaining (handle->
+                                                             current->timeout));
   return msize;
 }
 
index 08745c3781811ea1e04f9821006293889b40b5f0..6d160a76ef1c02ccf41828a4465db06d8d816d37 100644 (file)
@@ -1632,9 +1632,8 @@ cleanup_validation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                                   GNUNET_NO,
                                   GNUNET_SCHEDULER_PRIORITY_IDLE,
                                   GNUNET_SCHEDULER_NO_PREREQUISITE_TASK,
-                                  GNUNET_TIME_absolute_get_remaining (pos->
-                                                                      timeout),
-                                  &cleanup_validation, NULL);
+                                  GNUNET_TIME_absolute_get_remaining
+                                  (pos->timeout), &cleanup_validation, NULL);
 }
 
 
@@ -1725,7 +1724,9 @@ check_hello_validated (void *cls,
     {
       first_call = GNUNET_YES;
       chvc->e = GNUNET_malloc (sizeof (struct ValidationList));
-      GNUNET_HELLO_get_key (h != NULL ? h : chvc->hello, &chvc->e->publicKey);
+      GNUNET_assert (GNUNET_OK ==
+                     GNUNET_HELLO_get_key (h != NULL ? h : chvc->hello,
+                                           &chvc->e->publicKey));
       chvc->e->timeout =
         GNUNET_TIME_relative_to_absolute (HELLO_VERIFICATION_TIMEOUT);
       chvc->e->next = pending_validations;
@@ -1777,10 +1778,9 @@ check_hello_validated (void *cls,
                                   GNUNET_NO,
                                   GNUNET_SCHEDULER_PRIORITY_IDLE,
                                   GNUNET_SCHEDULER_NO_PREREQUISITE_TASK,
-                                  GNUNET_TIME_absolute_get_remaining (chvc->
-                                                                      e->
-                                                                      timeout),
-                                  &cleanup_validation, NULL);
+                                  GNUNET_TIME_absolute_get_remaining
+                                  (chvc->e->timeout), &cleanup_validation,
+                                  NULL);
   GNUNET_free (chvc);
 }
 
@@ -1935,6 +1935,11 @@ process_ping (struct TransportPlugin *plugin,
               "Trying to transmit PONG using inbound connection\n");
 #endif
   n = find_neighbour (sender);
+  if (n == NULL)
+    {
+      GNUNET_break (0);
+      return;
+    }
   transmit_to_peer (NULL, &vcr.header, GNUNET_YES, n);
 }
 
@@ -2350,13 +2355,11 @@ plugin_env_receive (void *cls,
  * by any client which causes us to add it to our list.
  *
  * @param cls closure (always NULL)
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_start (void *cls,
-              struct GNUNET_SERVER_Handle *server,
               struct GNUNET_SERVER_Client *client,
               const struct GNUNET_MessageHeader *message)
 {
@@ -2429,13 +2432,11 @@ handle_start (void *cls,
  * Handle HELLO-message.
  *
  * @param cls closure (always NULL)
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_hello (void *cls,
-              struct GNUNET_SERVER_Handle *server,
               struct GNUNET_SERVER_Client *client,
               const struct GNUNET_MessageHeader *message)
 {
@@ -2454,13 +2455,11 @@ handle_hello (void *cls,
  * Handle SEND-message.
  *
  * @param cls closure (always NULL)
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_send (void *cls,
-             struct GNUNET_SERVER_Handle *server,
              struct GNUNET_SERVER_Client *client,
              const struct GNUNET_MessageHeader *message)
 {
@@ -2515,13 +2514,11 @@ handle_send (void *cls,
  * Handle SET_QUOTA-message.
  *
  * @param cls closure (always NULL)
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_set_quota (void *cls,
-                  struct GNUNET_SERVER_Handle *server,
                   struct GNUNET_SERVER_Client *client,
                   const struct GNUNET_MessageHeader *message)
 {
@@ -2562,13 +2559,11 @@ handle_set_quota (void *cls,
  * Handle TRY_CONNECT-message.
  *
  * @param cls closure (always NULL)
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_try_connect (void *cls,
-                    struct GNUNET_SERVER_Handle *server,
                     struct GNUNET_SERVER_Client *client,
                     const struct GNUNET_MessageHeader *message)
 {
index eb69f4386681b49de24cb5e916287cb13d521a29..f7e06a9cdae59a70940288a113f7e9bf5d705b3d 100644 (file)
@@ -1006,8 +1006,9 @@ receiveContentCallback (void *ptr, size_t size, size_t nmemb, void *ctx)
           cpy = sizeof (GNUNET_MessageHeader) - httpSession->cs.client.rpos1;
           if (cpy > have)
             cpy = have;
-          memcpy (&httpSession->cs.client.
-                  rbuff1[httpSession->cs.client.rpos1], &inbuf[poff], cpy);
+          memcpy (&httpSession->cs.
+                  client.rbuff1[httpSession->cs.client.rpos1], &inbuf[poff],
+                  cpy);
           httpSession->cs.client.rpos1 += cpy;
           have -= cpy;
           poff += cpy;
@@ -1027,8 +1028,9 @@ receiveContentCallback (void *ptr, size_t size, size_t nmemb, void *ctx)
             httpSession->cs.client.rpos2;
           if (cpy > have)
             cpy = have;
-          memcpy (&httpSession->cs.client.
-                  rbuff2[httpSession->cs.client.rpos2], &inbuf[poff], cpy);
+          memcpy (&httpSession->cs.
+                  client.rbuff2[httpSession->cs.client.rpos2], &inbuf[poff],
+                  cpy);
           have -= cpy;
           poff += cpy;
           httpSession->cs.client.rpos2 += cpy;
index c87056e71e629f5461ba832f0827e4594806a015..9d82bead9f6dc457c8c96c8e3a1b0898c59f013f 100644 (file)
@@ -620,14 +620,16 @@ process_pending_messages (struct Session *session)
     return;
   session->transmit_handle
     = GNUNET_SERVER_notify_transmit_ready (session->client,
-                                           htons (session->pending_messages->
-                                                  msg->size) +
-                                           (session->pending_messages->
-                                            is_welcome ? 0 : sizeof (struct
-                                                                     DataMessage)),
+                                           htons (session->
+                                                  pending_messages->msg->
+                                                  size) +
+                                           (session->
+                                            pending_messages->is_welcome ? 0 :
+                                            sizeof (struct DataMessage)),
                                            GNUNET_TIME_absolute_get_remaining
-                                           (session->pending_messages[0].
-                                            timeout), &do_transmit, session);
+                                           (session->
+                                            pending_messages[0].timeout),
+                                           &do_transmit, session);
 }
 
 
@@ -1354,13 +1356,11 @@ tcp_plugin_address_suggested (void *cls, const void *addr, size_t addrlen)
  * our welcome.
  *
  * @param cls closure
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_tcp_welcome (void *cls,
-                    struct GNUNET_SERVER_Handle *server,
                     struct GNUNET_SERVER_Client *client,
                     const struct GNUNET_MessageHeader *message)
 {
@@ -1464,13 +1464,11 @@ delayed_done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * compute latency and forward.
  *
  * @param cls closure
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_tcp_data (void *cls,
-                 struct GNUNET_SERVER_Handle *server,
                  struct GNUNET_SERVER_Client *client,
                  const struct GNUNET_MessageHeader *message)
 {
index d6d4e2a967eb2b9ea1f0098d974e1cbf0f3a467f..8bca5084d3a9f6841cc311e0e48a13b6330d2de3 100644 (file)
@@ -1350,9 +1350,8 @@ request_connect (void *cls, size_t size, void *buf)
                                     GNUNET_NO,
                                     GNUNET_SCHEDULER_PRIORITY_KEEP,
                                     GNUNET_SCHEDULER_NO_PREREQUISITE_TASK,
-                                    GNUNET_TIME_absolute_get_remaining (th->
-                                                                        timeout),
-                                    &transmit_timeout, th);
+                                    GNUNET_TIME_absolute_get_remaining
+                                    (th->timeout), &transmit_timeout, th);
   insert_transmit_handle (&h->connect_wait_head, th);
   return sizeof (struct TryConnectMessage);
 }
@@ -1653,9 +1652,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
     default:
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   _
-                  ("Received unexpected message of type %u from `%4s' in %s:%u\n"),
-                  ntohs (msg->type), GNUNET_i2s (&im->peer), __FILE__,
-                  __LINE__);
+                  ("Received unexpected message of type %u in %s:%u\n"),
+                  ntohs (msg->type), __FILE__, __LINE__);
       GNUNET_break (0);
       break;
     }
index 9dd70f26606cbafb3d38df7baee59feb9723c417..e9b3f985a57f4af0a531db4e970180871b9f25f9 100644 (file)
@@ -202,8 +202,8 @@ check_complete (struct GNUNET_CLIENT_Connection *conn)
 {
   if ((conn->received_pos >= sizeof (struct GNUNET_MessageHeader)) &&
       (conn->received_pos >=
-       ntohs (((const struct GNUNET_MessageHeader *) conn->received_buf)->
-              size)))
+       ntohs (((const struct GNUNET_MessageHeader *) conn->
+               received_buf)->size)))
     conn->msg_complete = GNUNET_YES;
 }
 
index b61729e0642bfd7326899dbfae92c98e889e5fec..c5a6140f6bf0abca736ebc88c1e635d2e59065b5 100644 (file)
@@ -219,8 +219,8 @@ GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey
     GNUNET_CRYPTO_RSA_KEY_LENGTH - GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH;
   GNUNET_assert (0 ==
                  gcry_mpi_print (GCRYMPI_FMT_USG,
-                                 &result->
-                                 key[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH],
+                                 &result->key
+                                 [GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH],
                                  size, &size, skey[1]));
   adjust (&result->key[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH], size,
           GNUNET_CRYPTO_RSA_KEY_LENGTH -
@@ -704,6 +704,7 @@ GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename)
   enc = GNUNET_malloc (sbuf.st_size);
   GNUNET_assert (sbuf.st_size == READ (fd, enc, sbuf.st_size));
   len = ntohs (enc->len);
+  ret = NULL;
   if ((len != sbuf.st_size) || (NULL == (ret = rsa_decode_key (enc))))
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
index 22c1ca632ee3e38f99a3ba76149f53bfab47a674..7fd6f6c47eb7773beff577d1e6a88b297a1db91d 100644 (file)
@@ -294,8 +294,9 @@ GNUNET_NETWORK_socket_create_from_accept (struct GNUNET_SCHEDULER_Handle
                       inet_ntop (fam,
                                  (fam == AF_INET6)
                                  ? (const void *) &((struct sockaddr_in6 *)
-                                                    &addr)->
-                                 sin6_addr : (const void *)
+                                                    &addr)->sin6_addr : (const
+                                                                         void
+                                                                         *)
                                  &((struct sockaddr_in *) &addr)->sin_addr,
                                  msg, sizeof (msg)));
         }
index cb5ccb12a5be9a56a0ee9bde98f089c60e54d4de..4268772df5fd605324f91950419639c2aa112423 100644 (file)
@@ -135,9 +135,10 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
                       pTable->table[dwIfIdx].dwPhysAddrLen);
 
               snprintf (szEntry, 1000, "%s (%s - %I64u)",
-                        pszIfName ? pszIfName : (char *) pTable->
-                        table[dwIfIdx].bDescr, inet_ntop (AF_INET, &dwIP, dst,
-                                                          INET_ADDRSTRLEN),
+                        pszIfName ? pszIfName : (char *)
+                        pTable->table[dwIfIdx].bDescr, inet_ntop (AF_INET,
+                                                                  &dwIP, dst,
+                                                                  INET_ADDRSTRLEN),
                         *((unsigned long long *) bPhysAddr));
               szEntry[1000] = 0;
 
index 0d30910e078478848ea2d6315da3901eff71890b..a20b3da069045c108725d8a3f9e96764828baf71 100644 (file)
@@ -874,8 +874,8 @@ GNUNET_SCHEDULER_add_select (struct GNUNET_SCHEDULER_Handle * sched,
   task->timeout = GNUNET_TIME_relative_to_absolute (delay);
   task->priority =
     check_priority ((prio ==
-                     GNUNET_SCHEDULER_PRIORITY_KEEP) ? sched->
-                    current_priority : prio);
+                     GNUNET_SCHEDULER_PRIORITY_KEEP) ? sched->current_priority
+                    : prio);
   task->nfds = nfds;
   task->run_on_shutdown = run_on_shutdown;
   task->next = sched->pending;
index 91bc8cc7a65518fe2a7f8c6791747c0a6aa648fe..93981472580806c0efb9e8dbd4d98f8e8704b240 100644 (file)
@@ -565,7 +565,7 @@ GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server,
                 }
               if (sender != NULL)
                 sender->suspended++;
-              mh->callback (mh->callback_cls, server, sender, message);
+              mh->callback (mh->callback_cls, sender, message);
               found = GNUNET_YES;
             }
           i++;
index af71db692a567b97c756da1ab14f1a3816839f91..cf970323582c51df996e3cf816d36152117c9509 100644 (file)
@@ -545,13 +545,11 @@ write_test (void *cls, size_t size, void *buf)
  * Handler for TEST message.
  *
  * @param cls closure (refers to service)
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_test (void *cls,
-             struct GNUNET_SERVER_Handle *server,
              struct GNUNET_SERVER_Client *client,
              const struct GNUNET_MessageHeader *message)
 {
@@ -569,13 +567,11 @@ handle_test (void *cls,
  * Handler for SHUTDOWN message.
  *
  * @param cls closure (refers to service)
- * @param server the server handling the message
  * @param client identification of the client
  * @param message the actual message
  */
 static void
 handle_shutdown (void *cls,
-                 struct GNUNET_SERVER_Handle *server,
                  struct GNUNET_SERVER_Client *client,
                  const struct GNUNET_MessageHeader *message)
 {
@@ -805,8 +801,7 @@ setup_service (struct GNUNET_SERVICE_Context *sctx)
     {
       if (GNUNET_SYSERR ==
           (disablev6 = GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg,
-                                                             sctx->
-                                                             serviceName,
+                                                             sctx->serviceName,
                                                              "DISABLEV6")))
         return GNUNET_SYSERR;
     }
index 5c2e552e9b45f4c6c4f192765f1a5050a27f0244..3545b9fa98f8d3fc7bc15c23582f02a9246df5af 100644 (file)
@@ -70,7 +70,6 @@ copy_msg (void *cls, size_t size, void *buf)
  */
 static void
 echo_cb (void *cls,
-         struct GNUNET_SERVER_Handle *server,
          struct GNUNET_SERVER_Client *client,
          const struct GNUNET_MessageHeader *message)
 {
index c8555b5de4231085ee2388fc9a97db3383427a15..efce7cc050629d14df3443481f6cd5a17ff1ba20 100644 (file)
@@ -128,8 +128,8 @@ testEncryptDecrypt (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey)
     }
   printf ("%d RSA encrypt/decrypt operations %llums (%d failures)\n",
           ITER,
-          (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
-          value, ok);
+          (unsigned long long)
+          GNUNET_TIME_absolute_get_duration (start).value, ok);
   if (ok == 0)
     return GNUNET_OK;
   else
@@ -179,8 +179,8 @@ testSignVerify (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey)
     }
   printf ("%d RSA sign/verify operations %llums\n",
           ITER,
-          (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
-          value);
+          (unsigned long long)
+          GNUNET_TIME_absolute_get_duration (start).value);
   return ok;
 }
 
index e71decca8d2f250d73a8c758b66afb9422df4464..4456d68f45a7d6929a18981e3c804f3c3268b782 100644 (file)
@@ -83,8 +83,8 @@ testEncryptDecrypt ()
     }
   printf ("%d RSA encrypt/decrypt operations %llums (%d failures)\n",
           ITER,
-          (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
-          value, ok);
+          (unsigned long long)
+          GNUNET_TIME_absolute_get_duration (start).value, ok);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   if (ok == 0)
     return GNUNET_OK;
@@ -123,8 +123,8 @@ testEncryptPerformance ()
     }
   printf ("%d RSA encrypt operations %llu ms (%d failures)\n",
           ITER,
-          (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
-          value, ok);
+          (unsigned long long)
+          GNUNET_TIME_absolute_get_duration (start).value, ok);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   if (ok != 0)
     return GNUNET_SYSERR;
@@ -182,8 +182,8 @@ testEncryptDecryptSK ()
     }
   printf ("%d RSA encrypt/decrypt SK operations %llus (%d failures)\n",
           ITER,
-          (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
-          value, ok);
+          (unsigned long long)
+          GNUNET_TIME_absolute_get_duration (start).value, ok);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   if (ok != 0)
     return GNUNET_SYSERR;
@@ -237,8 +237,8 @@ testSignVerify ()
     }
   printf ("%d RSA sign/verify operations %llums\n",
           ITER,
-          (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
-          value);
+          (unsigned long long)
+          GNUNET_TIME_absolute_get_duration (start).value);
   GNUNET_CRYPTO_rsa_key_free (hostkey);
   return ok;
 }
index 8312b721ffef064f3031bc3be9e851272125117f..cf50f4ec1409f6331f6179ea17bf66adb92efcb5 100644 (file)
@@ -117,6 +117,7 @@ run_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   expect.sin_port = v4->sin_port;
   expect.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
   GNUNET_assert (0 == memcmp (&expect, v4, alen));
+  GNUNET_free (addr);
   GNUNET_NETWORK_socket_destroy (lsock);
   GNUNET_NETWORK_receive (asock,
                           1024,
index e3df0b456472732ce95c02ae942517c46b1d0fd9..475d411db74060c0ac5751b544c3b0abfc5a1d5f 100644 (file)
@@ -40,7 +40,6 @@ static struct GNUNET_SCHEDULER_Handle *sched;
 
 static void
 recv_fin_cb (void *cls,
-             struct GNUNET_SERVER_Handle *server,
              struct GNUNET_SERVER_Client *client,
              const struct GNUNET_MessageHeader *message)
 {
@@ -177,7 +176,6 @@ copy_msg (void *cls, size_t size, void *buf)
 
 static void
 recv_cb (void *cls,
-         struct GNUNET_SERVER_Handle *server,
          struct GNUNET_SERVER_Client *argclient,
          const struct GNUNET_MessageHeader *message)
 {
index 60604b35ce288c855f7cfc778d33dce82106175c..7eab4828445dc160213509fe749c8a74142d0b2f 100644 (file)
@@ -67,7 +67,6 @@ server_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 recv_cb (void *cls,
-         struct GNUNET_SERVER_Handle *server,
          struct GNUNET_SERVER_Client *argclient,
          const struct GNUNET_MessageHeader *message)
 {
index 4ca2b5bc31f12f299732cb00081380fd1c86bb29..22cf2cded40289256768aa17fe281b50cb287e0b 100644 (file)
@@ -59,7 +59,6 @@ send_done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 recv_cb (void *cls,
-         struct GNUNET_SERVER_Handle *server,
          struct GNUNET_SERVER_Client *argclient,
          const struct GNUNET_MessageHeader *message)
 {
index b5cf0805ef21daaf0df16a0dd3a5ce17705cf679..ab8eca359466a827de0066e7d15c48f0a8d7c488 100644 (file)
@@ -92,7 +92,6 @@ ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 static void
 recv_cb (void *cls,
-         struct GNUNET_SERVER_Handle *server,
          struct GNUNET_SERVER_Client *client,
          const struct GNUNET_MessageHeader *message)
 {