In a message dated 4/1/2003 7:00:38 PM Eastern Standard Time, [EMAIL PROTECTED] writes:

"ns_http wait" command ignores numeric and string HTTP status returned
from server. "ns_http wait" returns a boolean success status - perhaps
that should be changed to a numeric HTTP status or new parameter should
be introduced for this purpose.


After further inspection of the code, it turns out that you should already have what you need.

For those playing along from home, Alex is describing a new AOLserver 4.0 API that allows one to make non blocking HTTP requests. This code was originally written for Digital City, but has been folded into the 4.0 code. The code itself is in aolserver/nsd/tclhttp.c.

To answer your question Alex, the HTTP result code is set as the name attribute of the ns_set, which can optionally be passed to the "ns_http wait" command. Let's look at the following example:

set timeout 2
set httpId [ns_http queue http://www.aol.com]
set setId [ns_set create]

ns_http wait $httpId result $timeout $setId

# HTTP status

set httpStatusStr [ns_set name $setId]
set httpStatusCode [lindex [split $httpStatusStr] 1]

# Remaining HTTP header key/value pairs

foreach {key value} [ns_set array $setId] {
    ns_log notice "$key -> $value"
}

Let me know if you've got any additional questions.

- Nathan

-- AOLserver - http://www.aolserver.com/ To Remove yourself from this list: http://www.aolserver.com/listserv.html List information and options: http://listserv.aol.com/

Reply via email to