]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Improve log message issued when a managed proxy fails to launch.
authorGeorge Kadianakis <desnacked@riseup.net>
Sat, 23 Jun 2012 14:36:16 +0000 (17:36 +0300)
committerNick Mathewson <nickm@torproject.org>
Sat, 23 Jun 2012 19:05:46 +0000 (15:05 -0400)
changes/bug5099 [new file with mode: 0644]
src/or/transports.c

diff --git a/changes/bug5099 b/changes/bug5099
new file mode 100644 (file)
index 0000000..ddcd03a
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor features:
+    - Improve log message issued when a managed proxy fails to
+      launch. Resolves ticket 5099.
index 1522756a5236fa2f3d2dc4240ba80adfa03dc57b..e43ec6c4809af516b580f77bd7296609d6ab42a3 100644 (file)
@@ -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;
   }