From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <97a49263e0b4c855f2f2a42975a9b8bc@9netics.com> Date: Sun, 19 Apr 2009 19:02:55 -0300 Message-ID: <32d987d50904191502n2840a634p4bceade966c82d1b@mail.gmail.com> From: "Federico G. Benavento" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] web server Topicbox-Message-UUID: e96c86c8-ead4-11e9-9d60-3106f5b1d025 skip is pretty much on the point exactly the same convention is valid for cgifs. http://machine/cgifs/script?var0=3Dval0&var1=3Dval1 cgi as cgifs are programs that parse the requested uri and from there, after the 2nd '/', get the script name "script" in the example above. On Sun, Apr 19, 2009 at 2:05 PM, erik quanstrom wro= te: > On Sun Apr 19 12:03:54 EDT 2009, 9nut@9netics.com wrote: >> you could make local mods to your httpd so that paths starting with >> /cgi are given similar treatment as those that start with /magic; it >> would execute "cgi" and pass it the arguments as usual. =C2=A0then url i= s: >> >> http://myserver/cgi/foo?var1=3D1&var2=3D2 >> >> and in script "foo" the $QUERY_STRING will be "var1=3D1&var2=3D2" > > if you look at /sys/src/cmd/ip/httpd/init.c you'll see that > argv[3] is the query string. > > minooka; g req.search init.c > init.c:97: =C2=A0 =C2=A0 =C2=A0connect.req.search =3D argv[3]; > > there has been some recent reorganization of httpd.c > that i haven't carefully looked at. > > about the same time i made a few modifications of my > own to eliminate some bad interactions between magic, > @ and other redirections. =C2=A0i don't recall the senerio > exactly, but depending on the situation, arguments > could be parsed or not parsed. > > if anyone else needs that, i'd be glad to put it on sources. > > - erik > > --=20 Federico G. Benavento