From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <13b301c32900$56569700$644cb2cc@kds> From: "David Butler" To: <9fans@cse.psu.edu> References: <3EDB3B44.8030805@proweb.co.uk> Subject: Re: [9fans] httpd scripting MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Date: Mon, 2 Jun 2003 07:12:51 -0500 Topicbox-Message-UUID: c1c6e3ba-eacb-11e9-9e20-41e7f4b1d025 I did a lot of work in the http area on Plan 9, back on version 2 of the system. I took the approach that anything is executable (compiled) instead of scripting. It was fast and very flexible. Perhaps I can see what it takes to get it on version 4 and make it available... David ----- Original Message ----- From: "matt" To: <9fans@cse.psu.edu> Sent: Monday, June 02, 2003 6:55 AM Subject: Re: [9fans] httpd scripting > Skip Tavakkolian wrote: > > >Has anyone done any deep thinking on this? I've just started > >looking into it. I have looked at Pegasus, but I need something a > >little more specialized. My own preference is for an awk-like environment > >but nothing definite yet. I want to process code fragments inside > >html docs, the same thing as jsp,asp,php, etc. > > > > as someone who uses PHP (and previously ASP) professionally - don't 8) > > RC and friends is enough > > if want awk then use awk 8) > > as for cookies, headers etc. you just need a quick script to chuck the > request into the environment (which is what PHP does) > > I did write a script to do it once > > http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&threadm=015d01c22ed3%24fcc596e0%246501a8c0%40KIKE&rnum=1&prev=/groups%3Fq%3Dgroup:comp.os.plan9%2Bhttpd%2Bmatt%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26safe%3Doff%26selm%3D015d01c22ed3%2524fcc596e0%25246501a8c0%2540KIKE%26rnum%3D1 > > but I seem to have lost the code during a re-install (curses for putting > the magic directory outside of /usr ) > > All you really need to do is split the headers on the first colon : > ([^:]+): ?(.*) > > (after skipping past the first line) > and then pop the results into the environment > > echo $match_2 > /env/$match_1 > > when you run out of matches the rest of stdin is the body & you might > even be able to trust the Content-Length value > > > > >