Http | Http service object. |
HttpAuth | Authorization. |
HttpCache | Cache Control. |
HttpConn | Http Connections. |
HttpEndpoint | Listening endpoints. |
HttpHost | Host Object. |
HttpLimits | Http limits. |
HttpPacket | Packet object. |
HttpQueue | Queue object. |
HttpRange | Content range structure. |
HttpRoute | Route Control. |
HttpRx | Http Rx. |
HttpSession | Session state object. |
HttpStage | Pipeline Stages. |
HttpStats | HttpStats. |
HttpTrace | Trace management structure. |
HttpTx | Http Tx. |
HttpUploadFile | Upload File. |
HttpUri | URI management. |
HttpWebSocket | WebSocket Service to implement the WebSockets RFC 6455 specification for client and server communications. |
HttpConn* | httpAcceptConn(HttpEndpoint *endpoint, MprEvent *event) |
Accept a new connection. | |
int | httpAddAuthStore(Http *http, cchar *name, HttpVerifyUser verifyUser) |
Add an authorization store for password validation. | |
int | httpAddAuthType(Http *http, cchar *name, HttpAskLogin askLogin, HttpParseAuth parse, HttpSetAuth setAuth) |
Add an authorization type. | |
void | httpAddCache(struct HttpRoute *route, cchar *methods, cchar *uris, cchar *extensions, cchar *types, MprTicks clientLifespan, MprTicks serverLifespan, int flags) |
Add caching for response content. | |
void | httpAddHeader(HttpConn *conn, cchar *key, cchar *fmt, ...) |
Add a header to the transmission using a format string. | |
void | httpAddHeaderString(HttpConn *conn, cchar *key, cchar *value) |
Add a header to the transmission. | |
void | httpAddHomeRoute(HttpRoute *parent) |
Add a route for the home page. | |
void | httpAddHostToEndpoint(HttpEndpoint *endpoint, struct HttpHost *host) |
Add a host to an endpoint. | |
void | httpAddOption(MprHash *options, cchar *field, cchar *value) |
Add an option to the options table. | |
void | httpAddParams(HttpConn *conn) |
Add query and form body data to params. | |
void | httpAddResource(HttpRoute *parent, cchar *resource) |
Add routes for a resource. | |
void | httpAddResourceGroup(HttpRoute *parent, cchar *resource) |
Add routes for a group of resources. | |
int | httpAddRole(HttpAuth *auth, cchar *role, cchar *abilities) |
Add a role. | |
int | httpAddRoute(HttpHost *host, HttpRoute *route) |
Add a route to a host. | |
int | httpAddRouteCondition(HttpRoute *route, cchar *name, cchar *details, int flags) |
Add a route condition. | |
void | httpAddRouteErrorDocument(HttpRoute *route, int status, cchar *uri) |
Add an error document. | |
int | httpAddRouteFilter(HttpRoute *route, cchar *name, cchar *extensions, int direction) |
Add a route filter. | |
int | httpAddRouteHandler(HttpRoute *route, cchar *name, cchar *extensions) |
Add a route handler. | |
void | httpAddRouteHeader(HttpRoute *route, cchar *header, cchar *value, int flags) |
Add a route header check. | |
void | httpAddRouteIndex(HttpRoute *route, cchar *path) |
Set the route index document. | |
int | httpAddRouteLanguageDir(HttpRoute *route, cchar *language, cchar *path) |
Add a route language directory. | |
int | httpAddRouteLanguageSuffix(HttpRoute *route, cchar *language, cchar *suffix, int flags) |
Add a route language suffix. | |
void | httpAddRouteParam(HttpRoute *route, cchar *field, cchar *value, int flags) |
Add a route param check. | |
void | httpAddRouteSet(HttpRoute *parent, cchar *set) |
Add a route set package. | |
int | httpAddRouteUpdate(HttpRoute *route, cchar *name, cchar *details, int flags) |
Add a route update rule. | |
void | httpAddStaticRoute(HttpRoute *parent) |
Add a route for static content under a "static" directory. | |
void | httpAddUploadFile(HttpConn *conn, cchar *id, HttpUploadFile *file) |
Add an Uploaded file. | |
int | httpAddUser(HttpAuth *auth, cchar *user, cchar *password, cchar *abilities) |
Add a user. | |
void | httpAdjustPacketEnd(HttpPacket *packet, MprOff size) |
Adjust the packet end position. | |
void | httpAdjustPacketStart(HttpPacket *packet, MprOff size) |
Adjust the packet starting position. | |
void | httpAfterEvent(HttpConn *conn) |
Do setup after an I/O event to receive future events. | |
HttpSession* | httpAllocSession(HttpConn *conn, cchar *id, MprTicks lifespan) |
Allocate a new session state object. | |
void | httpAppendHeader(HttpConn *conn, cchar *key, cchar *fmt, ...) |
Append a transmission header. | |
void | httpAppendHeaderString(HttpConn *conn, cchar *key, cchar *value) |
Append a transmission header string. | |
void | httpBackupRouteLog(HttpRoute *route) |
Backup the route log if required. | |
void | httpCallEvent(HttpConn *conn, int mask) |
Call httpEvent with the given event mask. | |
bool | httpCanUser(HttpConn *conn) |
Test if a user has the required abilities. | |
void | httpClearRouteStages(HttpRoute *route, int direction) |
Clear the pipeline stages for the route. | |
HttpHost* | httpCloneHost(HttpHost *parent) |
Clone a host. | |
HttpPacket* | httpClonePacket(HttpPacket *orig) |
Clone a packet. | |
HttpStage* | httpCloneStage(Http *http, HttpStage *stage) |
Create a clone of an existing state. | |
HttpUri* | httpCloneUri(HttpUri *base, int flags) |
Clone a URI. | |
void | httpCloseConn(HttpConn *conn) |
Close a connection. | |
HttpUri* | httpCompleteUri(HttpUri *uri, HttpUri *other) |
Complete the given URI. | |
void | httpComputeAllUserAbilities(HttpAuth *auth) |
Compute all the user abilities for a route using the given auth. | |
void | httpComputeUserAbilities(HttpAuth *auth, HttpUser *user) |
Compute the user abilities for a given user in a route using the given auth. | |
int | httpConfigureNamedVirtualEndpoints(Http *http, cchar *ip, int port) |
Configure endpoints with named virtual hosts. | |
void | httpConnTimeout(HttpConn *conn) |
Signal a connection timeout on a connection. | |
int | httpConnect(HttpConn *conn, cchar *method, cchar *uri, struct MprSsl *ssl) |
Connect to a server and issue Http client request. | |
bool | httpContentNotModified(HttpConn *conn) |
Test if the content has not been modified. | |
Http* | httpCreate(int flags) |
Create a Http service object. | |
HttpRoute* | httpCreateActionRoute(HttpRoute *parent, cchar *pattern, HttpAction action) |
Create a route for use with the Action Handler. | |
HttpRoute* | httpCreateAliasRoute(HttpRoute *parent, cchar *pattern, cchar *path, int status) |
Create a route suitable for use as an alias. | |
HttpAuth* | httpCreateAuth() |
Create an authentication object. | |
void | httpCreateCGIParams(HttpConn *conn) |
Create CGI parameters. | |
HttpEndpoint* | httpCreateConfiguredEndpoint(cchar *home, cchar *documents, cchar *ip, int port) |
Create and configure a new endpoint. | |
HttpRoute* | httpCreateConfiguredRoute(struct HttpHost *host, int serverSide) |
Create a configured route. | |
HttpConn* | httpCreateConn(Http *http, struct HttpEndpoint *endpoint, MprDispatcher *dispatcher) |
Create a connection object. | |
HttpStage* | httpCreateConnector(Http *http, cchar *name, MprModule *module) |
Create a connector stage. | |
HttpPacket* | httpCreateDataPacket(ssize size) |
Create a data packet. | |
HttpRoute* | httpCreateDefaultRoute(struct HttpHost *host) |
Create a default route for a host. | |
HttpPacket* | httpCreateEndPacket() |
Create an end-of-stream packet. | |
HttpEndpoint* | httpCreateEndpoint(cchar *ip, int port, MprDispatcher *dispatcher) |
Create an endpoint object. | |
HttpPacket* | httpCreateEntityPacket(MprOff pos, MprOff size, HttpFillProc fill) |
Create an entity data packet. | |
HttpStage* | httpCreateFilter(Http *http, cchar *name, MprModule *module) |
Create a filter stage. | |
HttpStage* | httpCreateHandler(Http *http, cchar *name, MprModule *module) |
Create a request handler stage. | |
HttpPacket* | httpCreateHeaderPacket() |
Create a response header packet. | |
HttpHost* | httpCreateHost() |
Create a host. | |
HttpRoute* | httpCreateInheritedRoute(HttpRoute *route) |
Create a route inherited from a parent route. | |
HttpLimits* | httpCreateLimits(int serverSide) |
Create a new limits object. | |
HttpPacket* | httpCreatePacket(ssize size) |
Create a data packet. | |
HttpRole* | httpCreateRole(HttpAuth *auth, cchar *name, cchar *abilities) |
Create a new role. | |
HttpRoute* | httpCreateRoute(struct HttpHost *host) |
Create a route for a host. | |
void | httpCreateRxPipeline(HttpConn *conn, struct HttpRoute *route) |
Create the receive request pipeline. | |
int | httpCreateSecret(Http *http) |
Create the Http secret data for crypto. | |
HttpSession* | httpCreateSession(HttpConn *conn) |
Create a session object. | |
HttpStage* | httpCreateStage(Http *http, cchar *name, int flags, MprModule *module) |
Create a connector stage. | |
HttpTx* | httpCreateTx(HttpConn *conn, MprHash *headers) |
Create the tx object. | |
void | httpCreateTxPipeline(HttpConn *conn, struct HttpRoute *route) |
Create the transmit request pipeline. | |
HttpUri* | httpCreateUri(cchar *uri, int flags) |
Create and initialize a URI. | |
HttpUri* | httpCreateUriFromParts(cchar *scheme, cchar *host, int port, cchar *path, cchar *reference, cchar *query, int flags) |
Create a URI from parts. | |
HttpUser* | httpCreateUser(HttpAuth *auth, cchar *name, cchar *password, cchar *abilities) |
Create a new user. | |
void | httpDefaultOutgoingServiceStage(HttpQueue *q) |
Default outgoing data handling. | |
void | httpDefineAction(cchar *uri, HttpAction fun) |
Define a function procedure to invoke when the specified URI is requested. | |
HttpRoute* | httpDefineRoute(HttpRoute *parent, cchar *name, cchar *methods, cchar *pattern, cchar *target, cchar *source) |
Define a route. | |
void | httpDefineRouteCondition(cchar *name, HttpRouteProc *proc) |
Define a route condition rule. | |
void | httpDefineRouteTarget(cchar *name, HttpRouteProc *proc) |
Define a route target rule. | |
void | httpDefineRouteUpdate(cchar *name, HttpRouteProc *proc) |
Define a route update rule. | |
void | httpDestroy(Http *http) |
Destroy the Http service object. | |
void | httpDestroyConn(HttpConn *conn) |
Destroy the connection object. | |
void | httpDestroyEndpoint(HttpEndpoint *endpoint) |
Destroy the endpoint. | |
void | httpDestroyPipeline(HttpConn *conn) |
Destroy the request pipeline. | |
void | httpDestroySession(HttpConn *conn) |
Destroy a session state object. | |
void | httpDestroyTx(HttpTx *tx) |
Destroy the tx object. | |
void | httpDisableQueue(HttpQueue *q) |
Disable a queue. | |
void | httpDiscardData(HttpConn *conn, int dir) |
Discard buffered transmit pipeline data. | |
void | httpDiscardQueueData(HttpQueue *q, bool removePackets) |
Discard all data from the queue. | |
void | httpDisconnect(HttpConn *conn) |
Disconnect the connection's socket. | |
void | httpEaseLimits(HttpLimits *limits) |
Ease the limits. | |
void | httpEnableConnEvents(HttpConn *conn) |
Enable connection events. | |
void | httpEnablePutMethod(HttpRoute *route, bool on) |
Enable use of the DELETE and PUT methods. | |
void | httpEnableQueue(HttpQueue *q) |
Enable a queue after it has been disabled. | |
void | httpEnableTraceMethod(HttpRoute *route, bool on) |
Enable use of the TRACE Http method. | |
void | httpEnableUpload(HttpConn *conn) |
Enable Multipart-Mime File Upload for this request. | |
void | httpError(HttpConn *conn, int status, cchar *fmt, ...) |
Error handling for the connection. | |
void | httpEvent(struct HttpConn *conn, MprEvent *event) |
Http I/O event handler. | |
cchar* | httpExpandRouteVars(HttpRoute *route, cchar *str) |
Expand route variables in a string. | |
void | httpFinalize(HttpConn *conn) |
Indicate the request is finalized. | |
void | httpFinalizeConnector(HttpConn *conn) |
Finalize connector output sending the response. | |
void | httpFinalizeOutput(HttpConn *conn) |
Finalize transmission of the http response. | |
void | httpFinalizeRoute(HttpRoute *route) |
Finalize a route. | |
void | httpFlush(HttpConn *conn) |
Flush tx data. | |
bool | httpFlushQueue(HttpQueue *q, bool block) |
Flush queue data. | |
void | httpFollowRedirects(HttpConn *conn, bool follow) |
Follow redirctions. | |
void | httpFormatError(HttpConn *conn, int status, cchar *fmt, ...) |
Format an error transmission. | |
ssize | httpFormatResponse(HttpConn *conn, cchar *fmt, ...) |
Format an alternate response. | |
ssize | httpFormatResponseBody(HttpConn *conn, cchar *title, cchar *fmt, ...) |
Format a response body. | |
ssize | httpFormatResponsev(HttpConn *conn, cchar *fmt, va_list args) |
Format an alternate response. | |
char* | httpFormatUri(cchar *scheme, cchar *host, int port, cchar *path, cchar *ref, cchar *query, int flags) |
Format a URI. | |
int | httpGetAsync(HttpConn *conn) |
Get the async mode value for the connection. | |
ssize | httpGetChunkSize(HttpConn *conn) |
Get the preferred chunked size for transfer chunk encoding. | |
void* | httpGetConnContext(HttpConn *conn) |
Get the connection context object. | |
void* | httpGetConnHost(HttpConn *conn) |
Get the connection host object. | |
MprOff | httpGetContentLength(HttpConn *conn) |
Get the receive body content length. | |
void* | httpGetContext(Http *http) |
Get the http context object. | |
cchar* | httpGetCookies(HttpConn *conn) |
Get the request cookies. | |
char* | httpGetDateString(MprPath *sbuf) |
Get the time as an ISO date string. | |
HttpHost* | httpGetDefaultHost() |
Get the default host defined via httpSetDefaultHost. | |
HttpRoute* | httpGetDefaultRoute(HttpHost *host) |
Get the default route for a host. | |
void* | httpGetEndpointContext(HttpEndpoint *endpoint) |
Get the endpoint context object. | |
cchar* | httpGetError(HttpConn *conn) |
Get the error message associated with the last request. | |
char* | httpGetExt(HttpConn *conn) |
Get a URI extension. | |
cchar* | httpGetHeader(HttpConn *conn, cchar *key) |
Get an rx http header. | |
MprHash* | httpGetHeaderHash(HttpConn *conn) |
Get the hash table of rx Http headers. | |
char* | httpGetHeaders(HttpConn *conn) |
Get all the request http headers. | |
char* | httpGetHeadersFromHash(MprHash *hash) |
Get a header string from the given hash. | |
HttpRoute* | httpGetHostDefaultRoute(HttpHost *host) |
Return the default route for a host. | |
int | httpGetIntParam(HttpConn *conn, cchar *var, int defaultValue) |
Get a form variable as an integer. | |
int | httpGetKeepAliveCount(HttpConn *conn) |
Get the count of Keep-Alive requests that will be used for this connection object. | |
HttpLang* | httpGetLanguage(HttpConn *conn, MprHash *spoken, cchar *defaultLang) |
Get the language to use for the request. | |
bool | httpGetMoreOutput(HttpConn *conn) |
Get more output data by invoking the writable callback. | |
void* | httpGetOption(MprHash *options, cchar *field, cchar *defaultValue) |
Extract a field value from an option string. | |
MprHash* | httpGetOptionHash(MprHash *options, cchar *field) |
Get an option value that is itself an object (hash). | |
MprHash* | httpGetOptions(cchar *options) |
Convert an options string into an options table. | |
HttpPacket* | httpGetPacket(struct HttpQueue *q) |
Get the next packet from a queue. | |
ssize | httpGetPacketLength(HttpPacket *packet) |
Get the length of the packet data contents. | |
cchar* | httpGetParam(HttpConn *conn, cchar *var, cchar *defaultValue) |
Get a request param. | |
MprHash* | httpGetParams(HttpConn *conn) |
Get the request params table. | |
char* | httpGetParamsString(HttpConn *conn) |
Get the request params table as a string. | |
char* | httpGetPathExt(cchar *path) |
Get a path extension. | |
cchar* | httpGetQueryString(HttpConn *conn) |
Get the request query string. | |
void* | httpGetQueueData(HttpConn *conn) |
Get the queue data for the connection. | |
ssize | httpGetQueueRoom(HttpQueue *q) |
Get the room in the queue. | |
ssize | httpGetReadCount(HttpConn *conn) |
Get the number of bytes that can be read from the read queue. | |
HttpUri* | httpGetRelativeUri(HttpUri *base, HttpUri *target, int clone) |
Get a relative URI from the base to the target. | |
void* | httpGetRouteData(HttpRoute *route, cchar *key) |
Get extra route data. | |
cchar* | httpGetRouteDir(HttpRoute *route) |
Get the route directory. | |
cchar* | httpGetRouteMethods(HttpRoute *route) |
Get the route method list. | |
cchar* | httpGetRouteVar(HttpRoute *route, cchar *key) |
Get a path token variable. | |
HttpSession* | httpGetSession(HttpConn *conn, int create) |
Get a session state object. | |
char* | httpGetSessionID(HttpConn *conn) |
Get the session ID. | |
MprHash* | httpGetSessionObj(HttpConn *conn, cchar *key) |
Get an object from the session state store. | |
cchar* | httpGetSessionVar(HttpConn *conn, cchar *name, cchar *defaultValue) |
Get a session state variable. | |
cvoid* | httpGetStageData(struct HttpConn *conn, cchar *key) |
Get stage data. | |
void | httpGetStats(HttpStats *sp) |
Get the Http performance statistics. | |
int | httpGetStatus(HttpConn *conn) |
Get the response status. | |
char* | httpGetStatusMessage(HttpConn *conn) |
Get the Http response status message. | |
char* | httpGetWebSocketCloseReason(HttpConn *conn) |
Get the close reason supplied by the peer. | |
ssize | httpGetWebSocketMessageLength(HttpConn *conn) |
Get the message length for the current message. | |
char* | httpGetWebSocketProtocol(HttpConn *conn) |
Get the selected web socket protocol selected by the server. | |
ssize | httpGetWebSocketState(HttpConn *conn) |
Get the WebSocket state. | |
ssize | httpGetWriteQueueCount(HttpConn *conn) |
Get the count of bytes buffered on the write queue. | |
HttpLimits* | httpGraduateLimits(HttpRoute *route, HttpLimits *limits) |
Graduate the limits from the parent route. | |
void | httpHandleOptionsTrace(struct HttpConn *conn, cchar *methods) |
Handle a Http Trace or Options method request. | |
bool | httpHasNamedVirtualHosts(HttpEndpoint *endpoint) |
Test if an endpoint has named virtual hosts. | |
void | httpInitLimits(HttpLimits *limits, bool serverSide) |
Initialize a limits object with default values. | |
void | httpInsertOption(MprHash *options, cchar *field, cchar *value) |
Add an option to the options table. | |
bool | httpIsAuthenticated(HttpConn *conn) |
Test if the user is authenticated. | |
int | httpIsChunked(HttpConn *conn) |
Return whether transfer chunked encoding will be used on this request. | |
int | httpIsEndpointAsync(HttpEndpoint *endpoint) |
Get if the endpoint is running in asynchronous mode. | |
bool | httpIsEof(struct HttpConn *conn) |
Test if the connection has received all incoming content. | |
int | httpIsFinalized(HttpConn *conn) |
Test if request has been finalized. | |
bool | httpIsLastPacket(HttpPacket *packet) |
Test if the packet is the last in a logical message. | |
int | httpIsOutputFinalized(HttpConn *conn) |
Test if request response has been fully generated. | |
bool | httpIsPacketTooBig(struct HttpQueue *q, HttpPacket *packet) |
Test if a packet is too big. | |
bool | httpIsQueueEmpty(HttpQueue *q) |
Determine if the queue is empty. | |
bool | httpIsQueueSuspended(HttpQueue *q) |
Test if a queue is suspended. | |
int | httpJoinPacket(HttpPacket *packet, HttpPacket *other) |
Join two packets. | |
void | httpJoinPacketForService(struct HttpQueue *q, HttpPacket *packet, bool serviceQ) |
Join a packet onto the service queue. | |
void | httpJoinPackets(HttpQueue *q, ssize size) |
Join packets together. | |
HttpUri* | httpJoinUri(HttpUri *base, int argc, HttpUri **others) |
Join URIs. | |
HttpUri* | httpJoinUriPath(HttpUri *result, HttpUri *base, HttpUri *other) |
Join a URI path. | |
char* | httpLink(HttpConn *conn, cchar *target, MprHash *options) |
Create a URI link. | |
void | httpLogRoutes(HttpHost *host, bool full) |
Show the current route table to the error log. | |
bool | httpLogin(HttpConn *conn, cchar *username, cchar *password) |
Log the user in. | |
struct HttpEndpoint* | httpLookupEndpoint(Http *http, cchar *ip, int port) |
Lookup a listening endpoint. | |
struct HttpHost* | httpLookupHost(Http *http, cchar *name) |
Lookup a host by name. | |
struct HttpHost* | httpLookupHostOnEndpoint(HttpEndpoint *endpoint, cchar *name) |
Lookup a host name. | |
cchar* | httpLookupMimeType(cchar *ext) |
Get the mime type for an extension. | |
HttpRoute* | httpLookupRoute(HttpHost *host, cchar *name) |
Lookup a route by name. | |
cchar* | httpLookupRouteErrorDocument(HttpRoute *route, int status) |
Lookup an error document by HTTP status code. | |
struct HttpStage* | httpLookupStage(Http *http, cchar *name) |
Lookup a stage by name. | |
void* | httpLookupStageData(Http *http, cchar *name) |
Lookup stage data. | |
cchar* | httpLookupStatus(Http *http, int status) |
Lookup a Http status code. | |
char* | httpMakePath(HttpRoute *route, cchar *path) |
Make a filename path. | |
HttpUri* | httpMakeUriLocal(HttpUri *uri) |
Make a URI local. | |
void | httpMapFile(HttpConn *conn, HttpRoute *route) |
Map the request URI and route target to a filename. | |
void | httpMatchHost(HttpConn *conn) |
Match the HttpHost object that should serve this request. | |
bool | httpMatchParam(HttpConn *conn, cchar *var, cchar *expected) |
Match a form variable with an expected value. | |
int | httpMatchRoute(HttpConn *conn, HttpRoute *route) |
Match a route against the current request. | |
void | httpMemoryError(HttpConn *conn) |
Signal a memory allocation error. | |
bool | httpNeedRetry(HttpConn *conn, char **url) |
Determine if the transmission needs a transparent retry to implement authentication or redirection. | |
void | httpNormalizeUri(HttpUri *uri) |
Normalize a URI. | |
char* | httpNormalizeUriPath(cchar *uri) |
Normalize a URI. | |
void | httpNotify(HttpConn *conn, int event, int arg) |
Inform notifiers of a connection event or state change. | |
void | httpOmitBody(HttpConn *conn) |
Tell the tx to omit sending any body. | |
bool | httpOption(MprHash *options, cchar *field, cchar *value, int useDefault) |
Test a field value from an option string. | |
void | httpPrepClientConn(HttpConn *conn, bool keepHeaders) |
Prepare a client connection for a new request. | |
bool | httpPumpRequest(HttpConn *conn, HttpPacket *packet) |
Pump the Http engine for a request. | |
void | httpPutBackPacket(struct HttpQueue *q, HttpPacket *packet) |
Put a packet back onto a queue. | |
void | httpPutForService(struct HttpQueue *q, HttpPacket *packet, bool serviceQ) |
Put a packet into the service queue for deferred processing. | |
void | httpPutPacket(struct HttpQueue *q, HttpPacket *packet) |
Put a packet to the queue. | |
void | httpPutPacketToNext(struct HttpQueue *q, HttpPacket *packet) |
Put a packet to the next queue downstream. | |
ssize | httpRead(HttpConn *conn, char *buffer, ssize size) |
Read rx body data. | |
char* | httpReadString(HttpConn *conn) |
Read response data as a string. | |
void | httpReadyHandler(HttpConn *conn) |
Run the handler ready callback. | |
void | httpRedirect(HttpConn *conn, int status, cchar *uri) |
Redirect the client. | |
void | httpRemoveAllUploadedFiles(HttpConn *conn) |
Remove all uploaded files. | |
int | httpRemoveHeader(HttpConn *conn, cchar *key) |
Remove a header from the transmission. | |
void | httpRemoveOption(MprHash *options, cchar *field) |
Remove an option. | |
void | httpRemoveQueue(HttpQueue *q) |
Remove a queue. | |
int | httpRemoveRole(HttpAuth *auth, cchar *role) |
Remove a role. | |
int | httpRemoveSessionVar(HttpConn *conn, cchar *name) |
Remove a session state variable. | |
void | httpRemoveUploadFile(HttpConn *conn, cchar *id) |
Remove an uploaded file. | |
int | httpRemoveUser(HttpAuth *auth, cchar *user) |
Remove a user. | |
void | httpResetCredentials(HttpConn *conn) |
Reset the current security credentials. | |
void | httpResetRoutePipeline(HttpRoute *route) |
Reset the route pipeline. | |
void | httpResetRoutes(HttpHost *host) |
Reset the list of routes for the host. | |
int | httpResizePacket(struct HttpQueue *q, HttpPacket *packet, ssize size) |
Resize a packet. | |
HttpUri* | httpResolveUri(HttpUri *base, int argc, HttpUri **others, bool local) |
Resolve URIs relative to a base. | |
void | httpResumeQueue(HttpQueue *q) |
Resume a queue. | |
void | httpRouteRequest(HttpConn *conn) |
Route the request and select that matching route and handle to process the request. | |
void | httpScheduleQueue(HttpQueue *q) |
Schedule a queue. | |
int | httpSecureEndpoint(HttpEndpoint *endpoint, struct MprSsl *ssl) |
Secure an endpoint. | |
int | httpSecureEndpointByName(cchar *name, struct MprSsl *ssl) |
Secure an endpoint by name. | |
ssize | httpSend(HttpConn *conn, cchar *fmt, ...) |
Send a UTF-8 text message to the web socket peer. | |
ssize | httpSendBlock(HttpConn *conn, int type, cchar *buf, ssize len, int flags) |
Send a message of a given type to the web socket peer. | |
void | httpSendClose(HttpConn *conn, int status, cchar *reason) |
Send a close message to the web socket peer. | |
void | httpServiceQueue(HttpQueue *q) |
Service a queue. | |
bool | httpServiceQueues(HttpConn *conn) |
Service pipeline queues to flow data. | |
void | httpSetAsync(HttpConn *conn, int enable) |
Set the async mode value for the connection. | |
void | httpSetAuthAllow(HttpAuth *auth, cchar *ip) |
Allow access by a client IP IP address. | |
void | httpSetAuthAnyValidUser(HttpAuth *auth) |
Allow access by any valid user. | |
void | httpSetAuthAutoLogin(HttpAuth *auth, bool on) |
Enable auto login. | |
void | httpSetAuthDeny(HttpAuth *auth, cchar *ip) |
Deny access by a client IP address. | |
void | httpSetAuthForm(struct HttpRoute *parent, cchar *loginPage, cchar *loginService, cchar *logoutService, cchar *loggedIn) |
Define the callbabcks for the 'post' authentication type. | |
void | httpSetAuthOrder(HttpAuth *auth, int order) |
Set the auth allow/deny order. | |
void | httpSetAuthPermittedUsers(HttpAuth *auth, cchar *users) |
Define the set of permitted users. | |
void | httpSetAuthQop(HttpAuth *auth, cchar *qop) |
Set the required quality of service for digest authentication. | |
void | httpSetAuthRealm(HttpAuth *auth, cchar *realm) |
Set the required realm for basic or digest authentication. | |
void | httpSetAuthRequiredAbilities(HttpAuth *auth, cchar *abilities) |
Set the required abilities for access. | |
int | httpSetAuthStore(HttpAuth *auth, cchar *store) |
Set the authentication password store to use. | |
int | httpSetAuthType(HttpAuth *auth, cchar *proto, cchar *details) |
Set the authentication protocol to use. | |
void | httpSetChunkSize(HttpConn *conn, ssize size) |
Set the chunk size for transfer chunked encoding. | |
void | httpSetConnContext(HttpConn *conn, void *context) |
Set the connection context object. | |
void | httpSetConnHost(HttpConn *conn, void *host) |
Set the connection host object. | |
void | httpSetConnNotifier(HttpConn *conn, HttpNotifier notifier) |
Define a notifier callback for this connection. | |
void | httpSetContentLength(HttpConn *conn, MprOff length) |
Define a content length header in the transmission. | |
void | httpSetContentType(HttpConn *conn, cchar *mimeType) |
Set the transmission (response) content mime type. | |
void | httpSetContext(Http *http, void *context) |
Set the http context object. | |
void | httpSetCookie(HttpConn *conn, cchar *name, cchar *value, cchar *path, cchar *domain, MprTicks lifespan, int flags) |
Set a transmission cookie. | |
void | httpSetCredentials(HttpConn *conn, cchar *user, cchar *password, cchar *authType) |
Set the Http credentials. | |
void | httpSetDefaultClientHost(Http *http, cchar *host) |
Define a default client host. | |
void | httpSetDefaultClientPort(Http *http, int port) |
Define a default client port. | |
void | httpSetDefaultHost(HttpHost *host) |
Set the default host for all servers. | |
void | httpSetEndpointAddress(HttpEndpoint *endpoint, cchar *ip, int port) |
Set the endpoint IP address. | |
void | httpSetEndpointAsync(HttpEndpoint *endpoint, int enable) |
Control if the endpoint is running in asynchronous mode. | |
void | httpSetEndpointContext(HttpEndpoint *endpoint, void *context) |
Set the endpoint context object. | |
void | httpSetEndpointNotifier(HttpEndpoint *endpoint, HttpNotifier fn) |
Define a notifier callback for this endpoint. | |
void | httpSetEntityLength(HttpConn *conn, MprOff len) |
Define the length of the transmission content. | |
void | httpSetForkCallback(struct Http *http, MprForkCallback proc, void *arg) |
Set the fork callback. | |
void | httpSetHasNamedVirtualHosts(HttpEndpoint *endpoint, bool on) |
Control whether the endpoint has named virtual hosts. | |
void | httpSetHeader(HttpConn *conn, cchar *key, cchar *fmt, ...) |
Set a transmission header. | |
void | httpSetHeaderString(HttpConn *conn, cchar *key, cchar *value) |
Set a simple key/value transmission header. | |
void | httpSetHeadersCallback(struct HttpConn *conn, HttpHeadersCallback fn, void *arg) |
Define a headers callback. | |
void | httpSetHostDefaultEndpoint(HttpHost *host, HttpEndpoint *endpoint) |
Set the default endpoint for a host. | |
void | httpSetHostDefaultRoute(HttpHost *host, HttpRoute *route) |
Set the default route for a host. | |
void | httpSetHostIpAddr(HttpHost *host, cchar *ip, int port) |
Set the host internet address. | |
void | httpSetHostName(HttpHost *host, cchar *name) |
Set the host name. | |
void | httpSetHostProtocol(HttpHost *host, cchar *protocol) |
Set the host HTTP protocol version. | |
void | httpSetHostRoot(HttpHost *host, cchar *root) |
Set the server root for a host. | |
void | httpSetHostSecureEndpoint(HttpHost *host, HttpEndpoint *endpoint) |
Set the default secure endpoint for a host. | |
void | httpSetIOCallback(struct HttpConn *conn, HttpIOCallback fn) |
Define an I/O callback for connections. | |
void | httpSetIntParam(HttpConn *conn, cchar *var, int value) |
Set an integer request param value. | |
void | httpSetKeepAliveCount(HttpConn *conn, int count) |
Control Http Keep-Alive for the connection. | |
void | httpSetMethod(HttpConn *conn, cchar *method) |
Set a new HTTP method for processing. | |
void | httpSetOption(MprHash *options, cchar *field, cchar *value) |
Set an option. | |
void | httpSetParam(HttpConn *conn, cchar *var, cchar *value) |
Set a request param value. | |
void | httpSetProtocol(HttpConn *conn, cchar *protocol) |
Set the Http protocol variant for this connection. | |
void | httpSetProxy(Http *http, cchar *host, int port) |
Define a Http proxy host to use for all client connect requests. | |
void | httpSetQueueLimits(HttpQueue *q, ssize low, ssize max) |
Set a queue's flow control low and high water marks. | |
void | httpSetResponded(HttpConn *conn) |
Set the responded flag for the request. | |
void | httpSetRetries(HttpConn *conn, int retries) |
Set the Http retry count. | |
void | httpSetRouteAuth(HttpRoute *route, HttpAuth *auth) |
Set the route authentication. | |
void | httpSetRouteAutoDelete(HttpRoute *route, bool on) |
Control file upload auto delete. | |
void | httpSetRouteCompression(HttpRoute *route, int flags) |
Contol content compression for the route. | |
int | httpSetRouteConnector(HttpRoute *route, cchar *name) |
Set the connector to use for a route. | |
void | httpSetRouteData(HttpRoute *route, cchar *key, void *data) |
Set route data. | |
void | httpSetRouteDefaultLanguage(HttpRoute *route, cchar *language) |
Set the default language for the route. | |
void | httpSetRouteDir(HttpRoute *route, cchar *dir) |
Set the route directory. | |
void | httpSetRouteFlags(HttpRoute *route, int flags) |
Update the route flags. | |
int | httpSetRouteHandler(HttpRoute *route, cchar *name) |
Set the handler to use for a route. | |
void | httpSetRouteHome(HttpRoute *route, cchar *home) |
Set the route directory for configuration files. | |
int | httpSetRouteLog(HttpRoute *route, cchar *path, ssize size, int backup, cchar *format, int flags) |
Configure the route access log. | |
void | httpSetRouteMethods(HttpRoute *route, cchar *methods) |
Define the methods for the route. | |
void | httpSetRouteName(HttpRoute *route, cchar *name) |
Set the route name. | |
void | httpSetRoutePattern(HttpRoute *route, cchar *pattern, int flags) |
Set the route pattern. | |
void | httpSetRoutePrefix(HttpRoute *route, cchar *prefix) |
Set the route prefix. | |
void | httpSetRouteScript(HttpRoute *route, cchar *script, cchar *scriptPath) |
Set the script to service the route. | |
void | httpSetRouteSource(HttpRoute *route, cchar *source) |
Set the source code module for the route. | |
int | httpSetRouteTarget(HttpRoute *route, cchar *name, cchar *details) |
Set a route target. | |
void | httpSetRouteTemplate(HttpRoute *route, cchar *tplate) |
Set the route template. | |
void | httpSetRouteTraceFilter(HttpRoute *route, int dir, int levels[HTTP_TRACE_MAX_ITEM], ssize len, cchar *include, cchar *exclude) |
Set the route trace filter. | |
void | httpSetRouteVar(HttpRoute *route, cchar *token, cchar *value) |
Define a path token variable. | |
void | httpSetRouteWorkers(HttpRoute *route, int workers) |
Define the maximum number of workers for a route. | |
void | httpSetSendConnector(HttpConn *conn, cchar *path) |
Set the "Send" connector to process the request. | |
int | httpSetSessionObj(HttpConn *conn, cchar *key, MprHash *value) |
Set an object into the session state store. | |
int | httpSetSessionVar(HttpConn *conn, cchar *name, cchar *value) |
Set a session variable. | |
void | httpSetSoftware(Http *http, cchar *description) |
Set the software description. | |
void | httpSetStageData(struct HttpConn *conn, cchar *key, cvoid *data) |
Set stage data. | |
void | httpSetState(HttpConn *conn, int state) |
Set the connection state and invoke notifiers. | |
void | httpSetStatus(HttpConn *conn, int status) |
Set a Http response status. | |
void | httpSetTimeout(HttpConn *conn, MprTicks requestTimeout, MprTicks inactivityTimeout) |
Set the Http inactivity timeout. | |
void | httpSetTimestamp(MprTicks period) |
Define a timestamp in the MPR log file. | |
int | httpSetUri(HttpConn *conn, cchar *uri) |
Set a new URI for processing. | |
void | httpSetWebSocketProtocols(HttpConn *conn, cchar *protocols) |
Set a list of application-level protocols supported by the client. | |
void | httpSetupWaitHandler(HttpConn *conn, int eventMask) |
Setup a wait handler for the connection to wait for desired events. | |
int | httpShouldTrace(HttpConn *conn, int dir, int item, cchar *ext) |
Test if the item should be traced. | |
void | httpSocketBlocked(HttpConn *conn) |
Indicate that the transmission socket is blocked. | |
HttpPacket* | httpSplitPacket(HttpPacket *packet, ssize offset) |
Split a data packet. | |
int | httpStartEndpoint(HttpEndpoint *endpoint) |
Start listening for client connections. | |
void | httpStartPipeline(HttpConn *conn) |
Start the pipeline. | |
char* | httpStatsReport(int flags) |
Get an Http performance report. | |
MprSocket* | httpStealConn(HttpConn *conn) |
Steal a connection from Appweb. | |
void | httpStopEndpoint(HttpEndpoint *endpoint) |
Stop the server listening for client connections. | |
void | httpSuspendQueue(HttpQueue *q) |
Suspend a queue. | |
char* | httpTemplate(HttpConn *conn, cchar *tplate, MprHash *options) |
Expand a template string using given options. | |
int | httpTestParam(HttpConn *conn, cchar *var) |
Test if a request param is defined. | |
bool | httpTokenize(HttpRoute *route, cchar *str, cchar *fmt, ...) |
Tokenize a string based on route data. | |
bool | httpTokenizev(HttpRoute *route, cchar *str, cchar *fmt, va_list args) |
Tokenize a string based on route data. | |
void | httpTrimExtraPath(HttpConn *conn) |
Trim extra path from the URI. | |
ssize | httpUpdateCache(HttpConn *conn, cchar *uri, cchar *data, MprTicks lifespan) |
Update the cached content for a URI. | |
int | httpUpgradeWebSocket(HttpConn *conn) |
Upgrade a client HTTP connection connection to use WebSockets. | |
char* | httpUriToString(HttpUri *uri, int flags) |
Convert a Uri to a string. | |
bool | httpValidateLimits(HttpEndpoint *endpoint, int event, HttpConn *conn) |
Validate the request against defined resource limits. | |
bool | httpVerifyWebSocketsHandshake(HttpConn *conn) |
Verify the server handshake. | |
int | httpWait(HttpConn *conn, int state, MprTicks timeout) |
Wait for the connection to achieve the requested state. | |
bool | httpWebSocketOrderlyClosed(HttpConn *conn) |
Test if web socket connection was orderly closed by sending an acknowledged close message. | |
bool | httpWillNextQueueAcceptPacket(HttpQueue *q, HttpPacket *packet) |
Determine if the downstream queue will accept this packet. | |
bool | httpWillNextQueueAcceptSize(HttpQueue *q, ssize size) |
Determine if the downstream queue will accept a certain amount of data. | |
bool | httpWillQueueAcceptPacket(HttpQueue *q, HttpPacket *packet, bool split) |
Determine if the given queue will accept this packet. | |
ssize | httpWrite(HttpQueue *q, cchar *fmt, ...) |
Write a formatted string. | |
ssize | httpWriteBlock(HttpQueue *q, cchar *buf, ssize size, int flags) |
Write a block of data to the queue. | |
ssize | httpWriteCached(HttpConn *conn) |
Write the cached content for a URI to the client. | |
void | httpWriteHeaders(HttpQueue *q, HttpPacket *packet) |
Write the transmission headers into the given packet. | |
void | httpWriteRouteLog(HttpRoute *route, cchar *buf, ssize len) |
Write data to the route access log. | |
ssize | httpWriteString(HttpQueue *q, cchar *s) |
Write a string of data to the queue. | |
ssize | httpWriteUploadData(HttpConn *conn, MprList *formData, MprList *fileData) |
Write Http upload body data. |
HttpAskLogin | AuthType callback to generate a response requesting the user login This should call httpError if such a response cannot be generated. |
HttpAuthStore | Password backend store. |
HttpAuthType | Authentication Protocol. |
HttpEnvCallback | Set environment vars callback. |
HttpFillProc | Callback procedure to fill a packet with data. |
HttpHeadersCallback | Callback to fill headers. |
HttpIOCallback | I/O callback for connections. |
HttpLang | Language definition record for routes. |
HttpListenCallback | Listen callback. |
HttpNotifier | Connection Http state change notification callback. |
HttpParseAuth | AuthType callback to parse the HTTP 'Authorize' (client) and 'www-authenticate' (server) headers. |
HttpRedirectCallback | Define an callback for IO events on this connection. |
HttpRole | Authorization Roles. |
HttpRouteOp | Route operation record. |
HttpRouteProc | General route procedure. |
HttpSetAuth | AuthType callback to set the necessary HTTP authorization headers for a client request. |
HttpTimeoutCallback | Timeout callback. |
HttpUser | User Authorization. |
HttpVerifyUser | AuthStore callback Verify the user credentials. |
#define | BIT_HTTP_SOFTWARE "Embedthis-http" |
Default Http protocol name used in Http Server header. | |
#define | BIT_MAX_CACHE_DURATION (86400 * 1000) |
Default cache lifespan to 1 day. | |
#define | BIT_MAX_CACHE_ITEM (256 * 1024) |
Maximum cachable item size. | |
#define | BIT_MAX_CHUNK (8 * 1024) |
Maximum chunk size for transfer chunk encoding. | |
#define | BIT_MAX_CLIENTS 32 |
Maximum concurrent client endpoints. | |
#define | BIT_MAX_CLIENTS_HASH 131 |
Hash table for client IP addresses. | |
#define | BIT_MAX_HEADERS 8192 |
Maximum size of the headers. | |
#define | BIT_MAX_INACTIVITY_DURATION (60 * 1000) |
Default keep connection alive between requests timeout. | |
#define | BIT_MAX_IOVEC 16 |
Number of fragments in a single socket write. | |
#define | BIT_MAX_KEEP_ALIVE 200 |
Maximum requests per connection. | |
#define | BIT_MAX_NUM_HEADERS 30 |
Maximum number of header lines. | |
#define | BIT_MAX_PARSE_DURATION (30 * 1000) |
Default request parse header timeout. | |
#define | BIT_MAX_PING_DURATION (30 * 1000) |
WSS ping defeat Keep-Alive timeouts (30 sec). | |
#define | BIT_MAX_QBUFFER (32 * 1024) |
Maximum buffer for any pipeline queue. | |
#define | BIT_MAX_RECEIVE_BODY (128 * 1024 * 1024) |
Maximum incoming body size. | |
#define | BIT_MAX_RECEIVE_FORM (1024 * 1024) |
Maximum incoming form size. | |
#define | BIT_MAX_REQUEST_DURATION MAXINT |
Default request timeout (unlimited). | |
#define | BIT_MAX_REQUESTS 50 |
Maximum concurrent requests. | |
#define | BIT_MAX_REQUESTS_PER_CLIENT 20 |
Maximum concurrent requests. | |
#define | BIT_MAX_REWRITE 20 |
Maximum URI rewrites. | |
#define | BIT_MAX_ROUTE_MATCHES 32 |
Maximum number of submatches in routes. | |
#define | BIT_MAX_SESSION_DURATION (3600 * 1000) |
Default session timeout (one hour). | |
#define | BIT_MAX_SESSIONS 100 |
Maximum concurrent sessions. | |
#define | BIT_MAX_TX_BODY (INT_MAX) |
Maximum buffer for response data. | |
#define | BIT_MAX_URI 1024 |
Reasonable URI size. | |
#define | BIT_MAX_WSS_FRAME (4 * 1024) |
Default max WebSockets message frame size. | |
#define | BIT_MAX_WSS_PACKET (8 * 1024) |
Default size to provide to application in one packet. | |
#define | BIT_MAX_WSS_SOCKETS 200 |
Default max WebSockets. | |
#define | HTTP_ADDED_FORM_PARAMS 0x800 |
Form body data added to params. | |
#define | HTTP_ADDED_QUERY_PARAMS 0x400 |
Query added to params. | |
#define | HTTP_ALLOW_DENY 0x1 |
Run allow checks before deny checks. | |
#define | HTTP_AUTH_CHECKED 0x4000 |
User authentication has been checked. | |
#define | HTTP_AUTO_LOGIN 0x4 |
Auto login for debug. | |
#define | HTTP_BLOCK 0x2 |
Flag for httpSendBlock and httpWriteBlock to indicate blocking operation. | |
#define | HTTP_BUFFER 0x1 |
Flag for httpSendBlock and httpWriteBlock to always absorb the data without blocking. | |
#define | HTTP_CACHE_ALL 0x10 |
Cache the same pathInfo together regardless of the request params. | |
#define | HTTP_CACHE_CLIENT 0x1 |
Cache on the client side. | |
#define | HTTP_CACHE_MANUAL 0x4 |
Cache manually. | |
#define | HTTP_CACHE_ONLY 0x20 |
Cache exactly the specified URI with params. | |
#define | HTTP_CACHE_RESET 0x8 |
Don't inherit cache config from outer routes. | |
#define | HTTP_CACHE_SERVER 0x2 |
Cache on the server side. | |
#define | HTTP_CACHE_UNIQUE 0x40 |
Uniquely cache request with different params. | |
#define | HTTP_CHUNK_DATA 2 |
Start of chunk data. | |
#define | HTTP_CHUNK_EOF 3 |
End of last chunk. | |
#define | HTTP_CHUNK_START 1 |
Start of a new chunk. | |
#define | HTTP_CHUNK_UNCHUNKED 0 |
Data is not transfer-chunk encoded. | |
#define | HTTP_CHUNKED 0x200 |
Content is chunk encoded. | |
#define | HTTP_CLIENT_SIDE 0x1 |
Initialize the client-side support. | |
#define | HTTP_CODE_ACCEPTED 202 |
The request has been accepted and processing is continuing. | |
#define | HTTP_CODE_BAD_GATEWAY 502 |
The server cannot act as a gateway for the given request. | |
#define | HTTP_CODE_BAD_HANDSHAKE 551 |
The server handsake response is unacceptable. | |
#define | HTTP_CODE_BAD_METHOD 405 |
The request HTTP method was not supported by the resource. | |
#define | HTTP_CODE_BAD_REQUEST 400 |
The request is malformed. | |
#define | HTTP_CODE_BAD_VERSION 505 |
The server does not support the HTTP protocol version. | |
#define | HTTP_CODE_COMMS_ERROR 550 |
The server had a communicationss error responding to the client. | |
#define | HTTP_CODE_CONFLICT 409 |
The request had a conflict in the request headers and URI. | |
#define | HTTP_CODE_CONTINUE 100 |
Continue with request, only partial content transmitted. | |
#define | HTTP_CODE_CREATED 201 |
The request has completed and a new resource was created. | |
#define | HTTP_CODE_EXPECTATION_FAILED 417 |
The server cannot satisfy the Expect header requirements. | |
#define | HTTP_CODE_FORBIDDEN 403 |
The request was legal, but the server refuses to process. | |
#define | HTTP_CODE_GATEWAY_TIMEOUT 504 |
The server gateway timed out waiting for the upstream server. | |
#define | HTTP_CODE_GONE 410 |
The requested resource is no longer available. | |
#define | HTTP_CODE_INSUFFICIENT_STORAGE 507 |
The server has insufficient storage to complete the request. | |
#define | HTTP_CODE_INTERNAL_SERVER_ERROR 500 |
Server processing or configuration error. | |
#define | HTTP_CODE_LENGTH_REQUIRED 411 |
The request did not specify a required content length. | |
#define | HTTP_CODE_MOVED_PERMANENTLY 301 |
The requested URI has moved permanently to a new location. | |
#define | HTTP_CODE_MOVED_TEMPORARILY 302 |
The URI has moved temporarily to a new location. | |
#define | HTTP_CODE_NO_CONTENT 204 |
The request has completed and there is no response to send. | |
#define | HTTP_CODE_NO_RESPONSE 444 |
The connection was closed with no response to the client. | |
#define | HTTP_CODE_NOT_ACCEPTABLE 406 |
The requested resource cannot generate the required content. | |
#define | HTTP_CODE_NOT_AUTHORITATIVE 203 |
The request has completed but content may be from another source. | |
#define | HTTP_CODE_NOT_FOUND 404 |
The requested resource was not found. | |
#define | HTTP_CODE_NOT_IMPLEMENTED 501 |
The server does not recognize the request or method. | |
#define | HTTP_CODE_NOT_MODIFIED 304 |
The requested resource has changed since the last request. | |
#define | HTTP_CODE_OK 200 |
The request completed successfully. | |
#define | HTTP_CODE_PARTIAL 206 |
The request has completed and is returning partial content. | |
#define | HTTP_CODE_PAYMENT_REQUIRED 402 |
Reserved for future use. | |
#define | HTTP_CODE_PRECOND_FAILED 412 |
The server cannot satisfy one of the request preconditions. | |
#define | HTTP_CODE_RANGE_NOT_SATISFIABLE 416 |
The request content range does not exist for the resource. | |
#define | HTTP_CODE_REQUEST_TIMEOUT 408 |
The server timed out waiting for the request to complete. | |
#define | HTTP_CODE_REQUEST_TOO_LARGE 413 |
The request is too large for the server to process. | |
#define | HTTP_CODE_REQUEST_URL_TOO_LARGE 414 |
The request URI is too long for the server to process. | |
#define | HTTP_CODE_RESET 205 |
The request has completed with no content. | |
#define | HTTP_CODE_SEE_OTHER 303 |
The requested URI can be found at another URI location. | |
#define | HTTP_CODE_SERVICE_UNAVAILABLE 503 |
The server is currently unavailable or overloaded. | |
#define | HTTP_CODE_SWITCHING 101 |
Switching protocols. | |
#define | HTTP_CODE_TEMPORARY_REDIRECT 307 |
The request should be repeated at another URI location. | |
#define | HTTP_CODE_UNAUTHORIZED 401 |
Authentication for the request has failed. | |
#define | HTTP_CODE_UNSUPPORTED_MEDIA_TYPE 415 |
The request media type is not supported by the server or resource. | |
#define | HTTP_CODE_USE_PROXY 305 |
The requested resource must be accessed via the location proxy. | |
#define | HTTP_COMPLETE_URI 0x1 |
Complete all missing URI fields. | |
#define | HTTP_COMPLETE_URI_PATH 0x2 |
Complete missing URI path. | |
#define | HTTP_COOKIE_HTTP 0x2 |
Flag for httpSetCookie for http cookies (http only). | |
#define | HTTP_COOKIE_SECURE 0x1 |
Flag for httpSetCookie for secure cookies (https only). | |
#define | HTTP_CREATE_ENV 0x80 |
Must create env for this request. | |
#define | HTTP_DELAY_SERVICE 0 |
Delay servicing the queue. | |
#define | HTTP_DELETE 0x1 |
DELETE method. | |
#define | HTTP_DENY_ALLOW 0x2 |
Run deny checks before allow checks. | |
#define | HTTP_EVENT_APP_CLOSE 7 |
The request is now closed. | |
#define | HTTP_EVENT_APP_OPEN 6 |
The request is now open. | |
#define | HTTP_EVENT_DESTROY 5 |
The connection is being closed and destroyed. | |
#define | HTTP_EVENT_ERROR 4 |
The request has an error. | |
#define | HTTP_EVENT_READABLE 2 |
The request has data available for reading. | |
#define | HTTP_EVENT_STATE 1 |
Notifier events. | |
#define | HTTP_EVENT_WRITABLE 3 |
The request is now writable (post / put data). | |
#define | HTTP_EXPECT_CONTINUE 0x2000 |
Client expects an HTTP 100 Continue response. | |
#define | HTTP_GET 0x2 |
GET method. | |
#define | HTTP_HEAD 0x4 |
HEAD method. | |
#define | HTTP_HOST_NAMED_VHOST 0x2 |
Host flag for a named virtual host. | |
#define | HTTP_HOST_NO_TRACE 0x10 |
Host flag to disable the of TRACE HTTP method. | |
#define | HTTP_HOST_VHOST 0x1 |
Host flag to signify host is a virtual host. | |
#define | HTTP_IF_MODIFIED 0x100 |
If-[un]modified-since supplied. | |
#define | HTTP_LANG_AFTER 0x2 |
Insert suffix after extension. | |
#define | HTTP_LANG_BEFORE 0x1 |
Insert suffix before extension. | |
#define | HTTP_LIMITS_OPENED 0x1000 |
Request limits opened. | |
#define | HTTP_MAX_QUEUE 2 |
Number of queue types. | |
#define | HTTP_MAX_SECRET 16 |
Size of secret data for auth. | |
#define | HTTP_MAX_WSS_MESSAGE (2147483647) |
Default max WebSockets message size (2GB). | |
#define | HTTP_MORE 0x1000 |
Flag for httpSendBlock to indicate there are more frames for this message. | |
#define | HTTP_NAMED_VHOST 0x1 |
Using named virtual hosting. | |
#define | HTTP_NEW_DISPATCHER 0x2 |
New dispatcher for each connection. | |
#define | HTTP_NON_BLOCK 0x4 |
Flag for httpSendBlock and httpWriteBlock to indicate non-blocking operation. | |
#define | HTTP_OPTIONS 0x8 |
OPTIONS method. | |
#define | HTTP_PACKET_DATA 0x4 |
Packet contains actual content data. | |
#define | HTTP_PACKET_END 0x8 |
End of stream packet. | |
#define | HTTP_PACKET_HEADER 0x1 |
Packet contains HTTP headers. | |
#define | HTTP_PACKET_RANGE 0x2 |
Packet is a range boundary packet. | |
#define | HTTP_PACKET_SOLO 0x10 |
Don't join this packet. | |
#define | HTTP_POST 0x10 |
Post method. | |
#define | HTTP_PUT 0x20 |
PUT method. | |
#define | HTTP_QUEUE_ALL 0x10 |
Queue has all the data there is and will be. | |
#define | HTTP_QUEUE_EOF 0x40 |
Queue at end of data. | |
#define | HTTP_QUEUE_OPEN 0x1 |
Queue's open routine has been called. | |
#define | HTTP_QUEUE_READY 0x100 |
Handler stage ready routine called. | |
#define | HTTP_QUEUE_RESERVICE 0x200 |
Queue requires reservicing. | |
#define | HTTP_QUEUE_RX 1 |
Receive (read from client) queue. | |
#define | HTTP_QUEUE_SERVICED 0x20 |
Queue has been serviced at least once. | |
#define | HTTP_QUEUE_STARTED 0x80 |
Handler stage start routine called. | |
#define | HTTP_QUEUE_SUSPENDED 0x2 |
Queue's service routine is suspended due to flow control. | |
#define | HTTP_QUEUE_TX 0 |
Send (transmit to client) queue. | |
#define | HTTP_RETRIES 3 |
Default number of retries for client requests. | |
#define | HTTP_ROUTE_FREE 0x2 |
Free Route.mdata back to malloc when route is freed. | |
#define | HTTP_ROUTE_FREE_PATTERN 0x4 |
Free Route.patternCompiled back to malloc when route is freed. | |
#define | HTTP_ROUTE_GZIP 0x1000 |
Support gzipped content on this route. | |
#define | HTTP_ROUTE_NOT 0x1 |
Negate the route pattern test result. | |
#define | HTTP_ROUTE_OK 0 |
The route matches the request. | |
#define | HTTP_ROUTE_PUT_DELETE_METHODS 0x4000 |
Support PUT|DELETE on this route. | |
#define | HTTP_ROUTE_RAW 0x8 |
Don't html encode the write data. | |
#define | HTTP_ROUTE_REJECT 1 |
The route does not match the request. | |
#define | HTTP_ROUTE_REROUTE 2 |
Request has been modified and must be re-routed. | |
#define | HTTP_ROUTE_STARTED 0x2000 |
Route initialized. | |
#define | HTTP_ROUTE_TRACE_METHOD 0x8000 |
Enable the trace method for handlers supporting it. | |
#define | HTTP_SCHEDULE_QUEUE 1 |
Schedule the queue for service. | |
#define | HTTP_SERVER_SIDE 0x2 |
Initialize the server-side support. | |
#define | HTTP_SESSION_AUTHVER "_:VERSION:_" |
Auth version number. | |
#define | HTTP_SESSION_COOKIE "-http-session-" |
Session cookie name. | |
#define | HTTP_SESSION_USERNAME "_:USERNAME:_" |
Username variable. | |
#define | HTTP_STAGE_AUTO_DIR 0x10000 |
Want auto directory redirection. | |
#define | HTTP_STAGE_CONNECTOR 0x1000 |
Stage is a connector. | |
#define | HTTP_STAGE_FILTER 0x4000 |
Stage is a filter. | |
#define | HTTP_STAGE_HANDLER 0x2000 |
Stage is a handler. | |
#define | HTTP_STAGE_MODULE 0x8000 |
Stage is a filter. | |
#define | HTTP_STAGE_RX 0x40000 |
Stage to be used in the Rx direction. | |
#define | HTTP_STAGE_TX 0x80000 |
Stage to be used in the Tx direction. | |
#define | HTTP_STAGE_UNLOADED 0x20000 |
Stage module library has been unloaded. | |
#define | HTTP_STATE_BEGIN 1 |
Ready for a new request. | |
#define | HTTP_STATE_COMPLETE 9 |
Request complete. | |
#define | HTTP_STATE_CONNECTED 2 |
Connection received or made. | |
#define | HTTP_STATE_CONTENT 5 |
Reading posted content. | |
#define | HTTP_STATE_FINALIZED 8 |
Input received, request processed and response transmitted. | |
#define | HTTP_STATE_FIRST 3 |
First request line has been parsed. | |
#define | HTTP_STATE_PARSED 4 |
Headers have been parsed, handler can start. | |
#define | HTTP_STATE_READY 6 |
Handler ready - all body data received. | |
#define | HTTP_STATE_RUNNING 7 |
Handler running. | |
#define | HTTP_TIMER_PERIOD 1000 |
HttpTimer checks ever 1 second. | |
#define | HTTP_TRACE 0x40 |
TRACE method. | |
#define | HTTP_TRACE_BODY 3 |
Body content. | |
#define | HTTP_TRACE_CONN 0 |
New connections. | |
#define | HTTP_TRACE_FIRST 1 |
First line of header only. | |
#define | HTTP_TRACE_HEADER 2 |
Header. | |
#define | HTTP_TRACE_LIMITS 4 |
Request and connection count limits. | |
#define | HTTP_TRACE_MAX_DIR 2 |
Trace transmission. | |
#define | HTTP_TRACE_RX 0 |
Trace reception. | |
#define | HTTP_TRACE_TIME 5 |
Instrument http pipeline. | |
#define | HTTP_TRACE_TX 1 |
Trace transmission. | |
#define | HTTP_TX_HEADERS_CREATED 0x2 |
Response headers have been created. | |
#define | HTTP_TX_MATCHED 0x20 |
Handler match routine run. | |
#define | HTTP_TX_NO_BODY 0x1 |
No transmission body, only send headers. | |
#define | HTTP_TX_NO_LENGTH 0x10 |
Don't emit a content length (used for TRACE). | |
#define | HTTP_TX_SENDFILE 0x4 |
Relay output via Send connector. | |
#define | HTTP_TX_USE_OWN_HEADERS 0x8 |
Skip adding default headers. | |
#define | HTTP_UTILITY 0x4 |
Http engine for utilities (esp). | |
#define | HTTP_VALIDATE_CLOSE_CONN 2 |
Close a connection. | |
#define | HTTP_VALIDATE_CLOSE_PROCESS 6 |
Close a CGI process. | |
#define | HTTP_VALIDATE_CLOSE_REQUEST 4 |
Close a request. | |
#define | HTTP_VALIDATE_OPEN_CONN 1 |
Open a new connection. | |
#define | HTTP_VALIDATE_OPEN_PROCESS 5 |
Open a new CGI process. | |
#define | HTTP_VALIDATE_OPEN_REQUEST 3 |
Open a new request. | |
#define | WS_MSG_BINARY 0x2 |
httpSendBlock type for binary messages. | |
#define | WS_MSG_CLOSE 0x8 |
httpSendBlock type for close message. | |
#define | WS_MSG_CONT 0x0 |
Continuation of WebSocket message. | |
#define | WS_MSG_CONTROL 0x8 |
Start of control messages. | |
#define | WS_MSG_MAX 0xB |
Max message type for httpSendBlock. | |
#define | WS_MSG_PING 0x9 |
httpSendBlock type for ping messages. | |
#define | WS_MSG_PONG 0xA |
httpSendBlock type for pong messages. | |
#define | WS_MSG_TEXT 0x1 |
httpSendBlock type for text messages. | |
#define | WS_STATE_CLOSED 3 |
WebSocket is closed. | |
#define | WS_STATE_CLOSING 2 |
WebSocket is closing. | |
#define | WS_STATE_CONNECTING 0 |
WebSocket connection is being established. | |
#define | WS_STATE_OPEN 1 |
WebSocket handsake is complete and ready for communications. | |
#define | WS_STATUS_COMMS_ERROR 1006 |
TCP/IP communications error. | |
#define | WS_STATUS_FRAME_TOO_LARGE 1004 |
Message frame is too large. | |
#define | WS_STATUS_GOING_AWAY 1001 |
Endpoint is going away. | |
#define | WS_STATUS_INTERNAL_ERROR 1011 |
Server terminating due to an internal error. | |
#define | WS_STATUS_INVALID_UTF8 1007 |
Text message has invalid UTF-8. | |
#define | WS_STATUS_MAX 5000 |
Maximum error status (less one). | |
#define | WS_STATUS_MESSAGE_TOO_LARGE 1009 |
Message is too large. | |
#define | WS_STATUS_MISSING_EXTENSION 1010 |
Unsupported WebSockets extension. | |
#define | WS_STATUS_NO_STATUS 1005 |
No status was received from the peer in closing. | |
#define | WS_STATUS_OK 1000 |
Normal closure. | |
#define | WS_STATUS_POLICY_VIOLATION 1008 |
Application level policy violation. | |
#define | WS_STATUS_PROTOCOL_ERROR 1002 |
WebSockets protocol error. | |
#define | WS_STATUS_TLS_ERROR 1015 |
TLS handshake error. | |
#define | WS_STATUS_UNSUPPORTED_TYPE 1003 |
Unsupported message data type. |
Http service object.
struct HttpStage * | actionHandler | Action handler. | |
int | activeProcesses | Count of active external processes. | |
int | activeSessions | Count of active sessions. | |
int | activeVMs | Number of ejs VMs. | |
MprHash * | authStores | Available password stores. | |
MprHash * | authTypes | Available authentication protocol types. | |
MprTime | booted | Time the server started. | |
struct HttpStage * | cacheFilter | Cache filter. | |
struct HttpStage * | cacheHandler | Cache filter. | |
struct HttpStage * | cgiConnector | CGI connector. | |
struct HttpStage * | cgiHandler | CGI handler. | |
struct HttpStage * | chunkFilter | Chunked transfer encoding filter. | |
struct HttpStage * | clientHandler | Client-side handler (dummy). | |
struct HttpLimits * | clientLimits | Client resource limits. | |
struct HttpRoute * | clientRoute | Default route for clients. | |
MprList * | connections | Currently open connection requests. | |
void * | context | Embedding context. | |
char * | currentDate | Date string for HTTP response headers. | |
MprTicks | currentTime | When currentDate was last calculated (ticks). | |
char * | defaultClientHost | Default ip address. | |
int | defaultClientPort | Default port. | |
struct HttpStage * | dirHandler | Directory listing handler. | |
struct HttpStage * | egiHandler | Embedded Gateway Interface (EGI) handler. | |
struct HttpStage * | ejsHandler | Ejscript Web Framework handler. | |
MprList * | endpoints | Currently configured listening endpoints. | |
HttpEnvCallback | envCallback | SetEnv callback. | |
struct HttpStage * | espHandler | ESP Web Framework handler. | |
struct HttpStage * | fileHandler | Static file handler. | |
int | flags | Open flags. | |
MprForkCallback | forkCallback | Callback in child after fork(). | |
MprList * | hosts | List of host objects. | |
HttpListenCallback | listenCallback | Invoked when creating listeners. | |
struct HttpStage * | netConnector | Default network connector. | |
int | nextAuth | Auth object version vector. | |
MprTicks | now | When was the currentDate last computed. | |
struct HttpStage * | passHandler | Pass through handler. | |
struct HttpStage * | phpHandler | PHP through handler. | |
char * | protocol | HTTP/1.0 or HTTP/1.1. | |
char * | proxyHost | Proxy ip address. | |
int | proxyPort | Proxy port. | |
struct HttpStage * | rangeFilter | Ranged requests filter. | |
HttpRedirectCallback | redirectCallback | Redirect callback. | |
MprHash * | routeConditions | Http route condition functions. | |
MprHash * | routeTargets | Http route target functions. | |
MprHash * | routeUpdates | Http route update functions. | |
char * | secret | Random bytes for authentication. | |
struct HttpStage * | sendConnector | Optimized sendfile connector. | |
struct HttpLimits * | serverLimits | Server resource limits. | |
MprCache * | sessionCache | Session state cache. | |
char * | software | Software name and version. | |
MprHash * | stages | Possible stages in connection pipelines. | |
MprHash * | statusCodes | Http status codes. | |
MprEvent * | timer | Admin service timer. | |
MprEvent * | timestamp | Timestamp timer. | |
uint64 | totalConnections | Total connections accepted. | |
uint64 | totalRequests | Total requests served. | |
int | underAttack | Under DOS attack. | |
struct HttpStage * | uploadFilter | Upload filter. | |
struct HttpStage * | webSocketFilter | WebSocket filter. |
Add an option to the options table.
options | Option table returned from httpGetOptions. |
field | Field key name. |
value | Value to use for the field. |
Create a Http service object.
flags | Set to zero to initialize bo Initialize the client-side support only. |
Create the Http secret data for crypto.
http | Http service object. |
Destroy the Http service object.
http | Http service object. |
Get the http context object.
http | Http service object. |
Get the time as an ISO date string.
sbuf | Optional path buffer. If supplied, the modified time of the path is used. If NULL, then the current time is used. |
Extract a field value from an option string.
options | Option string of the form: "field='value' field='value'...". |
field | Field key name. |
defaultValue | Value to use if "field" is not found in options. |
Get an option value that is itself an object (hash).
options | Options object to examine. |
field | Property to return. |
Convert an options string into an options table.
options | Option string of the form: "{field:'value', field:'value'}" This is a sub-set of the JSON syntax. Arrays are not supported. |
Add an option to the options table.
options | Option table returned from httpGetOptions. |
field | Field key name. |
value | Value to use for the field. |
Lookup a listening endpoint.
http | Http object created via httpCreate |
ip | Listening IP address to look for. |
port | Listening port number. |
Lookup a host by name.
http | Http object created via httpCreate |
name | The name of the host to find. |
Lookup a Http status code.
http | Http object created via httpCreate |
status | Http status code. |
Test a field value from an option string.
options | Option string of the form: "field='value' field='value'...". |
field | Field key name. |
value | Test if the field is set to this value. |
useDefault | If true and "field" is not found in options, return true. |
Remove an option.
options | Options table returned from httpGetOptions. |
field | Property field to remove. |
Set an option.
options | Options table returned from httpGetOptions. |
field | Property field to set. |
value | Property value to use. |
Define a Http proxy host to use for all client connect requests.
http | Http object created via httpCreate |
host | Proxy host name or IP address. |
port | Proxy host port number. |
Set the software description.
http | Http object created via httpCreate |
description | String describing the Http software. By default, this is set to HTTP_NAME. |
Authorization.
MprHash * | allow | Clients to allow. | |
MprHash * | deny | Clients to deny. | |
int | flags | Authorization flags. | |
char * | loggedIn | Target URI after logging in. | |
char * | loginPage | Web page for user login for 'post' type. | |
struct HttpAuth * | parent | Parent auth. | |
MprHash * | permittedUsers | User name for access. | |
char * | qop | Quality of service. | |
char * | realm | Realm of access. | |
MprHash * | requiredAbilities | Set of required abilities (all are required). | |
MprHash * | roles | Hash of roles. | |
HttpAuthStore * | store | Authorization password backend (system|file|custom). | |
HttpAuthType * | type | Authorization protocol type (basic|digest|form|custom). | |
MprHash * | users | Hash of users. | |
int | version | Inherited from parent and incremented on changes. |
Add an authorization store for password validation.
The pre-supplied types are 'system' and 'file'http | Http service object. |
name | Unique authorization type name. |
verifyUser | Callback to verify the username and password contained in the HttpConn object passed to the callback. |
Add an authorization type.
The pre-supplied types are 'basic', 'digest' and 'post'http | Http service object. |
name | Unique authorization type name. |
askLogin | Callback to generate a client login response. |
parse | Callback to parse the HTTP authentication headers. |
setAuth | Callback to set the HTTP response authentication headers. |
Add a role.
auth | Auth object allocated by httpCreateAuth |
role | Role name to add. |
abilities | Space separated list of abilities. |
Add a user.
auth | Auth object allocated by httpCreateAuth |
user | User name to add. |
password | User password. The password should not be encrypted. The backend will encrypt as required. |
abilities | Space separated list of abilities. |
Test if a user has the required abilities.
conn | HttpConn connection object created via httpCreateConn object. |
Compute all the user abilities for a route using the given auth.
auth | Auth object allocated by httpCreateAuth |
Compute the user abilities for a given user in a route using the given auth.
auth | Auth object allocated by httpCreateAuth |
user | User object. |
Create an authentication object.
Create a new role.
auth | Auth object allocated by httpCreateAuth |
name | Role name. |
abilities | Space separated list of abilities. |
Create a new user.
auth | Auth object allocated by httpCreateAuth |
name | User name. |
password | User password. The password should not be encrypted. The backend will encrypt as required. |
abilities | Space separated list of abilities. |
Test if the user is authenticated.
conn | HttpConn connection object. |
Log the user in.
conn | HttpConn connection object. |
username | User name to authenticate. |
password | Password for the user. |
Remove a role.
auth | Auth object allocated by httpCreateAuth |
role | Role name to remove. |
Remove a user.
auth | Auth object allocated by httpCreateAuth |
user | User name to remove. |
Allow access by a client IP IP address.
auth | Authorization object allocated by httpCreateAuth |
ip | Client IP address to allow. |
Allow access by any valid user.
auth | Authorization object allocated by httpCreateAuth |
Enable auto login.
auth | Auth object allocated by httpCreateAuth |
on | Set to true to enable auto login. |
Deny access by a client IP address.
auth | Authorization object allocated by httpCreateAuth |
ip | Client IP address to deny. This must be an IP address string. |
Define the callbabcks for the 'post' authentication type.
parent | Parent route from which to inherit when creating a route for the login page. |
loginPage | Web page URI for the user to enter username and password. |
loginService | URI to use for the internal login service. To use your own login URI, set to this the empty string. |
logoutService | URI to use to log the user out. To use your won logout URI, set this to the empty string. |
loggedIn | The client is redirected to this URI once logged in. Use a "referrer:" prefix to the URI to redirect the user to the referring URI before the loginPage. If the referrer cannot be determined, the base URI is utilized. |
Set the auth allow/deny order.
auth | Auth object allocated by httpCreateAuth |
order | Set to HTTP_ALLOW_DENY to run allow checks before deny checks. Set to HTTP_DENY_ALLOW to run deny checks before allow. |
Define the set of permitted users.
auth | Auth object allocated by httpCreateAuth |
users | Space separated list of acceptable users. |
Set the required quality of service for digest authentication.
auth | Auth object allocated by httpCreateAuth |
qop | Quality of service description. |
Set the required realm for basic or digest authentication.
auth | Auth object allocated by httpCreateAuth |
realm | Authentication realm. |
Set the required abilities for access.
auth | Auth object allocated by httpCreateAuth |
abilities | Spaces separated list of all the required abilities. |
Set the authentication password store to use.
auth | Auth object allocated by httpCreateAuth |
store | Password store to use. Select from: 'system', 'file'. |
Set the authentication protocol to use.
auth | Auth object allocated by httpCreateAuth |
proto | Protocol name to use. Select from: 'basic', 'digest', 'form'. |
details | Extra protocol details. |
Add caching for response content.
route | HttpRoute object. |
methods | List of methods for which caching should be enabled. Set to a comma or space separated list of method names. Method names can be any case. Set to null or "*" for all methods. Example: "GET, POST". |
uris | Set of URIs to cache. If the URI is set to "*" all URIs for that action are uniquely cached. If the request has POST data, the URI may include such post data in a sorted query format. E.g. {uri: /buy?item=scarf&quantity=1}. |
extensions | List of document extensions for which caching should be enabled. Set to a comma or space separated list of extensions. Extensions should not have a period prefix. Set to null or "*" for all extensions. Example: "html, css, js". |
types | List of document mime types for which caching should be enabled. Set to a comma or space separated list of types. The mime types are those that correspond to the document extension and NOT the content type defined by the handler serving the document. Set to null or "*" for all types. Example: "image/gif, application/x-php". |
clientLifespan | Lifespan of client cache items in milliseconds. If not set to positive integer, the lifespan will default to the route lifespan. |
serverLifespan | Lifespan of server cache items in milliseconds. If not set to positive integer, the lifespan will default to the route lifespan. |
flags | Cache control flags. Select HTTP_CACHE_MANUAL to enable manual mode. In manual mode, cached content will not be automatically sent. Use httpWriteCached in the request handler to write previously cached content. Select HTTP_CACHE_CLIENT to enable client-side caching. In this mode a "Cache-Control" Http header will be sent to the client with the caching "max-age". WARNING: the client will not send any request for this URI until the max-age timeout has expired. Select HTTP_CACHE_RESET to first reset existing caching configuration for this route. Select HTTP_CACHE_ALL, HTTP_CACHE_ONLY or HTTP_CACHE_UNIQUE to define the server-side caching mode. Only one of these three mode flags should be specified. If the HTTP_CACHE_ALL flag is set, the request params (query, post data, and route parameters) will be ignored and all requests for a given URI path will cache to the same cache record. Select HTTP_CACHE_UNIQUE to uniquely cache requests with different request parameters. The URIs specified in uris should not contain any request parameters. Select HTTP_CACHE_ONLY to cache only the exact URI with parameters specified in uris. The parameters must be in sorted www-urlencoded format. For example: /example.esp?hobby=sailing&name=john. |
Update the cached content for a URI.
conn | HttpConn connection object. |
uri | The request URI for which to update the cache. If using the HTTP_CACHE_ONLY flag when configuring the cached item, then the URI should contain the request parameters in sorted www-urlencoded format. |
data | Data to cache for the URI. If you wish to cache response headers, include those at the start of the data followed by an additional new line. For example: "Content-Type: text/plain\n\nHello World\n". |
lifespan | Lifespan in milliseconds for the cached content. |
Write the cached content for a URI to the client.
conn | HttpConn connection object. |
Http Connections.
int | async | Connection is in async mode (non-blocking). | |
void * | authData | Authorization state data. | |
int | authRequested | Authorization requested based on user credentials. | |
char * | authType | Type of authentication: set to basic, digest, post or a custom name. | |
char * | boundary | File upload boundary. | |
HttpQueue * | connectorq | Connector write queue. | |
int | connError | A connection error has occurred. | |
void * | context | Embedding context (EjsRequest). | |
struct HttpQueue * | currentq | Current queue being serviced (just for GC). | |
void * | data | Custom data for request - must be a managed reference. | |
MprDispatcher * | dispatcher | Event dispatcher. | |
void * | ejs | Embedding VM. | |
int | encoded | True if the password is MD5(username:realm:password). | |
struct HttpEndpoint * | endpoint | Endpoint object (if set - indicates server-side). | |
int | error | A request error has occurred. | |
char * | errorMsg | Error message for the last request (if any). | |
int | followRedirects | Follow redirects for client requests. | |
void * | grid | Current request database grid for MVC apps. | |
HttpHeadersCallback | headersCallback | Callback to fill headers. | |
void * | headersCallbackArg | Arg to fillHeaders. | |
struct HttpHost * | host | Host object (if relevant). | |
Http * | http | Http service object. | |
int | http10 | Using legacy HTTP/1.0. | |
HttpPacket * | input | Header packet. | |
HttpIOCallback | ioCallback | I/O event callback. | |
char * | ip | Remote client IP address. | |
int | keepAliveCount | Count of remaining Keep-Alive requests for this connection. | |
MprTicks | lastActivity | Last activity on the connection. | |
HttpLimits * | limits | Service limits. | |
void * | mark | Reference for GC marking. | |
ssize | newData | Length of new data last read into the input packet. | |
MprDispatcher * | newDispatcher | New dispatcher if using a worker thread. | |
HttpNotifier | notifier | Connection Http state change notification callback. | |
MprDispatcher * | oldDispatcher | Original dispatcher if using a worker thread. | |
char * | password | Supplied password (may be encrypted depending on auth protocol). | |
void * | pool | Pool of VMs. | |
int | port | Remote port. | |
char * | protocol | HTTP protocol. | |
char * | protocols | Supported web socket protocols (clients). | |
int | pumping | Rre-entrancy prevention for httpPumpRequest() | |
HttpQueue * | readq | End of the read pipeline. | |
void * | record | Current request database record for MVC apps. | |
int | retries | Client request retries. | |
struct HttpRx * | rx | Rx object. | |
int | secure | Using https. | |
int | seqno | Unique connection sequence number. | |
struct HttpQueue * | serviceq | List of queues that require service for request pipeline. | |
MprSocket * | sock | Underlying socket handle. | |
MprTicks | started | When the connection started (ticks). | |
uint64 | startMark | High resolution tick time of request. | |
int | state | Connection state. | |
void * | staticData | Custom data for request - must be an - unmanaged reference. | |
HttpTimeoutCallback | timeoutCallback | Request and inactivity timeout callback. | |
MprEvent * | timeoutEvent | Connection or request timeout event. | |
HttpTrace | trace[2] | Tracing for [rx|tx]. | |
struct HttpTx * | tx | Tx object. | |
int | upgraded | Request protocol upgraded. | |
struct HttpUser * | user | Authorized User record for access checking. | |
char * | username | Supplied user name. | |
int | worker | Use worker. | |
MprEvent * | workerEvent | Event for running connection via a worker thread. | |
HttpQueue * | writeq | Start of the write pipeline. |
Do setup after an I/O event to receive future events.
conn | HttpConn object created via httpCreateConn |
Call httpEvent with the given event mask.
conn | HttpConn object created via httpCreateConn |
mask | Mask of events. MPR_READABLE | MPR_WRITABLE. |
Close a connection.
conn | HttpConn object created via httpCreateConn |
Signal a connection timeout on a connection.
conn | HttpConn connection object created via httpCreateConn |
Create a connection object.
http | Http object created via httpCreate |
endpoint | Endpoint object owning the connection. |
dispatcher | Disptacher to use for I/O events on the connection. |
Create the receive request pipeline.
conn | HttpConn object created via httpCreateConn |
route | Route object controlling how the pipeline is configured for the request. |
Create the transmit request pipeline.
conn | HttpConn object created via httpCreateConn |
route | Route object controlling how the pipeline is configured for the request. |
Destroy the connection object.
conn | HttpConn object created via httpCreateConn |
Destroy the request pipeline.
conn | HttpConn object created via httpCreateConn |
Discard buffered transmit pipeline data.
conn | HttpConn object created via httpCreateConn |
dir | Queue direction. Either HTTP_QUEUE_TX or HTTP_QUEUE_RX. |
Disconnect the connection's socket.
conn | HttpConn connection object created via httpCreateConn |
Enable connection events.
conn | HttpConn connection object created via httpCreateConn |
Enable Multipart-Mime File Upload for this request.
This will define a "Content-Type: multipart/form-data..." header and will create a mime content boundary for use to delimit the various upload content files and fieldsconn | HttpConn connection object. |
Error handling for the connection.
conn | HttpConn connection object created via httpCreateConn |
status | Http status code. The status code can be ored with the flags HTTP_ABORT to immediately abort the connection or HTTP_CLOSE to close the connection at the completion of the request. |
fmt | Printf style formatted string. |
... | Arguments for fmt. |
Http I/O event handler.
Invoke when there is an I/O event on the connection. This is normally invoked automatically when I/O events are receivedconn | HttpConn object created via httpCreateConn |
event | Event structure. |
Finalize connector output sending the response.
conn | HttpConn object created via httpCreateConn |
Get the async mode value for the connection.
conn | HttpConn object created via httpCreateConn |
Get the preferred chunked size for transfer chunk encoding.
conn | HttpConn connection object created via httpCreateConn |
Get the connection context object.
conn | HttpConn object created via httpCreateConn |
Get the connection host object.
conn | HttpConn object created via httpCreateConn |
Get the error message associated with the last request.
conn | HttpConn connection object created via httpCreateConn |
Get a URI extension.
conn | HttpConn connection object created via httpCreateConn |
Get the count of Keep-Alive requests that will be used for this connection object.
conn | HttpConn connection object created via httpCreateConn |
Get more output data by invoking the writable callback.
conn | HttpConn object created via httpCreateConn |
Get the count of bytes buffered on the write queue.
conn | HttpConn connection object created via httpCreateConn |
Match the HttpHost object that should serve this request.
conn | HttpConn connection object created via httpCreateConn |
Signal a memory allocation error.
conn | HttpConn connection object created via httpCreateConn |
Inform notifiers of a connection event or state change.
conn | HttpConn object created via httpCreateConn |
event | Event to issue. |
arg | Argument to event. |
Prepare a client connection for a new request.
conn | HttpConn object created via httpCreateConn |
keepHeaders | If true, keep the headers already defined on the connection object. |
Run the handler ready callback.
conn | HttpConn object created via httpCreateConn |
Reset the current security credentials.
conn | HttpConn connection object created via httpCreateConn |
Route the request and select that matching route and handle to process the request.
conn | HttpConn connection object created via httpCreateConn |
Service pipeline queues to flow data.
conn | HttpConn object created via httpCreateConn |
Set the async mode value for the connection.
conn | HttpConn object created via httpCreateConn |
enable | Set to 1 to enable async mode. |
Set the chunk size for transfer chunked encoding.
When set, a "Transfer-Encoding: Chunked" header will be added to the request, and all write data will be broken into chunks of the requested sizeconn | HttpConn connection object created via httpCreateConn |
size | Requested chunk size. |
Set the connection context object.
conn | HttpConn object created via httpCreateConn |
context | New context object. |
Set the connection host object.
conn | HttpConn object created via httpCreateConn |
host | New context host. |
Define a notifier callback for this connection.
conn | HttpConn connection object created via httpCreateConn |
notifier | Notifier function. |
Set the http context object.
http | Http object created via httpCreate |
context | New context object. |
Set the Http credentials.
conn | HttpConn connection object created via httpCreateConn |
user | String user. |
password | Decrypted password string. |
authType | Authentication type. Set to basic or digest. Defaults to nothing. |
Define a default client host.
http | Http object created via httpCreateConn |
host | Host or IP address. |
Define a default client port.
http | Http object created via httpCreateConn |
port | Integer port number. |
Set the fork callback.
http | Http service object. |
proc | Fork callback procedure. |
arg | Argument to supply when the callback is invoked. |
Define a headers callback.
conn | HttpConn object created via httpCreateConn |
fn | Callback function to invoke. |
arg | Argument to provide when invoking the headers callback. |
Define an I/O callback for connections.
conn | HttpConn object created via httpCreateConn |
fn | Callback function to invoke. |
Control Http Keep-Alive for the connection.
conn | HttpConn connection object created via httpCreateConn |
count | Count of Keep-Alive transactions to use before closing the connection. Set to zero to disable keep-alive. |
Set the Http protocol variant for this connection.
conn | HttpConn connection object created via httpCreateConn |
protocol | String representing the protocol variant. Valid values are: "HTTP/1.0", "HTTP/1.1". This parameter must be persistent. Use HTTP/1.1 wherever possible. |
Set the Http retry count.
conn | HttpConn object created via httpCreateConn |
retries | Count of retries. |
Set the "Send" connector to process the request.
conn | HttpConn connection object created via httpCreateConn |
path | File name to send as a response. |
Set the connection state and invoke notifiers.
conn | HttpConn object created via httpCreateConn |
state | New state to enter. |
Set the Http inactivity timeout.
conn | HttpConn object created via httpCreateConn |
requestTimeout | Request timeout in msec. This is the total time for the request. Set to -1 to preserve the existing value. |
inactivityTimeout | Inactivity timeout in msec. This is maximum connection idle time. Set to -1 to preserve the existing value. |
Define a timestamp in the MPR log file.
period | Time in milliseconds between timestamps. |
Setup a wait handler for the connection to wait for desired events.
conn | HttpConn object created via httpCreateConn |
eventMask | Mask of events. MPR_READABLE | MPR_WRITABLE. |
Test if the item should be traced.
conn | HttpConn connection object created via httpCreateConn |
dir | Direction of data flow. Set to HTTP_TRACE_RX or HTTP_TRACE_TX. |
item | Item to trace. Set to HTTP_TRACE_CONN, HTTP_TRACE_FIRST, HTTP_TRACE_HEADER, HTTP_TRACE_BODY, or HTTP_TRACE_TIME. |
ext | URI resource extension (without "."). |
Start the pipeline.
This starts the request handlerconn | HttpConn object created via httpCreateConn |
Steal a connection from Appweb.
conn | HttpConn object created via httpCreateConn |
Verify the server handshake.
conn | HttpConn connection object created via httpCreateConn |
Write Http upload body data.
conn | Http connection object created via httpCreateConn |
fileData | List of string file names to upload. |
formData | List of strings containing "key=value" pairs. The form data should be already www-urlencoded. |
Listening endpoints.
int | activeClients | Count of current active clients. | |
int | activeRequests | Count of current active requests. | |
int | async | Listening is in async mode (non-blocking). | |
MprHash * | clientLoad | Table of active client IPs and connection counts. | |
void * | context | Embedding context. | |
MprDispatcher * | dispatcher | Event dispatcher. | |
int | flags | Endpoint control flags. | |
MprList * | hosts | List of host objects. | |
Http * | http | Http service object. | |
char * | ip | Listen IP address. May be null if listening on all interfaces. | |
HttpLimits * | limits | Alias for first host, default route resource limits. | |
MprMutex * | mutex | Multithread sync. | |
HttpNotifier | notifier | Default connection notifier callback. | |
int | port | Listen port. | |
MprSocket * | sock | Listening socket. | |
struct MprSsl * | ssl | Endpoint SSL configuration. |
Accept a new connection.
Accept a new client connection on a new socket. If multithreaded, this will come in on a worker thread dedicated to this connection. This is called from the listen wait handlerendpoint | The endpoint on which the server was listening. |
event | Mpr event object. |
Add a host to an endpoint.
endpoint | Endpoint to which the host will be added. |
host | HttpHost object to add. |
Configure endpoints with named virtual hosts.
http | Http service object. |
ip | IP address for the named virtual host. |
port | address for the named virtual host. |
Create and configure a new endpoint.
home | Home directory for configuration files for the endpoint. |
documents | Directory containing the. |
ip | IP address to use for the endpoint. Set to null to listen on all interfaces. |
port | Listening port number to use for the endpoint. |
Create an endpoint object.
ip | IP address on which to listen. |
port | IP port number. |
dispatcher | Dispatcher to use. Can be null. |
Destroy the endpoint.
endpoint | HttpEndpoint object returned from httpCreateEndpoint |
Get the endpoint context object.
endpoint | HttpEndpoint object created via httpCreateEndpoint |
Test if an endpoint has named virtual hosts.
endpoint | Endpoint object to examine. |
Get if the endpoint is running in asynchronous mode.
endpoint | HttpEndpoint object created via httpCreateEndpoint |
Lookup a host name.
endpoint | HttpEndpoint object created via httpCreateEndpoint |
name | Host name to search for. |
Secure an endpoint.
endpoint | HttpEndpoint object created via httpCreateEndpoint |
ssl | MprSsl object. |
Secure an endpoint by name.
name | Endpoint name. The endpoint name is comprised of the IP and port. For example: "127.0.0.1:7777". |
ssl | MprSsl object. |
Set the endpoint IP address.
endpoint | HttpEndpoint object created via httpCreateEndpoint |
ip | IP address to use for the endpoint. Set to null to listen on all interfaces. |
port | Listening port number to use for the endpoint. |
Control if the endpoint is running in asynchronous mode.
endpoint | HttpEndpoint object created via httpCreateEndpoint |
enable | Set to 1 to enable async mode. |
Set the endpoint context object.
endpoint | HttpEndpoint object created via httpCreateEndpoint |
context | New context object. |
Define a notifier callback for this endpoint.
endpoint | HttpEndpoint object created via httpCreateEndpoint |
fn | Notifier function. |
Control whether the endpoint has named virtual hosts.
endpoint | Endpoint object to examine. |
on | Set to true to enable named virtual hosts. |
Start listening for client connections.
endpoint | HttpEndpoint object created via httpCreateEndpoint |
Stop the server listening for client connections.
endpoint | HttpEndpoint object created via httpCreateEndpoint |
Validate the request against defined resource limits.
endpoint | The endpoint on which the server was listening. |
event | Processing event. The supported events are: HTTP_VALIDATE_OPEN_CONN, HTTP_VALIDATE_CLOSE_CONN, HTTP_VALIDATE_OPEN_REQUEST and HTTP_VALIDATE_CLOSE_REQUEST. |
conn | HttpConn connection object. |
Host Object.
HttpEndpoint * | defaultEndpoint | Default endpoint for host. | |
HttpRoute * | defaultRoute | Default route for the host. | |
int | flags | Host flags. | |
char * | ip | Hostname/ip portion parsed from name. | |
MprMutex * | mutex | Multithread sync. | |
char * | name | Host name. | |
struct HttpHost * | parent | Parent host to inherit aliases, dirs, routes. | |
int | port | Port address portion parsed from name. | |
char * | protocol | Defaults to "HTTP/1.1". | |
MprCache * | responseCache | Response content caching store. | |
char * | root | Home for this host. | |
MprList * | routes | List of Route defintions. | |
HttpEndpoint * | secureEndpoint | Secure endpoint for host. |
Add a route to a host.
host | HttpHost object. |
route | Route to add. |
Clone a host.
parent | Parent HttpHost object to clone. |
Create a host.
Get the default host defined via httpSetDefaultHost.
Reset the list of routes for the host.
host | HttpHost object. |
Set the default host for all servers.
host | Host to define as the default host. |
Set the default endpoint for a host.
host | Host to examine. |
endpoint | Secure endpoint to use as the default. |
Set the default route for a host.
host | Host to examine. |
route | Route to define as the default. |
Set the host internet address.
host | HttpHost object. |
ip | Internet address. This can be an IP address or a symbolic domain and host name. |
port | Port number. |
Set the host name.
host | HttpHost object. |
name | Host name to use. |
Set the host HTTP protocol version.
host | HttpHost object. |
protocol | Set to either HTTP/1.0 or HTTP/1.1. |
Set the server root for a host.
host | HttpHost object. |
root | Directory path for the host server root. |
Set the default secure endpoint for a host.
host | Host to examine. |
endpoint | Secure endpoint to use as the default. |
Http limits.
ssize | bufferSize | Maximum buffering by any pipeline stage. | |
ssize | cacheItemSize | Maximum size of a cachable item. | |
ssize | chunkSize | Maximum chunk size for transfer encoding. | |
int | clientMax | Maximum number of simultaneous clients endpoints. | |
int | headerMax | Maximum number of header lines. | |
ssize | headerSize | Maximum size of the total header. | |
MprTicks | inactivityTimeout | Timeout for keep-alive and idle requests (msec). | |
int | keepAliveMax | Maximum number of Keep-Alive requests to perform per socket. | |
int | processMax | Maximum number of processes (CGI). | |
MprOff | receiveBodySize | Maximum size of receive body data. | |
MprOff | receiveFormSize | Maximum size of form data. | |
int | requestMax | Maximum number of simultaneous concurrent requests. | |
MprTicks | requestParseTimeout | Time a request can take to parse the request headers (msec). | |
int | requestsPerClientMax | Maximum number of requests per client IP. | |
MprTicks | requestTimeout | Time a request can take (msec). | |
int | sessionMax | Maximum number of sessions. | |
MprTicks | sessionTimeout | Time a session can persist (msec). | |
MprOff | transmissionBodySize | Maximum size of transmission body content. | |
MprOff | uploadSize | Maximum size of an uploaded file. | |
ssize | uriSize | Maximum size of a uri. | |
ssize | webSocketsFrameSize | Maximum size of a WebSocket frame on the wire. | |
int | webSocketsMax | Maximum number of WebSockets. | |
ssize | webSocketsMessageSize | Maximum total size of a WebSocket message including all frames. | |
ssize | webSocketsPacketSize | Maximum size of a WebSocket packet exchanged with the user. | |
MprTicks | webSocketsPing | Time between pings. |
Create a new limits object.
serverSide | Set to "true" for server side limits. Set to "false" for client side default limits. |
Ease the limits.
limits | Limits object. This can be either HttpHost.limits HttpConn.limits or HttpEndpoint.limits. |
Enable use of the DELETE and PUT methods.
route | Route to modify. |
on | Set to true to enable the DELETE and PUT Http methods. |
Enable use of the TRACE Http method.
route | Route to modify. |
on | Set to true to enable the trace method. |
Initialize a limits object with default values.
limits | Limits object to modify. |
serverSide | Set to "true" for server side limits. Set to "false" for client side default limits. |
Packet object.
MprBuf * | content | Chunk content. | |
MprOff | epos | Data position in entity (file). | |
MprOff | esize | Data size in entity (file). | |
HttpFillProc | fill | Callback to fill packet with data. | |
uint | flags | Packet flags. | |
uint | last | Last packet in a message. | |
struct HttpPacket * | next | Next packet in chain. | |
MprBuf * | prefix | Prefix message to be emitted before the content. | |
uint | type | Packet type extension. |
Adjust the packet end position.
packet | Packet to modify. |
size | Size to adjust packet end position. |
Adjust the packet starting position.
packet | Packet to modify. |
size | Size to add to the packet current position. |
Clone a packet.
orig | Original packet to clone. |
Create a data packet.
size | Size of the package data storage. |
Create an end-of-stream packet.
Create an entity data packet.
pos | Position within the entity for packet data. |
size | Size of the entity data. |
fill | HttpFillProc callback to supply the entity data. |
Create a response header packet.
Create a data packet.
size | Size of the package data storage. |
Get the length of the packet data contents.
packet | Packet to examine. |
Test if the packet is the last in a logical message.
packet | Packet to examine. |
Join two packets.
packet | Destination packet. |
other | Other packet to copy data from. |
Split a data packet.
packet | Packet to split. |
offset | Route in the original packet at which to split. |
Queue object.
HttpQueueClose | close | Close the queue. | |
struct HttpConn * | conn | Connection owning this queue. | |
ssize | count | Bytes in queue (Does not include virt packet data). | |
int | direction | Flow direction. | |
HttpPacket * | first | First packet in queue (singly linked). | |
int | flags | Queue flags. | |
MprOff | ioCount | Count of bytes in iovec including file I/O. | |
int | ioFile | Sending a file. | |
int | ioIndex | Next index into iovec. | |
MprOff | ioPos | Position in file for sendfile. | |
HttpPacket * | last | Last packet in queue (tail pointer). | |
ssize | low | Low water mark for flow control. | |
ssize | max | Advisory maxiumum queue size. | |
cchar * | name | Queue name for debugging. | |
struct HttpQueue * | nextQ | Downstream queue for next stage. | |
HttpQueueOpen | open | Open the queue. | |
ssize | packetSize | Maximum acceptable packet size. | |
struct HttpQueue * | pair | Queue for the same stage in the opposite direction. | |
struct HttpQueue * | prevQ | Upstream queue for prior stage. | |
HttpQueueData | put | Callback to receive a packet. | |
void * | queueData | Stage instance data - must be a managed reference. | |
struct HttpQueue * | scheduleNext | Next linkage when queue is on the service queue. | |
struct HttpQueue * | schedulePrev | Previous linkage when queue is on the service queue. | |
HttpQueueService | service | Service the queue. | |
int | servicing | Currently being serviced. | |
struct HttpStage * | stage | Stage owning this queue. | |
HttpQueueStart | start | Start the queue. | |
void * | staticData | Stage instance data - must be an unmanaged reference. |
Disable a queue.
q | Queue reference. |
Discard all data from the queue.
q | Queue reference. |
removePackets | If "true", the data packets will be removed from the queue. |
Enable a queue after it has been disabled.
q | Queue reference. |
Flush queue data.
q | Queue to flush. |
block | If set to "true", this call will block until the data has drained below the queue maximum. |
Get the next packet from a queue.
q | Queue reference. |
Get the room in the queue.
q | Queue reference. |
Test if the connection has received all incoming content.
conn | HttpConn object created via httpCreateConn |
Test if a packet is too big.
q | Queue reference. |
packet | Packet to test. |
Determine if the queue is empty.
q | Queue reference. |
Test if a queue is suspended.
q | Queue reference. |
Join a packet onto the service queue.
q | Queue reference. |
packet | Packet to join to the queue. |
serviceQ | If true, schedule the queue for service. |
Join packets together.
q | Queue to examine. |
size | The maximum-sized packet that will be created by joining queue packets is the minimum of the given size and the downstream queues maximum packet size. Note: this routine will not split packets and so the maximum is advisory only. |
Put a packet back onto a queue.
q | Queue reference. |
packet | Packet to put back. |
Put a packet into the service queue for deferred processing.
q | Queue reference. |
packet | Packet to join to the queue. |
serviceQ | If true, schedule the queue for service. |
Put a packet to the queue.
q | Queue reference. |
packet | Packet to put. |
Put a packet to the next queue downstream.
q | Queue reference. |
q | Queue reference. The packet will not be queued on this queue, but rather on the queue downstream. |
packet | Packet to put. |
Remove a queue.
q | Queue reference. |
Resize a packet.
q | Queue reference. |
packet | Packet to put. |
size | If size is > 0, then also ensure the packet is not larger than this size. |
Resume a queue.
q | Queue reference. |
Schedule a queue.
q | Queue reference. |
Service a queue.
q | Queue reference. |
Set a queue's flow control low and high water marks.
q | Queue reference. |
low | The low water mark. Typically 5% of the max. |
max | The high water mark. |
Suspend a queue.
q | Queue reference. |
Determine if the downstream queue will accept this packet.
q | Queue reference. |
packet | Packet to put. |
Determine if the downstream queue will accept a certain amount of data.
q | Queue reference. |
size | Size of data to test for. |
Determine if the given queue will accept this packet.
q | Queue reference. |
packet | Packet to put. |
split | Set to true to split the packet if required to fit into the queue. |
Write a formatted string.
q | Queue reference. |
fmt | Printf style formatted string. |
... | Arguments for fmt. |
Write a block of data to the queue.
q | Queue reference. |
buf | Buffer containing the write data. |
size | of the data in buf. |
flags | Set to HTTP_BLOCK for blocking operation or HTTP_NON_BLOCK for non-blocking. Set to HTTP_BUFFER to buffer the data if required and never block. Set to zero will default to HTTP_BUFFER. |
Write a string of data to the queue.
Write a safe string of data to the queueq | Queue reference. |
s | String containing the data to write. |
q | Queue reference. |
s | String containing the data to write. |
Content range structure.
Route Control.
HttpAuth * | auth | Per route block authentication. | |
int | autoDelete | Automatically delete uploaded files. | |
MprList * | caching | Items to cache. | |
MprList * | conditions | Route conditions. | |
HttpStage * | connector | Network connector to use. | |
void * | context | Hosting context (Appweb == EjsPool). | |
MprHash * | data | Hash of extra data configuration. | |
char * | defaultLanguage | Default language. | |
char * | dir | Documents directory. | |
void * | eroute | Extended route information for handler (only). | |
MprHash * | errorDocuments | Set of error documents to use on errors. | |
MprHash * | extensions | Hash of handlers by extensions. | |
int | flags | Route flags. | |
HttpStage * | handler | Fixed handler. | |
MprList * | handlers | List of handlers for this route. | |
MprList * | handlersByMatch | List of handlers that match solely by their match routine. | |
MprList * | headers | Matching header values. | |
char * | home | Home directory for configuration files. | |
struct HttpHost * | host | Owning host. | |
Http * | http | Http service object (copy of appweb->http). | |
int | ignoreEncodingErrors | Ignore UTF8 encoding errors. | |
MprList * | indicies | Directory index documents. | |
MprList * | inputStages | Input stages. | |
MprHash * | languages | Languages supported. | |
MprTicks | lifespan | Default lifespan for all cache items in route. | |
HttpLimits * | limits | Host resource limits. | |
MprFile * | log | File object for access logging. | |
int | logBackup | Number of log backups. | |
int | logFlags | Log control flags (append|anew). | |
char * | logFormat | Access log format. | |
char * | logPath | Access log filename. | |
ssize | logSize | Max log size. | |
MprHash * | methods | Matching HTTP methods. | |
char * | methodSpec | Supported HTTP methods. | |
MprHash * | mimeTypes | Hash table of mime types (key is extension). | |
MprMutex * | mutex | Multithread sync. | |
char * | name | Route name. | |
int | nextGroup | Next route with a different startWith. | |
char * | optimizedPattern | Processed pattern (excludes prefix). | |
MprList * | outputStages | Output stages. | |
MprList * | params | Matching param field data. | |
struct HttpRoute * | parent | Parent route. | |
char * | pattern | Original matching URI pattern for the route (includes prefix). | |
void * | patternCompiled | Compiled pattern regular expression (not alloced). | |
char * | prefix | Application scriptName prefix. | |
ssize | prefixLen | Prefix length. | |
int | responseStatus | Response status code. | |
char * | script | Startup script for handlers serving this route. | |
char * | scriptPath | Startup script path for handlers serving this route. | |
char * | sourceName | Source name for route target. | |
struct MprSsl * | ssl | SSL configuration. | |
char * | startSegment | Starting literal segment of pattern (includes prefix). | |
ssize | startSegmentLen | Prefix length. | |
char * | startWith | Starting literal segment of pattern (includes prefix). | |
ssize | startWithLen | Length of startWith. | |
char * | target | Route target details. | |
char * | targetRule | Target rule. | |
MprList * | tokens | Tokens in pattern, {name}. | |
char * | tplate | URI template for forming links based on this route (includes prefix). | |
HttpTrace | trace[2] | Default route request tracing. | |
int | traceMask | Request/response trace mask. | |
MprList * | updates | Route and request updates. | |
char * | uploadDir | Upload directory. | |
MprHash * | vars | Route variables. Used to expand Path ${token} refrerences. | |
MprTicks | webSocketsPingPeriod | Time between pings (msec). | |
char * | webSocketsProtocol | WebSockets sub-protocol. | |
int | workers | Number of workers to use for this route. |
Add a route for the home page.
Name | Method | Pattern | Target |
home | GET,POST,PUT | ^/$ | index.esp |
parent | Parent route from which to inherit configuration. |
Add routes for a resource.
Name | Method | Pattern | Action |
init | GET | /NAME/init$ | init |
create | POST | /NAME(/)*$ | create |
edit | GET | /NAME/edit$ | edit |
show | GET | /NAME$ | show |
update | PUT | /NAME$ | update |
destroy | DELETE | /NAME$ | destroy |
default | * | /NAME/{action}$ | cmd-${action} |
parent | Parent route from which to inherit configuration. |
resource | Resource name. This should be a lower case, single word, alphabetic resource name. |
Add routes for a group of resources.
Name | Method | Pattern | Action |
list | GET | /NAME(/)*$ | list |
init | GET | /NAME/init$ | init |
create | POST | /NAME(/)*$ | create |
edit | GET | /NAME/{id=[0-9]+}/edit$ | edit |
show | GET | /NAME/{id=[0-9]+}$ | show |
update | PUT | /NAME/{id=[0-9]+}$ | update |
destroy | DELETE | /NAME/{id=[0-9]+}$ | destroy |
custom | POST | /NAME/{action}/{id=[0-9]+}$ | ${action} |
default | * | /NAME/{action}$ | cmd-${action} |
parent | Parent route from which to inherit configuration. |
resource | Resource name. This should be a lower case, single word, alphabetic resource name. |
Add a route condition.
route | Route to modify. |
name | Condition rule to add. Supported conditions are: "auth", "missing", "directory", "exists", and "match". The "auth" rule is used internally to implement basic and digest authentication. The "missing" rule tests if the target filename is missing. The "missing" rule takes no arguments. The "directory" rule tests if the condition argument is a directory. The form of the "directory" rule is: "directory pathString". For example: "directory /stuff/${request:pathInfo}.txt" The "exists" rule tests if the condition argument is present in the file system. The form of the "exists" rule is: "exists pathString". For example: "exists ${request.filename}.gz", The match directory tests a regular expression pattern against the rest of the condition arguments. The form of the match rule is: "match RegExp string". For example: "match https ${request.scheme}". |
details | Condition parameters. See httpSetRouteTarget for a list of the token values that can be included in the condition rule details. |
flags | Set to HTTP_ROUTE_NOT to negate the condition test. |
Add an error document.
route | Route to modify. |
status | The HTTP status code to use with the error document. |
uri | URL describing the error document. |
Add a route filter.
route | Route to modify. |
name | Filter name to add. |
extensions | Request extensions for which the filter will be run. A request extension may come from the URI if present or from the corresponding filename. |
direction | Set to HTTP_STAGE_TX for transmit direction and HTTP_STAGE_RX for receive data flow. |
Add a route handler.
route | Route to modify. |
name | Filter name to add. |
extensions | Request extensions for which the handler will be selected. A request extension may come from the URI if present or from the corresponding filename. |
Add a route header check.
route | Route to modify. |
header | Header field to interrogate. |
value | Header value that will match. |
flags | Set to HTTP_ROUTE_NOT to negate the header test. |
Set the route index document.
route | Route to modify. |
path | Path name to the index document. If the path is a relative path, it may be joined to the route directory to create an absolute path. |
Add a route language directory.
route | Route to modify. |
language | Language symbolic name. For example: "en" for english. |
path | File system directory to contain content for matching requests. |
Add a route language suffix.
route | Route to modify. |
language | Language symbolic name. For example: "en" for english. |
suffix | Extension suffix to add when creating filenames for the request. For example: "fr" to add to "index.html" could produce: "index.fr.html". |
flags | Set to HTTP_LANG_BEFORE to insert the suffix before the filename extension. Set to HTTP_LANG_AFTER to append after the extension. For example: HTTP_LANG_AFTER would produce "index.html.fr". |
Add a route param check.
route | Route to modify. |
field | Param field to interrogate. |
value | Header value that will match. |
flags | Set to HTTP_ROUTE_NOT to negate the query test. |
Add a route set package.
Name | Method | Pattern | Target |
home | GET,POST,PUT | ^/$ | index.esp |
static | GET | ^/static(/(.)*$ | $1 |
parent | Parent route from which to inherit configuration. | ||||||||
set | Route set to select. Use "simple", "mvc", "restful" or "none". The "simple" pack will invoke httpAddHomeRoute and httpAddStaticRoute to add "home", and "static" routes. The "mvc" selection will add the default routes and then add the route:
|
Add a route update rule.
route | Route to modify. |
name | Update rule to add. Supported update rules include: "cmd", "field" and "lang". The "cmd" rule is used to run external commands. For example: "cmd touch /tmp/filename". The "param" rule is used to set values in the request param fields. For example: "param priority high". The "lang" update rule is used internally to implement the various language options. See httpSetRouteTarget for a list of the token values that can be included in the condition rule details. |
details | Update rule parameters. |
flags | Reserved. |
Add a route for static content under a "static" directory.
This can be used for ESP applications. Use the EspDir appweb configuration file directive to modify the "static" directoryName | Method | Pattern | Target |
static | GET | ^/static(/(.)*$ | $1 |
parent | Parent route from which to inherit configuration. |
Backup the route log if required.
route | Route to modify. |
Clear the pipeline stages for the route.
route | Route to modify. |
direction | Set to HTTP_STAGE_TX for transmit direction and HTTP_STAGE_RX for receive data flow. |
Create a route for use with the Action Handler.
parent | Parent route from which to inherit. |
pattern | Pattern to match URIs. |
action | Action to invoke. |
Create a route suitable for use as an alias.
parent | Parent route to inherit from. |
pattern | Pattern to match URIs. |
path | File system directory containing documents for this route. |
status | Http redirect status for matching requests. Set to zero if not using redirects. |
Create a configured route.
host | HttpHost object owning the route. |
serverSide | Set to "true" if this is a server side route. Set to "false" for client side. |
Create a default route for a host.
host | HttpHost object owning the route. |
Create a route inherited from a parent route.
route | Parent route from which to inherit. |
Create a route for a host.
host | HttpHost object owning the route. |
Define a route.
parent | Parent route from which to inherit configuration. |
name | Route name to define. |
methods | Http methods for which this route is active. |
pattern | Matching URI pattern for which this route will qualify. |
target | Route target string expression. This is used by handlers to determine the physical or virtual resource to serve. |
source | Source file pattern containing the resource to activate or serve. |
Define a route condition rule.
name | Condition name. |
proc | Condition function to process the condition during route matching. |
Define a route target rule.
name | Target name. |
proc | Target function to process the target during route matching. |
Define a route update rule.
name | Update name. |
proc | Update function to process the update during route matching. |
Expand route variables in a string.
route | Route to modify. |
str | String to expand. |
Finalize a route.
route | Route to modify. |
Get the default route for a host.
host | Host object. |
Return the default route for a host.
host | Host to examine. |
Get extra route data.
route | Route to modify. |
key | Unique string key to identify the data. |
Get the route directory.
route | Route to modify. |
Get the route method list.
route | Route to examine. |
Get a path token variable.
route | Route to get. |
key | Token key value. |
Graduate the limits from the parent route.
route | Route to modify. |
limits | Limits to use if graduating. |
Create a URI link.
\par \b Description: Create a URI link by expansions tokens based on the current request and route state. The target parameter may contain partial or complete URI information. The missing parts are supplied using the current request and route tables. The resulting URI is a normalized, server-local URI (that begins with "/"). The URI will include any defined route prefix, but will not include scheme, host or port componentsconn | HttpConn connection object. |
target | The URI target. The target parameter can be a URI string or JSON style set of options. The target will have any embedded "{tokens}" expanded by using token values from the request parameters. If the target has an absolute URI path, that path is used directly after tokenization. If the target begins with "~", that character will be replaced with the route prefix. This is a very convenient way to create application top-level relative links. If the target is a string that begins with "{AT}" it will be interpreted as a controller/action pair of the form "{AT}Controller/action". If the "controller/" portion is absent, the current controller is used. If the action component is missing, the "list" action is used. A bare "{AT}" refers to the "list" action of the current controller. If the target starts with "{" it is interpreted as being a JSON style set of options that describe the link. If the target is a relative URI path, it is appended to the current request URI path. If the is a JSON style of options, it can specify the URI components: scheme, host, port, path, reference and query. If these component properties are supplied, these will be combined to create a URI. If the target specifies either a controller/action or a JSON set of options, The URI will be created according to the route URI template. The template may be explicitly specified via a "route" target property. Otherwise, if an "action" property is specified, the route of the same name will be used. If these don't result in a usable route, the "default" route will be used. These are the properties supported in a JSON style "{ ... }" target:
|
options | Hash of option values for embedded tokens. |
httpLink(conn, "http://example.com/index.html", 0); httpLink(conn, "/path/to/index.html", 0); httpLink(conn, "../images/splash.png", 0); httpLink(conn, "~/static/images/splash.png", 0); httpLink(conn, "${app}/static/images/splash.png", 0); httpLink(conn, "@controller/checkout", 0); httpLink(conn, "@controller/") // Controller = Controller, action = index httpLink(conn, "@init") // Current controller, action = init httpLink(conn, "@") // Current controller, action = index httpLink(conn, "{ action: '@post/create' }", 0); httpLink(conn, "{ action: 'checkout' }", 0); httpLink(conn, "{ action: 'logout', controller: 'admin' }", 0); httpLink(conn, "{ action: 'admin/logout'", 0); httpLink(conn, "{ product: 'candy', quantity: '10', template: '/cart/${product}/${quantity}' }", 0); httpLink(conn, "{ route: '~/STAR/edit', action: 'checkout', id: '99' }", 0); httpLink(conn, "{ template: '~/static/images/${theme}/background.jpg', theme: 'blue' }", 0);
Show the current route table to the error log.
host | Host to examine. |
full | Set to true for a "fuller" output route description. |
Lookup a route by name.
host | HttpHost object owning the route table. |
name | Route name to find. If null or empty, look for "default". |
Lookup an error document by HTTP status code.
route | Route to modify. |
status | HTTP status code integer. |
Make a filename path.
route | Route to modify. |
path | Path name to examine. |
Map the request URI and route target to a filename.
conn | HttpConn connection object. |
route | Route to modify. |
Match a route against the current request.
conn | HttpConn connection object. |
route | Route to modify. |
Reset the route pipeline.
route | Route to modify. |
Set the route authentication.
route | Route to modify. |
auth | Authentication object. |
Control file upload auto delete.
route | Route to modify. |
on | Set to true to enable auto-delete. Auto-delete is enabled by default. |
Contol content compression for the route.
route | Route to modify. |
flags | Set to HTTP_ROUTE_GZIP to enable the fileHandler to serve eqivalent compressed content with a "gz" extension. |
Set the connector to use for a route.
route | Route to modify. |
name | Connector name to use for this route. |
Set route data.
route | Route to modify. |
key | Unique string to identify the data. |
data | Data object. This must be allocated via mprAlloc. |
Set the default language for the route.
route | Route to modify. |
language | Language symbolic name. For example: "en" for english. |
Set the route directory.
route | Route to modify. |
dir | Directory path name for the route content. |
Update the route flags.
route | Route to modify. |
flags | Flags mask. |
Set the handler to use for a route.
route | Route to modify. |
name | Handler name to define. |
Set the route directory for configuration files.
route | Route to modify. |
home | Directory path name for configuration files. |
Configure the route access log.
route | Route to modify. |
path | Path for route access log file. |
size | Maximum size of the log file before archiving. |
backup | Set to true to create a backup of the log file if archiving. |
format | Log file format. |
flags | Set to MPR_LOG_ANEW to archive the log when the application reboots. |
Define the methods for the route.
route | Route to modify. |
methods | Set to a comma or space separated list of methods. Can also set to "All" or "*" for all possible methods. Standard methods include: "DELETE, GET, OPTIONS, POST, PUT, TRACE". |
Set the route name.
route | Route to modify. |
name | Unique symbolic name for the route. If a name is not defined, the route pattern will be used as the name. |
Set the route pattern.
route | Route to modify. |
pattern | Route regular expression pattern. |
flags | Set to HTTP_ROUTE_NOT to negate the pattern match result. |
Set the route prefix.
route | Route to modify. |
prefix | URI prefix to define for the route. |
Set the script to service the route.
route | Route to modify. |
script | Literal script to execute. |
scriptPath | Pathname to the script file to execute. |
Set the source code module for the route.
route | Route to modify. |
source | Source path or description. |
Set a route target.
route | Route to modify. |
name | Target rule to add. Supported update rules include: "close", "redirect", "run" and "write". The "close" rule is used to do abortive closes for the request. This is useful for ward off known security attackers. For example: "close immediate". The "close" rule takes no addition parameters. The "redirect" rule is used to redirect the request to a new resource. For example: "redirect 302 /tryAgain.html". The "redirect" takes the form: "redirect status URI". The status code is used as the HTTP response code. The URI can be a fully qualified URI beginning with "http" or it can be a relative URI. The "run" target is used to run the configured handler to respond to the request. For example: "file ${DOCUMENTS}/${request.uri}.gz". The "write" rule is used to write literal data back to the client. For example: "write 200 Hello World\r\n". The "write" rule takes the form: "write [-r] status message". Write data is by default HTML encoded to help eliminate XSS security exposures. The "-r" option selects "raw" output and bypasses the HTML encoding of the write data string. WARNING: Take great care when using raw writes with tokens. Write data is not HTML encoded and echoing back to raw data to the client can cause XSS and other security issues. The status field defines the HTTP status code to use in the response. |
details | Update rule parameters. |
Set the route template.
route | Route to modify. |
tplate | URI template to use. Templates may contain embedded tokens "{token}" where the token names correspond to the token names in the route pattern. |
Set the route trace filter.
route | HttpRoute object. |
dir | Trace direction. Set to HTTP_TRACE_TX or HTTP_TRACE_RX. |
levels | Trace class levels. Indicies are: HTTP_TRACE_CONN, HTTP_TRACE_FIRST, HTTP_TRACE_HEADER, HTTP_TRACE_BODY, HTTP_TRACE_LIMITS, HTTP_TRACE_TIME. |
len | Maximum content length eligible for tracing. |
include | Comma or space separated list of extensions to include in tracing. |
exclude | Comma or space separated list of extensions to exclude from tracing. |
Define a path token variable.
route | Route to modify. |
token | Name of the token to define. |
value | Value of the token. |
Define the maximum number of workers for a route.
route | Route to modify. |
workers | Maximum number of workers for this route. |
Set stage data.
conn | HttpConn connection object. |
key | Key index into the stage data. |
data | Reference to custom data allocated via mprAlloc. |
Expand a template string using given options.
conn | HttpConn connection object created via httpCreateConn |
tplate | Template string to process. |
options | Hash of option values for embedded tokens. |
Tokenize a string based on route data.
route | Route to modify. |
str | String to expand. |
fmt | Format string specifier. |
Tokenize a string based on route data.
route | Route to modify. |
str | String to expand. |
fmt | Format string specifier. |
args | Varargs argument list. |
Write data to the route access log.
route | Route to modify. |
buf | Data buffer to write. |
len | Size of the data buffer. |
Http Rx.
char * | accept | Accept header. | |
char * | acceptCharset | Accept-Charset header. | |
char * | acceptEncoding | Accept-Encoding header. | |
char * | acceptLanguage | Accept-Language header. | |
char * | authDetails | Header details: authorization|www-authenticate provided by peer. | |
int | authenticated | Request has been authenticated. | |
int | autoDelete | Automatically delete uploaded files. | |
MprOff | bytesRead | Length of content read by user. | |
int | chunkState | Chunk encoding state. | |
HttpConn * | conn | Connection object. | |
char * | connection | Connection header. | |
char * | contentLength | Content length string value. | |
char * | cookie | Cookie header. | |
int | eof | All read data has been received (eof). | |
MprList * | etags | Document etag to uniquely identify the document version. | |
char * | extraPath | Extra path information (CGI|PHP). | |
MprHash * | files | Uploaded files. Managed by the upload filter. | |
int | flags | Rx modifiers. | |
int | form | Using mime-type application/x-www-form-urlencoded. | |
HttpPacket * | headerPacket | HTTP headers. | |
MprHash * | headers | Header variables. | |
char * | hostHeader | Client supplied host name header. | |
bool | ifMatch | If-Match processing requested. | |
bool | ifModified | If-Modified processing requested. | |
MprList * | inputPipeline | Input processing. | |
HttpRange * | inputRange | Specified range for rx (post) data. | |
HttpLang * | lang | Selected language. | |
MprOff | length | Content length header value (ENV: CONTENT_LENGTH). | |
char * | method | Request method. | |
char * | mimeType | Mime type of the request payload (ENV: CONTENT_TYPE). | |
int | needInputPipeline | Input pipeline required to process received data. | |
char * | origin | Origin header (not used). | |
char * | originalMethod | Original method from the client. | |
char * | originalUri | Original URI passed by the client. | |
int | ownParams | Do own parameter handling. | |
MprHash * | params | Request params (Query and post data variables). | |
char * | paramString | Cached param data as a string. | |
HttpUri * | parsedUri | Parsed request uri. | |
char * | passDigest | User password digest for authentication. | |
char * | pathInfo | Path information after the scriptName (Decoded and normalized). | |
char * | pragma | Pragma header. | |
char * | redirect | Redirect route header. | |
char * | referrer | Refering URL. | |
MprOff | remainingContent | Remaining content data to read (in next chunk if chunked). | |
MprHash * | requestData | General request data storage. Users must create hash table if required. | |
HttpRoute * | route | Route for request. | |
char * | scriptName | ScriptName portion of the uri (Decoded). May be empty or start with "/". | |
char * | securityToken | Security form token. | |
HttpSession * | session | Session for request. | |
int | sessionProbed | Session has been resolved. | |
MprTime | since | If-Modified date. | |
int | status | HTTP response status. | |
char * | statusMessage | HTTP Response status message. | |
int | streaming | Stream incoming content. Forms typically buffer and dont stream. | |
MprHash * | svars | Server variables. | |
char * | target | Route target. | |
int | traceLevel | General trace level for header level info. | |
char * | upgrade | Protocol upgrade header. | |
int | upload | Request is using file upload. | |
char * | uploadDir | Upload directory. | |
char * | uri | Current URI (not decoded, may be rewritten). | |
char * | userAgent | User-Agent header. | |
struct HttpWebSocket * | webSocket | WebSocket state. |
Add query and form body data to params.
conn | HttpConn connection object. |
Test if the content has not been modified.
conn | HttpConn connection object. |
Create CGI parameters.
conn | HttpConn connection object. |
Get the receive body content length.
conn | HttpConn connection object created via httpCreateConn |
Get the request cookies.
conn | HttpConn connection object created via httpCreateConn |
Get an rx http header.
conn | HttpConn connection object created via httpCreateConn |
key | Name of the header to retrieve. This should be a lower case header name. For example: "Connection". |
Get the hash table of rx Http headers.
conn | HttpConn connection object created via httpCreateConn |
Get all the request http headers.
conn | HttpConn connection object created via httpCreateConn |
Get a header string from the given hash.
hash | Hash table to examine. |
Get a form variable as an integer.
conn | HttpConn connection object. |
var | Name of the form variable to retrieve. |
defaultValue | Default value to return if the variable is not defined. Can be null. |
Get the language to use for the request.
conn | HttpConn connection object. |
spoken | Hash table of HttpLang records. This is typically route->languages. |
defaultLang | Default language to use if none specified in the request Accept-Language header. |
Get a request param.
conn | HttpConn connection object. |
var | Name of the request param to retrieve. |
defaultValue | Default value to return if the variable is not defined. Can be null. |
Get the request params table.
conn | HttpConn connection object. |
Get the request params table as a string.
conn | HttpConn connection object. |
Get a path extension.
path | File pathname to examine. |
Get the request query string.
conn | HttpConn connection object. |
Get the number of bytes that can be read from the read queue.
conn | HttpConn connection object. |
Get stage data.
conn | HttpConn connection object. |
key | Key index into the stage data. |
Get the response status.
conn | HttpConn connection object created via httpCreateConn |
Get the Http response status message.
The Http status message is supplied on the first line of the Http responseconn | HttpConn connection object created via httpCreateConn |
Match a form variable with an expected value.
conn | HttpConn connection object. |
var | Name of the form variable. |
expected | Expected value to match with. |
Pump the Http engine for a request.
conn | HttpConn connection object. |
packet | Optional packet of input data. Set to NULL if calling from user handlers. |
Read rx body data.
This will read available body data. If in sync mode, this call may block. If in async mode, the call will not block and will return with whatever data is availableconn | HttpConn connection object created via httpCreateConn |
buffer | Buffer to receive read data. |
size | Size of buffer. |
Read response data as a string.
This will read all rx body and return a string that the caller should free. This will block and should not be used in async modeconn | HttpConn connection object created via httpCreateConn |
Set an integer request param value.
conn | HttpConn connection object. |
var | Name of the request param to retrieve. |
value | Default value to return if the variable is not defined. Can be null. |
Set a new HTTP method for processing.
conn | HttpConn connection object. |
method | New method to use. |
Set a request param value.
conn | HttpConn connection object. |
var | Name of the request param to retrieve. |
value | Default value to return if the variable is not defined. Can be null. |
Set a new URI for processing.
conn | HttpConn connection object. |
uri | New URI to use. The URI can be fully qualified starting with a scheme ("http") or it can be a partial/relative URI. Missing portions of the URI will be completed with equivalent portions from the current URI. For example: if the current request URI was |
Test if a request param is defined.
conn | HttpConn connection object. |
var | Name of the request param to retrieve. |
Trim extra path from the URI.
conn | HttpConn connection object. |
Session state object.
MprCache * | cache | Cache store reference. | |
HttpConn * | conn | Owning connection. | |
char * | id | Session ID key. | |
MprTicks | lifespan | Session inactivity timeout (msecs). |
Allocate a new session state object.
conn | Http connection object. |
id | Unique session state ID. |
lifespan | Session lifespan in ticks. |
Create a session object.
conn | Http connection object. |
Destroy a session state object.
This destroys a session. It will emit an expired cookie to force the client to remove the old session cookieconn | Http connection object. |
Get a session state object.
This will optionally create a session if one does not already exist. It will not re-create a session that existsconn | Http connection object. |
create | Set to "true" to create a session state object if one does not already exist for this client. |
Get the session ID.
conn | Http connection object. |
Get an object from the session state store.
conn | Http connection object. |
key | Session state key. |
Get a session state variable.
conn | Http connection object. |
name | Variable name to get. |
defaultValue | If the variable does not exist, return the defaultValue. |
Remove a session state variable.
conn | Http connection object. |
name | Variable name to remove. |
Set an object into the session state store.
conn | Http connection object. |
key | Session state key. |
value | Object to serialize. |
Set a session variable.
conn | Http connection object. |
name | Variable name to set. |
value | Variable value to use. |
Pipeline Stages.
void(* | close)(HttpQueue *q) |
Close the stage.
|
|
MprHash * | extensions | Matching extensions for this filter. | |
int | flags | Stage flags. | |
void(* | incoming)(HttpQueue *q, HttpPacket *packet) |
Process incoming data.
|
|
void(* | incomingService)(HttpQueue *q) |
Service the incoming data queue.
|
|
int(* | match)(struct HttpConn *conn, struct HttpRoute *route, int dir) |
Match a request.
|
|
MprModule * | module | Backing module. | |
char * | name | Stage name. | |
void(* | open)(HttpQueue *q) |
Open the stage.
|
|
void(* | outgoing)(HttpQueue *q, HttpPacket *packet) |
Process outgoing data.
|
|
void(* | outgoingService)(HttpQueue *q) |
Service the outgoing data queue.
|
|
char * | path | Backing module path (from LoadModule). | |
void(* | ready)(HttpQueue *q) |
The request is now fully ready.
|
|
void * | stageData | Private stage data. | |
void(* | start)(HttpQueue *q) |
Start the handler.
|
|
void(* | writable)(HttpQueue *q) |
The outgoing pipeline is writable and can accept more response data.
|
Create a clone of an existing state.
This is used when creating filters configured to match certain extensionshttp | Http object returned from httpCreate |
stage | Stage object to clone. |
Create a connector stage.
http | Http object returned from httpCreate |
name | Name of connector stage. |
module | Optional module object for loadable stages. |
Create a filter stage.
http | Http object. |
name | Name of connector stage. |
module | Optional module object for loadable stages. |
Create a request handler stage.
http | Http object. |
name | Name of connector stage. |
module | Optional module object for loadable stages. |
Create a connector stage.
http | Http object returned from httpCreate |
name | Name of connector stage. |
flags | Stage flags. |
module | Optional module object for loadable stages. |
Default outgoing data handling.
q | Queue object. |
Handle a Http Trace or Options method request.
conn | HttpConn object created via httpCreateConn |
methods | Comma separated list of supported methods excluding OPTIONS and TRACE which are automatically added if the route supports these methods. |
Lookup a stage by name.
http | Http object. |
name | Name of stage to locate. |
Lookup stage data.
http | Http object. |
name | Name of the stage concerned. |
HttpStats.
int | activeClients | Current active client IPs. | |
int | activeConnections | Current active connections. | |
int | activeProcesses | Current active processes. | |
int | activeRequests | Current active requests. | |
int | activeSessions | Current active sessions. | |
int | activeVMs | Current ejs VMs. | |
uint64 | heap | Current application heap memory. | |
uint64 | heapFree | Current heap memory available. | |
uint64 | heapUsed | Current heap memory in use. | |
uint64 | mem | Current application memory. | |
uint64 | memMax | Memory maximum permitted. | |
uint64 | memRedline | Memory redline limit. | |
int | pendingRequests | Pending requests waiting to be served. | |
int | regions | Current memory region count. | |
uint64 | totalConnections | Total connections accepted. | |
uint64 | totalRequests | Total requests served. | |
uint64 | totalSweeps | Total GC sweeps. | |
int | workersBusy | Current busy worker threads. | |
int | workersIdle | Current idle worker threads. | |
int | workersMax | Maximum number of workers in the thread pool. | |
int | workersYielded | Number of busy workers that are yielded for GC. |
Get the Http performance statistics.
sp | Reference to a HttpStats structure. |
Get an Http performance report.
flags | reserved. |
Trace management structure.
Http Tx.
char * | altBody | Alternate transmission for errors. | |
MprOff | bytesWritten | Bytes written including headers. | |
HttpCache * | cache | Cache control entry (only set if this request is being cached). | |
MprBuf * | cacheBuffer | Response caching buffer. | |
ssize | cacheBufferLength | Current size of the cache buffer data. | |
cchar * | cachedContent | Retrieved cached response to send. | |
ssize | chunkSize | Chunk size to use when using transfer encoding. Zero for unchunked. | |
struct HttpConn * | conn | Current connection object. | |
HttpStage * | connector | Network connector to send / receive socket data. | |
HttpRange * | currentRange | Current range being fullfilled. | |
MprOff | entityLength | Original content length before range subsetting. | |
cchar * | errorDocument | Error document to render. | |
char * | etag | Unique identifier tag. | |
cchar * | ext | Filename extension. | |
MprFile * | file | File to be served. | |
MprPath | fileInfo | File information if there is a real file to serve. | |
char * | filename | Name of a real file being served (typically pathInfo mapped). | |
int | finalized | Request response generated and handler processing is complete. | |
int | finalizedConnector | Connector has finished sending the response. | |
int | finalizedOutput | Handler or surrogate has finished writing output response. | |
int | flags | Response flags. | |
HttpStage * | handler | Final handler serving the request. | |
MprHash * | headers | Transmission headers. | |
ssize | headerSize | Size of the header written. | |
MprOff | length | Transmission content length. | |
char * | method | Client request method GET, HEAD, POST, DELETE, OPTIONS, PUT, TRACE. | |
MprList * | outputPipeline | Output processing. | |
HttpRange * | outputRanges | Data ranges for tx data. | |
HttpUri * | parsedUri | Client request uri. | |
int | pendingFinalize | Call httpFinalize again once the Tx pipeline is created. | |
HttpQueue * | queue[2] | Pipeline queue heads. | |
char * | rangeBoundary | Inter-range boundary. | |
MprOff | rangePos | Current range I/O position in response data. | |
int | responded | The request has started to respond. Some output has been initiated. | |
int | started | Handler has started. | |
int | status | HTTP response status. | |
int | traceMethods | Handler methods supported. | |
char * | webSockKey | Sec-WebSocket-Key header. | |
int | writeBlocked | Transmission writing is blocked. |
Add a header to the transmission using a format string.
conn | HttpConn connection object created via httpCreateConn |
key | Http response header key. |
fmt | Printf style formatted string to use as the header key value. |
... | Arguments for fmt. |
Add a header to the transmission.
conn | HttpConn connection object created via httpCreateConn |
key | Http response header key. |
value | Value to set for the header. |
Append a transmission header.
conn | HttpConn connection object created via httpCreateConn |
key | Http response header key. |
fmt | Printf style formatted string to use as the header key value. |
... | Arguments for fmt. |
Append a transmission header string.
conn | HttpConn connection object created via httpCreateConn |
key | Http response header key. |
value | Value to set for the header. |
Connect to a server and issue Http client request.
conn | HttpConn connection object created via httpCreateConn |
method | Http method to use. Valid methods include: "GET", "POST", "PUT", "DELETE", "OPTIONS" and "TRACE". |
uri | URI to fetch. |
ssl | SSL configuration to use if a secure connection. |
Create the tx object.
This is used internally by the http libraryconn | HttpConn connection object created via httpCreateConn |
headers | Optional headers to use for the transmission. |
Destroy the tx object.
tx | Tx object. |
Indicate the request is finalized.
conn | HttpConn connection object. |
Finalize transmission of the http response.
conn | HttpConn connection object. |
Flush tx data.
This writes any buffered dataconn | HttpConn connection object created via httpCreateConn |
Follow redirctions.
conn | HttpConn connection object created via httpCreateConn |
follow | Set to true to enable transparent redirections. |
Format an error transmission.
conn | HttpConn connection object created via httpCreateConn |
status | Http response status code. |
fmt | Printf style formatted string. This string may contain HTML tags and is not HTML encoded before sending to the user. NOTE: Do not send user input back to the client using this method. Otherwise you open large security holes. |
... | Arguments for fmt. |
Format an alternate response.
conn | HttpConn connection object created via httpCreateConn |
fmt | Printf style formatted string. This string may contain HTML tags and is not HTML encoded before sending to the user. NOTE: Do not send user input back to the client using this method. Otherwise you open large security holes. |
... | Arguments for fmt. |
Format a response body.
conn | HttpConn connection object created via httpCreateConn |
title | Title string to format into the HTML transmission body. |
fmt | Printf style formatted string. This string may contain HTML tags and is not HTML encoded before sending to the user. NOTE: Do not send user input back to the client using this method. Otherwise you open large security holes. |
... | Arguments for fmt. |
Format an alternate response.
conn | HttpConn connection object created via httpCreateConn |
fmt | Printf style formatted string. This string may contain HTML tags and is not HTML encoded before sending to the user. NOTE: Do not send user input back to the client using this method. Otherwise you open large security holes. |
args | Varargs style list of arguments. |
Return whether transfer chunked encoding will be used on this request.
conn | HttpConn connection object created via httpCreateConn |
Test if request has been finalized.
conn | HttpConn connection object. |
Test if request response has been fully generated.
conn | HttpConn connection object. |
Determine if the transmission needs a transparent retry to implement authentication or redirection.
This is used by client requests. If authentication is required, a request must first be tried once to receive some authentication key information that must be resubmitted to gain accessconn | HttpConn connection object created via httpCreateConn |
url | Reference to a string to receive a redirection URL. Set to NULL if not redirection is required. |
Redirect the client.
conn | HttpConn connection object created via httpCreateConn |
status | Http status code to send with the response. |
uri | New uri for the client. |
Remove a header from the transmission.
conn | HttpConn connection object created via httpCreateConn |
key | Http response header key. |
Define a content length header in the transmission.
This will define a "Content-Length: NNN" request header and set Tx.lengthconn | HttpConn connection object created via httpCreateConn |
length | Numeric value for the content length header. |
Set the transmission (response) content mime type.
conn | HttpConn connection object created via httpCreateConn |
mimeType | Mime type string. |
Set a transmission cookie.
conn | HttpConn connection object created via httpCreateConn |
name | Cookie name. |
value | Cookie value. |
path | URI path to which the cookie applies. |
domain | Domain in which the cookie applies. Must have 2-3 dots. |
lifespan | Duration for the cookie to persist in msec. |
flags | Cookie options mask. The following options are supported:
|
Define the length of the transmission content.
When static content is used for the transmission body, defining the entity length permits the request pipeline to know when all the data has been sentconn | HttpConn connection object created via httpCreateConn |
len | Transmission body length in bytes. |
Set a transmission header.
conn | HttpConn connection object created via httpCreateConn |
key | Http response header key. |
fmt | Printf style formatted string to use as the header key value. |
... | Arguments for fmt. |
Set a simple key/value transmission header.
conn | HttpConn connection object created via httpCreateConn |
key | Http response header key. |
value | String value for the key. |
Set the responded flag for the request.
conn | HttpConn connection object. |
Set a Http response status.
conn | HttpConn connection object created via httpCreateConn |
status | Http status code. |
Indicate that the transmission socket is blocked.
conn | Http connection object created via httpCreateConn |
Wait for the connection to achieve the requested state.
conn | HttpConn connection object created via httpCreateConn |
state | HTTP_STATE_XXX to wait for. |
timeout | Timeout in milliseconds to wait. Set to -1 to use the default inactivity timeout. Set to zero to wait for ever. |
Write the transmission headers into the given packet.
q | Queue owning the packet. |
packet | Packet into which to place the headers. |
Upload File.
cchar * | clientFilename | Client side name of the file. | |
cchar * | contentType | Content type. | |
cchar * | filename | Local (temp) name of the file. | |
ssize | size | Uploaded file size. |
Add an Uploaded file.
conn | HttpConn connection object created via httpCreateConn |
id | Unique identifier for the file. |
file | Instance of HttpUploadFile. |
Remove all uploaded files.
conn | HttpConn connection object created via httpCreateConn |
Remove an uploaded file.
conn | HttpConn connection object created via httpCreateConn |
id | Identifier used with httpAddUploadFile for the file. |
URI management.
char * | ext | Document extension. | |
char * | host | Host name. | |
char * | path | Uri path (without scheme, host, query or fragements). | |
int | port | Port number. | |
char * | query | Query string. | |
char * | reference | Reference fragment within the specified resource. | |
char * | scheme | URI scheme (http|https|...). | |
int | secure | Using https. | |
char * | uri | Original URI (not decoded). | |
int | webSockets | Using web sockets. |
Clone a URI.
base | Base URI to copy. |
flags | Set to HTTP_COMPLETE_URI to add missing components. ie. Add scheme, host and port if not supplied. |
Complete the given URI.
uri | URI to complete. |
other | Other URI to supply the missing components. |
Create and initialize a URI.
uri | Uri string to parse. |
flags | Set to HTTP_COMPLETE_URI to add missing components. ie. Add scheme, host and port if not supplied. |
Create a URI from parts.
scheme | The URI scheme. This is typically "http" or "https". |
host | The URI host name portion. This can be a textual host and domain name or it can be an IP address. |
port | The URI port number. Set to zero to accept the default value for the selected scheme. |
path | The URI path to the requested document. |
reference | URI reference with an HTML document. This is the URI component after the "#" in the URI path. |
query | URI query component. This is the URI component after the "?" in the URI. |
flags | Set to HTTP_COMPLETE_URI to add missing components. ie. Add scheme, host and port if not supplied. |
Format a URI.
scheme | Protocol string for the uri. Example: "http". |
host | Host or IP address. |
port | TCP/IP port number. |
path | URL path. |
ref | URL reference fragment. |
query | Additiona query parameters. |
flags | Set to HTTP_COMPLETE_URI to add missing components. ie. Add scheme, host and port if not supplied. |
Get a relative URI from the base to the target.
base | The base URI considered to be the current URI. Think of this as the current directory. |
target | The destination URI for which a relative URI will be crafted to reach. |
clone | If true, the target URI will be cloned if the target is an absolute URI or if a relative URI cannot be constructed. |
Join URIs.
base | Base URI to being with. |
argc | Count of URIs in others. |
others | Array of URIs to join to the base. |
Join a URI path.
result | URI that will be modified with a joined path. |
base | URI supplying the base path. |
other | Other URI whose path is joined to the base. |
Get the mime type for an extension.
This call will return the mime type from a limited internal set of mime types for the given path or extensionext | Path or extension to examine. |
Make a URI local.
uri | URI to modify. |
Normalize a URI.
uri | URI object to normalize. |
Normalize a URI.
uri | Uri path string to normalize. This is the URI path portion without scheme, host and port components. |
Resolve URIs relative to a base.
base | Base URI to begin with. |
argc | Count of URIs in the others array. |
others | Array of URIs that are sucessively resolved relative to the base. |
local | If true, the base scheme, host and port are ignored. |
Convert a Uri to a string.
uri | A Uri object created via httpCreateUri. |
flags | Set to HTTP_COMPLETE_URI to add missing components. ie. Add scheme, host and port if not supplied. |
WebSocket Service to implement the WebSockets RFC 6455 specification for client and server communications.
char * | closeReason | Reason for closure. | |
int | closeStatus | Close status provided by peer. | |
int | closing | Started closing sequnce. | |
HttpPacket * | currentFrame | Pending message frame. | |
HttpPacket * | currentMessage | Pending message frame. | |
uchar | dataMask[4] | Mask for data. | |
ssize | frameLength | Length of the current frame. | |
int | frameState | Message frame state. | |
int | maskOffset | Offset in dataMask. | |
ssize | messageLength | Length of the current message. | |
MprEvent * | pingEvent | Ping timer event. | |
int | state | State. | |
char * | subProtocol | Application level sub-protocol. |
Get the close reason supplied by the peer.
conn | HttpConn connection object created via httpCreateConn |
Get the message length for the current message.
conn | HttpConn connection object created via httpCreateConn |
Get the selected web socket protocol selected by the server.
conn | HttpConn connection object created via httpCreateConn |
Get the WebSocket state.
Send a UTF-8 text message to the web socket peer.
conn | HttpConn connection object created via httpCreateConn |
fmt | Printf style formatted string. |
... | Arguments for the format. |
Send a message of a given type to the web socket peer.
conn | HttpConn connection object created via httpCreateConn |
type | Web socket message type. Choose from WS_MSG_TEXT, WS_MSG_BINARY or WS_MSG_PING. Use httpSendClose to send a close message. Do not send a WS_MSG_PONG message as it is generated internally by the Web Sockets module. |
buf | Data buffer to send. |
len | Length of buf. |
flags | Set to HTTP_BLOCK for blocking operation or HTTP_NON_BLOCK for non-blocking. Set to HTTP_BUFFER to buffer the data if required and never block. Set to zero will default to HTTP_BUFFER. |
Send a close message to the web socket peer.
conn | HttpConn connection object created via httpCreateConn |
status | Web socket status. |
reason | Optional reason text message. The reason must be less than 124 bytes in length. |
Set a list of application-level protocols supported by the client.
conn | HttpConn connection object created via httpCreateConn |
protocols | Comma separated list of application-level protocols. |
Upgrade a client HTTP connection connection to use WebSockets.
conn | HttpConn connection object created via httpCreateConn |
Test if web socket connection was orderly closed by sending an acknowledged close message.
conn | HttpConn connection object created via httpCreateConn |
Define a function procedure to invoke when the specified URI is requested.
uri | URI to bind with. When this URI is requested, the callback will be invoked if the procHandler is configured for the request route. |
fun | Callback function procedure. |
Get the queue data for the connection.
conn | HttpConn connection object created via httpCreateConn |
Tell the tx to omit sending any body.
conn | HttpConn connection object created via httpCreateConn |
General route procedure.
Used by targets, conditions and updatesAuthType callback to generate a response requesting the user login This should call httpError if such a response cannot be generated.
conn | HttpConn connection object. |
AuthType callback to parse the HTTP 'Authorize' (client) and 'www-authenticate' (server) headers.
conn | HttpConn connection object. |
AuthType callback to set the necessary HTTP authorization headers for a client request.
conn | HttpConn connection object. |
AuthStore callback Verify the user credentials.
conn | HttpConn connection object. |
Set environment vars callback.
Invoked per request to permit custom form var definitionCallback to fill headers.
arg | Argument provided to httpSetHeadersCallback when the callback was established. |
I/O callback for connections.
conn | HttpConn object created via httpCreateConn |
event | Event object describing the I/O event. |
Listen callback.
Invoked after listening on a socket endpointConnection Http state change notification callback.
conn | HttpConn connection object created via httpCreateConn |
event | Http state. |
arg | Per-event information. |
Define an callback for IO events on this connection.
conn | HttpConn connection object created via httpCreateConn |
fn | Callback function. |
arg | Data argument to provide to the callback function. |
Timeout callback.
conn | HttpConn connection object created via httpCreateConn |
Callback procedure to fill a packet with data.
q | Queue owning the packet. |
packet | The packet to fill. |
off | Offset in the packet to fill with data. |
size | Size of packet from the offset to fill. |
Password backend store.
char * | name | Authentication password store name: 'system', 'file'. |
Authentication Protocol.
HttpAskLogin | askLogin | Callback to generate a client login response. | |
char * | name | Authentication protocol name: 'basic', 'digest', 'post'. | |
HttpParseAuth | parseAuth | Callback to parse the HTTP authentication headers. | |
HttpSetAuth | setAuth | Callback to set the HTTP response authentication headers. |
Language definition record for routes.
int | flags | Control suffix position. | |
char * | path | Document directory for the language. | |
char * | suffix | Suffix to add to filenames. |
Route operation record.
char * | details | General route operation details. | |
int | flags | Route flags to control freeing mdata. | |
void * | mdata | pcre_ data managed by malloc(). | |
char * | name | Name of route operation. | |
char * | value | Value to assign to var. | |
char * | var | Var to set. |