[tor-commits] [tor/release-0.2.3] Improve log message issued when a managed proxy fails to launch.

nickm at torproject.org nickm at torproject.org
Thu Jun 28 20:00:57 UTC 2012


commit 8c3a4a1d21870254b38327a859bd27026058f3b2
Author: George Kadianakis <desnacked at riseup.net>
Date:   Sat Jun 23 17:36:16 2012 +0300

    Improve log message issued when a managed proxy fails to launch.
---
 changes/bug5099     |    3 +++
 src/or/transports.c |   14 +++++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/changes/bug5099 b/changes/bug5099
new file mode 100644
index 0000000..ddcd03a
--- /dev/null
+++ b/changes/bug5099
@@ -0,0 +1,3 @@
+  o Minor features:
+    - Improve log message issued when a managed proxy fails to
+      launch. Resolves ticket 5099.
diff --git a/src/or/transports.c b/src/or/transports.c
index 1522756..e43ec6c 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -697,7 +697,19 @@ handle_proxy_line(const char *line, managed_proxy_t *mp)
 
     return;
   } else if (!strcmpstart(line, SPAWN_ERROR_MESSAGE)) {
-    log_warn(LD_GENERAL, "Could not launch managed proxy executable!");
+    /* managed proxy launch failed: parse error message to learn why. */
+    int retval, child_state, saved_errno;
+    retval = tor_sscanf(line, SPAWN_ERROR_MESSAGE "%x/%x",
+                        &child_state, &saved_errno);
+    if (retval == 2) {
+      log_warn(LD_GENERAL,
+               "Could not launch managed proxy executable at '%s' ('%s').",
+               mp->argv[0], strerror(saved_errno));
+    } else { /* failed to parse error message */
+      log_warn(LD_GENERAL,"Could not launch managed proxy executable at '%s'.",
+               mp->argv[0]);
+    }
+
     mp->conf_state = PT_PROTO_FAILED_LAUNCH;
     return;
   }





More information about the tor-commits mailing list