-fix #2378
authorChristian Grothoff <christian@grothoff.org>
Sun, 27 May 2012 17:41:52 +0000 (17:41 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 27 May 2012 17:41:52 +0000 (17:41 +0000)
src/ats/ats_api_scheduling.c
src/fs/fs_search.c
src/include/gnunet_ats_service.h
src/include/gnunet_transport_plugin.h

index 583ada8f7eaa062b7123d39097906d2257c59532..5a4e8831f32964cb440a9e3df57030d5996ae520 100644 (file)
@@ -145,7 +145,6 @@ struct GNUNET_ATS_SchedulingHandle
    */
   struct ATS_Network * net_tail;
 
-
   /**
    * Array of session objects (we need to translate them to numbers and back
    * for the protocol; the offset in the array is the session number on the
@@ -162,7 +161,6 @@ struct GNUNET_ATS_SchedulingHandle
   /**
    * Task retrieving interfaces from the system
    */
-
   GNUNET_SCHEDULER_TaskIdentifier interface_task;
 
 
@@ -619,10 +617,10 @@ reconnect (struct GNUNET_ATS_SchedulingHandle *sh)
   do_transmit (sh);
 }
 
+
 /**
  * delete the current network list
  */
-
 static void
 delete_networks (struct GNUNET_ATS_SchedulingHandle *sh)
 {
@@ -735,7 +733,6 @@ interface_proc (void *cls, const char *name,
 }
 
 
-
 /**
  * Periodically get list of addresses
  * @param cls closure
@@ -753,14 +750,15 @@ get_addresses (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                                                      sh);
 }
 
+
 /**
  * Returns where the address is located: LAN or WAN or ...
+ *
  * @param sh the scheduling handle
  * @param addr address
  * @param addrlen address length
  * @return location as GNUNET_ATS_Information
  */
-
 struct GNUNET_ATS_Information
 GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle * sh, const struct sockaddr * addr, socklen_t addrlen)
 {
@@ -852,6 +850,7 @@ GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle * sh, const stru
   return (const struct GNUNET_ATS_Information) ats;
 }
 
+
 /**
  * Initialize the ATS subsystem.
  *
@@ -959,6 +958,8 @@ GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *sh,
   struct PendingMessage *p;
   struct RequestAddressMessage *m;
 
+  // FIXME: ATS needs to remember this in case of
+  // a disconnect!
   p = GNUNET_malloc (sizeof (struct PendingMessage) +
                      sizeof (struct RequestAddressMessage));
   p->size = sizeof (struct RequestAddressMessage);
@@ -999,6 +1000,7 @@ GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SchedulingHandle *sh,
   do_transmit (sh);
 }
 
+
 /**
  * We have updated performance statistics for a given address.  Note
  * that this function can be called for addresses that are currently
@@ -1123,10 +1125,10 @@ GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh,
   memcpy (pm, address->address, address->address_length);
   memcpy (&pm[address->address_length], address->transport_name, namelen);
   GNUNET_CONTAINER_DLL_insert_tail (sh->pending_head, sh->pending_tail, p);
-
   do_transmit (sh);
 }
 
+
 /**
  * A session got destroyed, stop including it as a valid address.
  *
index 3eacbe9cbd93ac437c7fbd696163fcb3499eb570..b280670f66d1f60e7041a010d8bba170896bc930 100644 (file)
@@ -1583,7 +1583,7 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc)
   GNUNET_CONTAINER_multihashmap_iterate (sc->master_result_map,
                                          &search_result_free, sc);
   GNUNET_CONTAINER_multihashmap_destroy (sc->master_result_map);
-  if (NULL == sc->requests)
+  if (NULL != sc->requests)
   {
     GNUNET_assert (GNUNET_FS_uri_test_ksk (sc->uri));
     for (i = 0; i < sc->uri->data.ksk.keywordCount; i++)
index a5f1bdc23c96b6cc10dbb2c7eb7b876163e3d4c1..aa7a0891620619f2f791c273d39ad7318fb987cd 100644 (file)
@@ -605,6 +605,7 @@ GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh,
                            const struct GNUNET_HELLO_Address *address,
                            struct Session *session, int in_use);
 
+
 /**
  * A session got destroyed, stop including it as a valid address.
  *
index 1e46c92f8c65648aa88536fd27669eeda6db4e57..6039809f79bef7c8c992400a2c4f516854048dff 100644 (file)
@@ -313,11 +313,12 @@ typedef void (*GNUNET_TRANSPORT_TransmitContinuation) (void *cls,
  *         and does NOT mean that the message was not transmitted (DV)
  */
 typedef ssize_t (*GNUNET_TRANSPORT_TransmitFunction) (void *cls,
-    struct Session *session,
-    const char *msgbuf, size_t msgbuf_size,
-    unsigned int priority,
-    struct GNUNET_TIME_Relative to,
-    GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls);
+                                                     struct Session *session,
+                                                     const char *msgbuf, size_t msgbuf_size,
+                                                     unsigned int priority,
+                                                     struct GNUNET_TIME_Relative to,
+                                                     GNUNET_TRANSPORT_TransmitContinuation cont,
+                                                     void *cont_cls);
 
 
 /**