(no commit message)
[oweals/gnunet.git] / src / transport / transport_api_blacklist.c
index 5d2d616e81c9c3fad38ecc22e97ed3b1017ef074..2315b515f8c436a739d92e4f61a9f09732751e3e 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -44,11 +44,6 @@ struct GNUNET_TRANSPORT_Blacklist
    */
   struct GNUNET_CLIENT_Connection * client;
 
-  /**
-   * Scheduler to use.
-   */
-  struct GNUNET_SCHEDULER_Handle *sched;
-
   /**
    * Configuration to use.
    */
@@ -56,7 +51,7 @@ struct GNUNET_TRANSPORT_Blacklist
 
   /**
    * Pending handle for the current request.
-   */ 
+   */
   struct GNUNET_CLIENT_TransmitHandle *th;
 
   /**
@@ -68,7 +63,7 @@ struct GNUNET_TRANSPORT_Blacklist
   /**
    * Closure for 'cb'.
    */
-  void *cb_cls;  
+  void *cb_cls;
 
   /**
    * Peer currently under consideration.
@@ -108,7 +103,7 @@ query_handler (void *cls,
 {
   struct GNUNET_TRANSPORT_Blacklist *br = cls;
   const struct BlacklistMessage *bm;
-  
+
   if ( (ntohs(msg->size) != sizeof (struct BlacklistMessage)) ||
        (ntohs(msg->type) != GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_QUERY) )
     {
@@ -118,7 +113,7 @@ query_handler (void *cls,
   bm = (const struct BlacklistMessage *)msg;
   GNUNET_break (0 == ntohl (bm->is_allowed));
   br->peer = bm->peer;
-  reply (br);  
+  reply (br);
 }
 
 
@@ -175,9 +170,9 @@ reconnect (struct GNUNET_TRANSPORT_Blacklist *br)
 {
   if (br->client != NULL)
     GNUNET_CLIENT_disconnect (br->client, GNUNET_NO);
-  br->client = GNUNET_CLIENT_connect (br->sched,
-                                     "transport",
+  br->client = GNUNET_CLIENT_connect ("transport",
                                      br->cfg);
+  GNUNET_assert (br->client != NULL);
   br->th = GNUNET_CLIENT_notify_transmit_ready (br->client,
                                                sizeof (struct GNUNET_MessageHeader),
                                                GNUNET_TIME_UNIT_FOREVER_REL,
@@ -248,34 +243,31 @@ reply (struct GNUNET_TRANSPORT_Blacklist *br)
  * only way to re-enable connections from peers that were previously
  * blacklisted.
  *
- * @param sched scheduler to use
  * @param cfg configuration to use
  * @param cb callback to invoke to check if connections are allowed
  * @param cb_cls closure for cb
  * @return NULL on error, otherwise handle for cancellation
  */
 struct GNUNET_TRANSPORT_Blacklist *
-GNUNET_TRANSPORT_blacklist (struct GNUNET_SCHEDULER_Handle *sched,
-                           const struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg,
                            GNUNET_TRANSPORT_BlacklistCallback cb,
                            void *cb_cls)
 {
   struct GNUNET_CLIENT_Connection * client;
   struct GNUNET_TRANSPORT_Blacklist *ret;
 
-  client = GNUNET_CLIENT_connect (sched, "transport", cfg);
+  client = GNUNET_CLIENT_connect ("transport", cfg);
   if (NULL == client)
     return NULL;
   ret = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_Blacklist));
   ret->client = client;
-  ret->sched = sched;
   ret->cfg = cfg;
   ret->th = GNUNET_CLIENT_notify_transmit_ready (client,
                                                 sizeof (struct GNUNET_MessageHeader),
                                                 GNUNET_TIME_UNIT_FOREVER_REL,
                                                 GNUNET_YES,
                                                 &transmit_blacklist_init,
-                                                ret);  
+                                                ret);
   return ret;
 }