swerc

anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

commit 56ac10a21c2746f99b4239c6b538ac16dbc30abe
parent 7edfe233afa645d887c349519c448cf21b1eeb4e
Author: kris@engel.se.cat-v.org <unknown>
Date:   Mon,  4 Jun 2007 06:02:00 +0200

Blockbuffer all output.
Diffstat:
Mbin/controller.rc | 16++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/bin/controller.rc b/bin/controller.rc @@ -124,6 +124,18 @@ if (! ~ $#sidebar 0) if (test -d $body) body=$body/index +fn template { + template.awk | rc | + awk '{ + buf = buf $0"\n" + if(length(buf) > 8192) { + printf "%s", buf + buf = "" + } + } + END{ printf "%s", buf }' +} + # RSS fn statpost { f = $1 @@ -146,7 +158,7 @@ fn statpost { } if(! ~ $REQUEST_URI */index.rss) { - cat $headers $template | template.awk | rc + cat $headers $template | template exit } @@ -154,7 +166,7 @@ uri = `{echo $uri | sed 's/indexrss$//'} uri=$baseuri$"uri # Should be in a separate file. -cat <<'!' | template.awk | rc +cat <<'!' | template <?xml version="1.0"?> <rss version="2.0"> <channel>