-simplify logic
[oweals/gnunet.git] / src / transport / transport_api_address_to_string.c
index afd0c7deb91babf14c61561c0cea3fc0f3c2b38d..26073cd2d74d9634484723e4358bd4f15ed1379f 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009-2014 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009-2014 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -76,8 +76,7 @@ address_response_processor (void *cls,
     alucb->cb (alucb->cb_cls,
                NULL,
                GNUNET_SYSERR);
-    GNUNET_CLIENT_disconnect (alucb->client);
-    GNUNET_free (alucb);
+    GNUNET_TRANSPORT_address_to_string_cancel (alucb);
     return;
   }
   GNUNET_break (ntohs (msg->type) ==
@@ -90,8 +89,7 @@ address_response_processor (void *cls,
     alucb->cb (alucb->cb_cls,
                NULL,
                GNUNET_SYSERR);
-    GNUNET_CLIENT_disconnect (alucb->client);
-    GNUNET_free (alucb);
+    GNUNET_TRANSPORT_address_to_string_cancel (alucb);
     return;
   }
   atsm = (const struct AddressToStringResultMessage *) msg;
@@ -126,8 +124,7 @@ address_response_processor (void *cls,
     alucb->cb (alucb->cb_cls,
                NULL,
                GNUNET_OK);
-    GNUNET_CLIENT_disconnect (alucb->client);
-    GNUNET_free (alucb);
+    GNUNET_TRANSPORT_address_to_string_cancel (alucb);
     return;
   }
   address = (const char *) &atsm[1];
@@ -139,8 +136,7 @@ address_response_processor (void *cls,
     alucb->cb (alucb->cb_cls,
                NULL,
                GNUNET_SYSERR);
-    GNUNET_CLIENT_disconnect (alucb->client);
-    GNUNET_free (alucb);
+    GNUNET_TRANSPORT_address_to_string_cancel (alucb);
     return;
   }
   /* expect more replies */