Dave Kuhlman said: > So, is there some documentation somewhere on how to get the value > corresponding to the following CGI variables? I've put a note Basicaly, you have to go through the C API reference and scan through the names and what they do, just like the Tcl API. There isn't a real "how-to" document.
Not having done any AOLserver C hacking myself, but being very familiar with the Tcl API, whose command names are very similar to their C counterparts, here's some more for your list: > SERVER_SOFTWARE > SERVER_ADMIN > SERVER_ADDR > SERVER_PORT Try the Ns_Info*() commands, also Ns_ConnHost(), Ns_ConnPort() > DOCUMENT_ROOT Ns_PageRoot() > SERVER_PROTOCOL > SERVER_NAME -- Ns_ConnServer() > REMOTE_ADDR Ns_ConnPeer() > REMOTE_PORT -- Ns_ConnPort() Ns_ConnPeerPort() > REQUEST_METHOD Tcl is ns_conn method, but can't find a C version of that! > SCRIPT_NAME Would there be any? C modules handling request are not like having a .pl file when using CGI. > PATH_INFO Not sure what that one is supposed to do! > HTTP_USER_AGENT > HTTP_COOKIE > HTTP_ACCEPT > HTTP_REFERER Use Ns_ConnHeaders() to get an Ns_Set with all the headers sent by the client. AOLserver does noet have built in cookie handling. They aren't exactly rocket science, though. Check the Cookie spec (http://wp.netscape.com/newsref/std/cookie_spec.html) for making your own handler. > In particular, I need the SCRIPT_NAME. For example, if the ... > then I need to be able to retrieve "/xxx/yyy/zzz". And, since I I see, you want the URL, not the actual script! (which doesn't exist...) Hmmm. In Tcl, this would be "ns_conn url", but I don't see an equivalent in the C API! > did *not* use flag NS_OP_NOINHERIT when I called > Ns_RegisterRequest(), I don't know what that is. No inherit means exact URL only. If you register proc A for "/foo" with no inherit, it would only run when exactly "/foo" is called. If you don't specify no_inherit, the script also runs for "/foo/bar/1234.html". > I did a test, and found that these are *not* available as > environment variables when my registered C function is called. Nope, enviroment variables are a CGI thing, AOLserver sets none, not in C, nor in Tcl. All is done through functions. > I've read the C examples (at Examples are very basic, take some time to scan through the API, much more usefull. Hope that helps! Bas. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
