#include "nsd.h"Data Structures | |
| struct | Req |
Defines | |
| #define | MAX_RECURSION 3 |
Functions | |
| void | NsInitRequests (void) |
| void | Ns_RegisterRequest (char *server, char *method, char *url, Ns_OpProc *proc, Ns_Callback *delete, void *arg, int flags) |
| void | Ns_GetRequest (char *server, char *method, char *url, Ns_OpProc **procPtr, Ns_Callback **deletePtr, void **argPtr, int *flagsPtr) |
| void | Ns_UnRegisterRequest (char *server, char *method, char *url, int inherit) |
| int | Ns_ConnRunRequest (Ns_Conn *conn) |
| int | Ns_ConnRedirect (Ns_Conn *conn, char *url) |
| void | Ns_RegisterProxyRequest (char *server, char *method, char *protocol, Ns_OpProc *proc, Ns_Callback *delete, void *arg) |
| void | Ns_UnRegisterProxyRequest (char *server, char *method, char *protocol) |
| int | NsConnRunProxyRequest (Ns_Conn *conn) |
| #define MAX_RECURSION 3 |
| int Ns_ConnRedirect | ( | Ns_Conn * | conn, | |
| char * | url | |||
| ) |
----------------------------------------------------------------------
Ns_ConnRedirect --
Perform an internal redirect by updating the connection's request URL and re-authorizing and running the request. This Routine is used in FastPath to redirect to directory files (e.g., index.html) and in return.c to redirect by HTTP result code (e.g., custom not-found handler).
Results: Standard request procedure result, normally NS_OK.
Side effects: Depends on request procedure.
----------------------------------------------------------------------
Update the request URL.
Re-authorize and run the request.
| int Ns_ConnRunRequest | ( | Ns_Conn * | conn | ) |
----------------------------------------------------------------------
Ns_ConnRunRequest --
Locate and execute the procedure for the given method and url pattern.
Results: Standard request procedure result, normally NS_OK.
Side effects: Depends on request procedure.
----------------------------------------------------------------------
Return a quick unavailable error on overflow.
Prevent infinite internal redirect loops.
| void Ns_GetRequest | ( | char * | server, | |
| char * | method, | |||
| char * | url, | |||
| Ns_OpProc ** | procPtr, | |||
| Ns_Callback ** | deletePtr, | |||
| void ** | argPtr, | |||
| int * | flagsPtr | |||
| ) |
----------------------------------------------------------------------
Ns_GetRequest --
Return the procedures and context for a given method and url pattern.
Results: None.
Side effects:
----------------------------------------------------------------------
| void Ns_RegisterProxyRequest | ( | char * | server, | |
| char * | method, | |||
| char * | protocol, | |||
| Ns_OpProc * | proc, | |||
| Ns_Callback * | delete, | |||
| void * | arg | |||
| ) |
----------------------------------------------------------------------
Ns_RegisterProxyRequest --
Register a new procedure to be called to proxy matching given method and protocol pattern.
Results: None.
Side effects: Delete procedure of previously registered request, if any.
----------------------------------------------------------------------
| void Ns_RegisterRequest | ( | char * | server, | |
| char * | method, | |||
| char * | url, | |||
| Ns_OpProc * | proc, | |||
| Ns_Callback * | delete, | |||
| void * | arg, | |||
| int | flags | |||
| ) |
----------------------------------------------------------------------
Ns_RegisterRequest --
Register a new procedure to be called to service matching given method and url pattern.
Results: None.
Side effects: Delete procedure of previously registered request, if any, will be called unless NS_OP_NODELETE flag is set.
----------------------------------------------------------------------
| void Ns_UnRegisterProxyRequest | ( | char * | server, | |
| char * | method, | |||
| char * | protocol | |||
| ) |
----------------------------------------------------------------------
Ns_UnRegisterProxyRequest --
Remove the procedure which would run for the given method and protocol.
Results: None.
Side effects: Request's deleteProc may run.
----------------------------------------------------------------------
| void Ns_UnRegisterRequest | ( | char * | server, | |
| char * | method, | |||
| char * | url, | |||
| int | inherit | |||
| ) |
----------------------------------------------------------------------
Ns_UnRegisterRequest --
Remove the procedure which would run for the given method and url pattern.
Results: None.
Side effects: Requests deleteProc may run.
----------------------------------------------------------------------
| int NsConnRunProxyRequest | ( | Ns_Conn * | conn | ) |
----------------------------------------------------------------------
NsConnRunProxyRequest --
Locate and execute the procedure for the given method and protocol pattern.
Results: Standard request procedure result, normally NS_OK.
Side effects: Depends on request procedure.
----------------------------------------------------------------------
| void NsInitRequests | ( | void | ) |
----------------------------------------------------------------------
NsInitRequests --
Initialize the request API.
Results: None.
Side effects: None.
----------------------------------------------------------------------
1.5.1