Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ns_connreturnnotice(3aolserv) [debian man page]

Ns_ConnReturnData(3aolserver)				   AOLserver Library Procedures 			     Ns_ConnReturnData(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
Ns_ConnReturnAdminNotice, Ns_ConnReturnData, Ns_ConnReturnHtml, Ns_ConnReturnNotice - Routines to generate simple single-buffer responses SYNOPSIS
#include "ns.h" int Ns_ConnReturnAdminNotice(conn, status, title, msg) int Ns_ConnReturnData(conn, status, data, len, type) int Ns_ConnReturnCharData(conn, status, data, len, type) int Ns_ConnReturnHtml(conn, status, msg, len) int Ns_ConnReturnNotice(conn, status, title, msg) ARGUMENTS
Ns_Conn conn (in) Pointer to open connection. int status (in) HTTP response status code. char *type (in) Output content type. char *title (in) Pointer to HTML page title string. int len (in) Length of content buffer. char *data (in) Pointer to content buffer. char *msg (in) Pointer to HTML message buffer. _________________________________________________________________ DESCRIPTION
These routines are used to generate complete responses, including headers, status codes, content types, and the requested data. They all return a status code which is NS_OK if the response was sent or NS_ERROR if an underlying call to sent the content failed. int Ns_ConnReturnAdminNotice(conn, status, title, msg) This routine is equivalent to Ns_ConnReturnNotice. In prior versions, it would format a slightly different response which was later considered inconsequential. int Ns_ConnReturnData(conn, status, data, len, type) Generates a reponse with the given HTTP status including a content-type header with the given type. Content pointed to by the data argument of length len is then sent without any modification via an underlying call to Ns_ConnFlushDirect. int Ns_ConnReturnCharData(conn, status, data, len, type) Generates a response as with Ns_ConnReturnData except that the given content pointed to by data is assumed to be a text stream which is output encoded using the appropriate Tcl_Encoding based on the given type mimetype and possibly gzip compressed via an underlying call to Ns_ConnFlush. int Ns_ConnReturnHtml(conn, status, msg, len) This is equivalent to Ns_ConnReturnCharData(conn, status, msg, len, "text/html"). int Ns_ConnReturnNotice(conn, status, title, msg) Constructs a basic HTML response and sends it via Ns_ConnReturnHtml. The title string is placed both in the <head> portion as well as an <h2> tag in the <body> portion of the document. If the title is NULL, it defaults to the string "Server Message". The msg string, if not NULL, follows the body and is copied unaltered. This routine is useful for generating very basic responses. For example, it is used by the various builtin reponse routines such as Ns_ConnReturnUnauthorized. SEE ALSO
Ns_ConnFlush(3), Ns_ConnReturnFile, Ns_ConnReturnOpenFd, Ns_ConnReturnUnathorized. KEYWORDS
connnection, encoding, response AOLserver 4.0 Ns_ConnReturnData(3aolserver)

Check Out this Related Man Page

Ns_ConnReturnStatus(3aolserver) 			   AOLserver Library Procedures 			   Ns_ConnReturnStatus(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
Ns_ConnReturnBadRequest, Ns_ConnReturnForbidden, Ns_ConnReturnInternalError, Ns_ConnReturnNoResponse, Ns_ConnReturnNotFound, Ns_ConnReturn- NotImplemented, Ns_ConnReturnNotModified, Ns_ConnReturnOk, Ns_ConnReturnStatus, Ns_ConnReturnUnauthorized, Ns_RegisterRedirect - Routines to return simple standard responses SYNOPSIS
#include "ns.h" int Ns_ConnReturnBadRequest(conn, msg) int Ns_ConnReturnForbidden(conn) int Ns_ConnReturnInternalError(conn) int Ns_ConnReturnNoResponse(conn) int Ns_ConnReturnNotFound(conn) int Ns_ConnReturnNotImplemented(conn) int Ns_ConnReturnNotModified(conn) int Ns_ConnReturnOk(conn) int Ns_ConnReturnStatus(conn, status) int Ns_ConnReturnUnauthorized(conn) void Ns_RegisterRedirect(server, status, url) ARGUMENTS
Ns_Conn conn (in) Pointer to open connection. char *msg (in) String with additional message text. int status (in) Integer HTTP status code. char *url (in) String which specifies internal redirection url. char *server(in) Virtual server. _________________________________________________________________ DESCRIPTION
These routines are used to generate complete responses, including headers, approriate status codes, content types, and possibly short HTML content messages for the most common HTTP error or status responses. They each coorespond to a particular HTTP status code, for example, Ns_ConnReturnNotFound generates an HTTP 404 "Not Found" response. They all return NS_OK if the response was sent or NS_ERROR if an under- lying routine failed. The default behavior is to return an internal, server generated response possibly with a short English language message, for example "The requested URL cannot be accessed by this server". This behavior can be modified by calling the Ns_RegisterRedirect to redirect responses internally for the cooresponding HTTP status code to another URL on the server. The "redirects" server config section can be used to map these redirects at startup int Ns_ConnReturnBadRequest(conn, msg) Returns an HTTP 400 response with the short HTML message "Invalid Request: The HTTP request presented by your browser is invalid." The optional msg string, if present, is also included in the message body. int Ns_ConnReturnForbidden(conn) Returns an HTTP 403 response with the short HTML message "Forbidden: The requested URL cannot be accessed by this server." int Ns_ConnReturnInternalError(conn) Returns an HTTP 500 response with the short HTML message "Server Error: The requested URL cannot be accessed due to a system error on this server." int Ns_ConnReturnNoResponse(conn) Equivalent to Ns_ConnReturnStatus(conn, 204). int Ns_ConnReturnNotFound(conn) Returns an HTTP 404 response with the short HTML message "Not Found: The requested URL was not found on this server." int Ns_ConnReturnNotImplemented(conn) Returns an HTTP 404 response with the short HTML message "Not Implemented: The requested URL or method is not implemented by this server." int Ns_ConnReturnNotModified(conn) Equivalent to Ns_ConnReturnStatus(conn, 304). int Ns_ConnReturnOk(conn) Equivalent to Ns_ConnReturnStatus(conn, 200). int Ns_ConnReturnStatus(conn, status) Generates a response with the given HTTP status with no content. int Ns_ConnReturnUnauthorized(conn) Returns an HTTP 401 response with the short HTML message "Access Denied: The requested URL cannot be accessed because a valid user- name and password are required." As "WWW-Authenticate: Basic realm=server realm" header is also included in the response. void Ns_RegisterRedirect(server, status, url) Redirect the above responses from the given server for the given status code from the simple internal messages described above to the given internal url. The redirect is performed using Ns_ConnRedirect. SEE ALSO
Ns_ConnFlush(3), Ns_ConnRedirect(3), Ns_ConnSetRequiredHeaders(3), Ns_ConnQueueHeaders(3), ns_return(n) KEYWORDS
connnection, response AOLserver 4.0 Ns_ConnReturnStatus(3aolserver)
Man Page