]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Modifications to transports.c for the unit tests to work.
authorGeorge Kadianakis <desnacked@riseup.net>
Mon, 29 Jul 2013 14:01:10 +0000 (16:01 +0200)
committerNick Mathewson <nickm@torproject.org>
Wed, 31 Jul 2013 17:34:16 +0000 (13:34 -0400)
Both 'managed_proxy_list' and 'unconfigured_proxies_n' are global
src/or/transports.c variables that are not initialized properly when
unit tests are run.

src/or/transports.c

index 3aced21b3d812e425885d9d82b7148a058ff3e5f..0bd024fab7c33a61cd8b39c4cfc36aa37c3396b8 100644 (file)
@@ -712,7 +712,8 @@ managed_proxy_destroy(managed_proxy_t *mp,
   smartlist_free(mp->transports_to_launch);
 
   /* remove it from the list of managed proxies */
-  smartlist_remove(managed_proxy_list, mp);
+  if (managed_proxy_list)
+    smartlist_remove(managed_proxy_list, mp);
 
   /* free the argv */
   free_execve_args(mp->argv);
@@ -749,7 +750,6 @@ handle_finished_proxy(managed_proxy_t *mp)
   }
 
   unconfigured_proxies_n--;
-  tor_assert(unconfigured_proxies_n >= 0);
 }
 
 /** Return true if the configuration of the managed proxy <b>mp</b> is