-doxygen
[oweals/gnunet.git] / src / transport / plugin_transport_http.c
index 637e74063048cd3a8574acbea04805c960d2172d..42743fc9624d455eb2ece093a7081b6c968ce8b4 100644 (file)
@@ -52,36 +52,6 @@ struct HttpAddressWrapper
   struct HttpAddress *addr;
 };
 
-/**
- * Context for address to string conversion.
- */
-struct PrettyPrinterContext
-{
-  /**
-   * Function to call with the result.
-   */
-  GNUNET_TRANSPORT_AddressStringCallback asc;
-
-  /**
-   * Plugin
-   */
-  struct Plugin *plugin;
-
-  /**
-   * Clsoure for 'asc'.
-   */
-  void *asc_cls;
-
-  /**
-   * Port to add after the IP address.
-   */
-  uint16_t port;
-
-  uint32_t addrlen;
-
-  int numeric;
-};
-
 
 /**
  * Encapsulation of all of the state of the plugin.
@@ -106,6 +76,7 @@ reschedule_session_timeout (struct Session *s);
 static void
 stop_session_timeout (struct Session *s);
 
+
 /**
  * Convert the transports address to a nice, human-readable
  * format.
@@ -118,7 +89,7 @@ stop_session_timeout (struct Session *s);
  * @param numeric should (IP) addresses be displayed in numeric form?
  * @param timeout after how long should we give up?
  * @param asc function to call on each string
- * @param asc_cls closure for asc
+ * @param asc_cls closure for @a asc
  */
 static void
 http_plugin_address_pretty_printer (void *cls, const char *type,
@@ -128,9 +99,9 @@ http_plugin_address_pretty_printer (void *cls, const char *type,
                                     GNUNET_TRANSPORT_AddressStringCallback asc,
                                     void *asc_cls)
 {
-  GNUNET_assert (cls != NULL);
-  struct HttpAddress *haddr = (struct HttpAddress *) addr;
+  const struct HttpAddress *haddr = addr;
 
+  GNUNET_assert (cls != NULL);
   if (addrlen < (sizeof (struct HttpAddress)))
   {
     /* invalid address */
@@ -216,7 +187,7 @@ http_plugin_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
  * @param added length of created address
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int 
+int
 http_string_to_address (void *cls,
                        const char *addr,
                        uint16_t addrlen,
@@ -363,7 +334,7 @@ lookup_session_old (struct Plugin *plugin, const struct GNUNET_PeerIdentity *tar
       e_peer = GNUNET_YES;
       if ( (addrlen == t->addrlen) &&
           (0 == memcmp (addr, t->addr, addrlen)) )
-       e_addr = GNUNET_YES;    
+       e_addr = GNUNET_YES;
       if ( (t == session) &&
           (t->addrlen == session->addrlen) &&
           (0 == memcmp (session->addr, t->addr, t->addrlen)) )