commit 3dd1a5bc9fc0c1da9a132c07a7dd3b1c2b9d7e26
parent f3f89a65f6c826fd232f113e47a661a01d3870c6
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 4 May 2025 13:55:31 +0200
improve logging, log child helper status on resume, fix sed invocations for postal challenger
Diffstat:
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/challenger/challenger-httpd_challenge.c b/src/challenger/challenger-httpd_challenge.c
@@ -287,7 +287,10 @@ child_done_cb (void *cls,
long unsigned int exit_code)
{
struct ChallengeContext *bc = cls;
+ struct GNUNET_AsyncScopeSave old_scope;
+ GNUNET_async_scope_enter (&bc->hc->async_scope_id,
+ &old_scope);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Child done with exit code %d/%llu\n",
(int) type,
@@ -302,6 +305,7 @@ child_done_cb (void *cls,
bc_tail,
bc);
CH_trigger_daemon ();
+ GNUNET_async_scope_restore (&old_scope);
}
@@ -652,6 +656,11 @@ CH_handler_challenge (struct CH_HandlerContext *hc,
return MHD_NO;
}
/* Handle case where helper process failed */
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Checking child process status: %d / %d (%s)\n",
+ (int) bc->pst,
+ (int) bc->exit_code,
+ NULL == bc->child ? "dead" : "running");
if ( (GNUNET_OS_PROCESS_UNKNOWN != bc->pst) &&
(NULL == bc->child) &&
( (GNUNET_OS_PROCESS_EXITED != bc->pst) ||
diff --git a/src/challenger/challenger-send-post.sh b/src/challenger/challenger-send-post.sh
@@ -792,14 +792,17 @@ in
;;
esac
-# Convert new lines to "\\" for LaTeX, but without trailing new-line
+# Convert new lines to " " for LaTeX. excluding trailing new-line
# at the end if present:
-ADDRESS_TEX=$(echo -n "${ADDRESS_LINES%$'\n'}" | awk '{printf "%s\\\\\n", $0}')
+CONTACT_TEX=$(echo -n "${CONTACT_NAME%$'\n'}" | awk '{printf "%s ", $0}')
+# Convert new lines to "\\ " for LaTeX, but without trailing new-line
+# at the end if present:
+ADDRESS_TEX=$(echo -n "${ADDRESS_LINES%$'\n'}" | awk '{printf "%s\\\\ ", $0}')
MYDIR=$(mktemp -d /tmp/authorization-post-XXXXXX)
cd "$MYDIR"
-sed -e "s/%NAME%/$CONTACT_NAME/g" \
+sed -e "s/%NAME%/$CONTACT_TEX/g" \
-e "s/%ADDRESS_TEX%/$ADDRESS_TEX/g" \
-e "s/%COUNTRY%/$COUNTRY/g" > input.tex <<EOF
\NeedsTeXFormat{LaTeX2e}