Ns_ConnAuthPasswd, Ns_ConnAuthUser, Ns_ConnHeaders, Ns_ConnHost,
- Provided by: aolserver4-dev (Version: 4.5.1-18)
- Source: aolserver4
- Report a bug
#include "ns.h" char * Ns_ConnAuthPasswd(Ns_Conn *conn) char * Ns_ConnAuthUser(Ns_Conn *conn) Ns_Set * Ns_ConnHeaders(Ns_Conn *conn) char * Ns_ConnHost(Ns_Conn *conn) int Ns_ConnId(Ns_Conn *conn) char * Ns_ConnLocation(Ns_Conn *conn) Ns_Set * Ns_ConnOutputHeaders(Ns_Conn *conn) char * Ns_ConnPeer(Ns_Conn *conn) int Ns_ConnPeerPort(Ns_Conn *conn) int Ns_ConnPort(Ns_Conn *conn) int Ns_ConnResponseLength(Ns_Conn *conn) int Ns_ConnResponseStatus(Ns_Conn *conn) char * Ns_ConnServer(Ns_Conn *conn) int Ns_ConnSock(Ns_Conn *conn)
These routines provide access to data stored within an active connection. All routines take as an argument a pointer to an Ns_Conn structure which is setup by the server and passed to request handling procedures.
The Ns_Conn structure includes the following fields:
typedef struct Ns_Conn {
Ns_Request *request;
Ns_Set *headers;
Ns_Set *outputheaders;
char *authUser;
char *authPasswd;
int contentLength;
int flags;
} Ns_Conn;
All fields of an Ns_Conn structure should be considered read-only. The request field contains a pointer to the parsed HTTP request. See the manual page for Ns_ParseRequest for details on what it contains.
The headers and outputHeaders fields point to Ns_Set structures for the input and output headers, respectively. The outputHeaders set will generally not contain any fields until after the request has been processed. See the manual page on Ns_Set for details on the fields of the structure and routines to access and manipulate them.
The authUser and authPasswd fields point to the decoded username and password for the request or NULL if no authorization was sent.
The contentLength field is the length of the content, if any, sent with the request. See the man page on Ns_ConnContent for details on accessing the content.
The flags field is a bitmask with one or more NS_CONN bits:
These flags should be considered read-only. Use the corresponding routines, e.g., Ns_ConnSetKeepAlive, to set the flags if necessary.
In addition to the public fields, the routines above can be used to access data contained in the private components of the connection (in retrospect, all fields should have been private).
Ns_Set(3), Ns_ConnContent(3), Ns_ConnGetQuery(3), Ns_ParseRequest(3), ns_conn(n)
connection, location, headers