I'm writing a function to handle certain requests.  I've
registered this function with Ns_RegisterRequest(). My module
loads and my function is called to process requests.  So I'm doing
good so far.

But there is some information I can't get my hands on.  I've
looked lots of the AOLserver C API documentation, but have not
found much about this.

I need to be able, from my registered function, to retrieve things
like the script name/path, the remote (client) address, etc.

So, is there some documentation somewhere on how to get the value
corresponding to the following CGI variables?  I've put a note
next to the ones that I've figured out:

    SERVER_SOFTWARE
    SERVER_PROTOCOL
    SERVER_NAME      -- Ns_ConnServer()
    SERVER_ADMIN
    SERVER_ADDR
    SERVER_PORT
    REMOTE_ADDR
    REMOTE_PORT      -- Ns_ConnPort()
    REMOTE_USER      -- Ns_ConnAuthUser() ?
    REQUEST_METHOD
    REQUEST_URI      -- Ns_ConnLocation() returns the base URL,
                              but not the whole URI.
    QUERY_STRING     -- Ns_ConnGetQuery()
    SCRIPT_NAME
    PATH_INFO
    HTTP_USER_AGENT
    HTTP_COOKIE
    HTTPS
    CONTENT_TYPE
    DOCUMENT_ROOT
    HTTP_ACCEPT
    HTTP_REFERER

In particular, I need the SCRIPT_NAME.  For example, if the
request is:

    http://www.myhost.com/xxx/yyy/zzz

then I need to be able to retrieve "/xxx/yyy/zzz".  And, since I
did *not* use flag NS_OP_NOINHERIT when I called
Ns_RegisterRequest(), I don't know what that is.

I did a test, and found that these are *not* available as
environment variables when my registered C function is called.

Is there a struct somewhere that contains some of these items?

I've read the C examples (at
http://aolserver.com/docs/devel/c/c-examples.html).
But, none of them seem to show any awareness of the client, the
request, etc.

I've been able to find a few, but can't find the rest.  Is there a
document somewhere about this.  It'd be great if there were a
document on how to convert a CGI application written in C into an
AOLserver loadable module with a registered function.

One additional question -- Many functions return a char *.  Am I
correct that these return a pointer to a const char *?  So I do
not need to free these, right?

Thanks for help and pointers.

Dave

--
Dave Kuhlman
[EMAIL PROTECTED]
http://www.rexx.com/~dkuhlman


--
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.

Reply via email to