From d0ba6125a766164b46f8ef533857c946fb7bd733 Mon Sep 17 00:00:00 2001
From: "Silas S. Brown" <ssb22@cam.ac.uk>
Date: Fri, 11 Jul 2014 18:18:58 +0000
Subject: [PATCH] Update adjuster/annogen

git-svn-id: http://svn.code.sf.net/p/e-guidedog/code/ssb22/adjuster@1998 29193198-4895-4776-b068-10539e920549
---
 adjuster.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/adjuster.py b/adjuster.py
index 81f516d..4ecb9e9 100755
--- a/adjuster.py
+++ b/adjuster.py
@@ -204,6 +204,18 @@ while True:
   elif interval < 30: interval *= 2
   time.sleep(0.1)
 # ---------- cut here ---------- """
+# and if you then need to forward to the adjuster from a CGI
+# script (for example because the adjuster itself can't be
+# run on port 80) then try something like this:
+"""# ---------- cut here ----------
+#!/bin/bash
+export URL=http://localhost:28080/LetMeIn # or whatever
+export T=$(mktemp /dev/shm/XXXXXX) ; cat > $T
+export T2=$(mktemp /dev/shm/XXXXXX)
+wget --post-file $T -q -O - "$URL" > $T2
+echo "Content-Length: $(wc -c < $T2)" # please don't "chunk" it
+echo ; cat $T2 ; rm $T $T2
+# ---------- cut here ---------- """
 
 heading("Media conversion options")
 define("bitrate",default=0,help="Audio bitrate for MP3 files, or 0 to leave them unchanged. If this is set to anything other than 0 then the 'lame' program must be present. Bitrate is normally a multiple of 8. If your mobile device has a slow link, try 16 for speech.")
-- 
GitLab