MaAlias | Aliases. |
MaAuth | Authorization The MaAuth struct is the foundation authorization object and is used as base class by MaDirectory and MaLocation. |
MaConfigState | Current config parse state. |
MaConn | Http Connections. |
MaDir | Directory Control. |
MaFilter | Filter Stages. |
MaHost | Host Object A Host object represents a single listening HTTP connection endpoint. |
MaHostAddress | Host Address Mapping. |
MaHttp | Http Service. |
MaLimits | Server limits. |
MaListen | Listen endpoint. |
MaLocation | Location Control. |
MaMimeType | Mime Type hash table entry (the URL extension is the key). |
MaPacket | Data packet. |
MaQueue | Queue Head. |
MaRange | Content range structure. |
MaRequest | Http Requests. |
MaResponse | Http Response. |
MaServer | Http Server Control An application may have any number of HTTP servers, each managed by an instance of the Server class. |
MaStage | Pipeline Stages. |
MaUploadFile | Upload File. |
MaHttp* | maCreateHttp(MprCtx ctx) |
Create the MaHttp object. | |
int | maSetHttpGroup(MaHttp *http, cchar *group) |
Set the Http Group. | |
int | maSetHttpUser(MaHttp *http, cchar *user) |
Set the Http User. | |
int | maStartHttp(MaHttp *http) |
Start Http services. | |
int | maStopHttp(MaHttp *http) |
Stop Http services. | |
MaPacket* | maCreateDataPacket(struct MaConn *conn, int size) |
Create a data packet. | |
MaPacket* | maCreateEndPacket(struct MaConn *conn) |
Create an end packet. | |
MaPacket* | maCreateHeaderPacket(struct MaConn *conn) |
Create a response header packet. | |
MaPacket* | maCreatePacket(struct MaConn *conn, int size) |
Create a data packet. | |
int | maGetPacketLength(MaPacket *packet) |
Get the length of the packet data contents. | |
int | maJoinPacket(MaPacket *packet, MaPacket *other) |
Join tow packets. | |
MaPacket* | maSplitPacket(struct MaConn *conn, MaPacket *packet, int offset) |
Split a data packet. | |
void | maDisableQueue(MaQueue *q) |
Disable a queue. | |
void | maDiscardData(MaQueue *q, bool removePackets) |
Discard all data from the queue. | |
void | maEnableQueue(MaQueue *q) |
Enable a queue. | |
MaPacket* | maGet(MaQueue *q) |
Get the next packet from a queue. | |
int | maGetQueueRoom(MaQueue *q) |
Get the room in the queue. | |
bool | maIsQueueEmpty(MaQueue *q) |
Determine if the queue is empty. | |
void | maJoinForService(MaQueue *q, MaPacket *packet, bool serviceQ) |
Join a packet onto the service queue. | |
bool | maPacketTooBig(MaQueue *q, MaPacket *packet) |
Test if a packet is too big. | |
void | maPut(MaQueue *q, MaPacket *packet) |
Put a packet onto a queue. | |
void | maPutBack(MaQueue *q, MaPacket *packet) |
Put a packet back onto a queue. | |
void | maPutForService(MaQueue *q, MaPacket *packet, bool serviceQ) |
Put a packet onto the service queue. | |
void | maPutNext(MaQueue *q, MaPacket *packet) |
Put a packet onto the next queue. | |
void | maRemoveQueue(MaQueue *q) |
Remove a queue. | |
int | maResizePacket(MaQueue *q, MaPacket *packet, int size) |
Resize a packet. | |
void | maScheduleQueue(MaQueue *q) |
Schedule a queue. | |
void | maSendEndPacket(MaQueue *q) |
Send an end packet. | |
void | maSendPackets(MaQueue *q) |
Send all queued packets. | |
void | maServiceQueue(MaQueue *q) |
Service a queue. | |
bool | maWillNextQueueAccept(MaQueue *q, MaPacket *packet) |
Determine if the downstream queue will accept this packet. | |
int | maWrite(MaQueue *q, cchar *fmt, ...) |
Write a formatted string. | |
int | maWriteBlock(MaQueue *q, cchar *buf, int size, bool block) |
Write a block of data to the queue. | |
int | maWriteString(MaQueue *q, cchar *s) |
Write a string of data to the queue. | |
void | maAddFormVars(MaConn *conn, cchar *buf, int len) |
Add form variables. | |
int | maCompareFormVar(MaConn *conn, cchar *var, cchar *value) |
Compare a form variable. | |
cchar* | maGetCookies(MaConn *conn) |
Get the cookies. | |
cchar* | maGetFormVar(MaConn *conn, cchar *var, cchar *defaultValue) |
Get a form variable. | |
int | maGetIntFormVar(MaConn *conn, cchar *var, int defaultValue) |
Get a form variable as an integer. | |
cchar* | maGetQueryString(MaConn *conn) |
Get the request query string. | |
void | maSetFormVar(MaConn *conn, cchar *var, cchar *value) |
Set a form variable value. | |
void | maSetIntFormVar(MaConn *conn, cchar *var, int value) |
Set a form variable value. | |
int | maTestFormVar(MaConn *conn, cchar *var) |
Test if a form variable is defined. | |
void | maDontCacheResponse(MaConn *conn) |
Dont cache the response. | |
void | maFailRequest(MaConn *conn, int code, cchar *fmt, ...) |
Fail a request. | |
void | maFillHeaders(MaConn *conn, MaPacket *packet) |
Create the response headers. | |
int | maFormatBody(MaConn *conn, cchar *title, cchar *fmt, ...) |
Format an alternate response body. | |
void | maRedirect(MaConn *conn, int code, cchar *uri) |
Redirect the client. | |
void | maSetCookie(MaConn *conn, cchar *name, cchar *value, cchar *path, cchar *domain, int lifetime, bool secure) |
Set a response cookie. | |
void | maSetHeader(MaConn *conn, bool allowMultiple, cchar *key, cchar *fmt, ...) |
Set a response header. | |
void | maSetResponseCode(MaConn *conn, int code) |
Set a Http response code. | |
void | maSetResponseMimeType(MaConn *conn, cchar *mimeType) |
Set the response mime type. | |
int | maConfigureServer(MprCtx ctx, MaHttp *http, MaServer *server, cchar *configFile, cchar *ipAddr, int port, cchar *documentRoot) |
Configure a web server. | |
MaServer* | maCreateServer(MaHttp *http, cchar *name, cchar *root, cchar *ipAddr, int port) |
Create a MaServer object. | |
MaHttp* | maCreateWebServer(cchar *configFile) |
Create a web server. | |
void | maLoadStaticModules(MaHttp *http) |
Load static modules. | |
int | maRunSimpleWebServer(cchar *ipAddress, int port, cchar *docRoot) |
Create and run a simple web server listening on a single IP address. | |
int | maRunWebServer(cchar *configFile) |
Create and run a web server based on a configuration file. | |
int | maServiceWebServer(MaHttp *http) |
Service a web server. | |
MaStage* | maCreateConnector(MaHttp *http, cchar *name, int flags) |
Create a connector stage. | |
MaStage* | maCreateFilter(MaHttp *http, cchar *name, int flags) |
Create a filter stage. | |
MaStage* | maCreateHandler(MaHttp *http, cchar *name, int flags) |
Create a request handler stage. | |
void | maDefaultOutgoingServiceStage(MaQueue *q) |
Default outgoing data handling. | |
void* | maLookupStageData(MaHttp *http, cchar *name) |
Lookup stage data. |
#define | _h_APPWEB_MONITOR 1 |
appwebMonitor.h - Monitor Header. | |
#define | _h_HTTP_TUNE 1 |
httpTune.h - Tunable parameters for the Embedthis Http Web Server. | |
#define | MA_BUFSIZE (4 * 1024) |
Default I/O buffer size. | |
#define | MA_CGI_PERIOD 20 |
CGI poll period (only for windows). | |
#define | MA_CGI_TIMEOUT 4000 |
Time to wait to reap exit status. | |
#define | MA_CONN_CASE_INSENSITIVE 0x2 |
System case-insensitive for file matches. | |
#define | MA_CONN_CLEAN_MASK 0x1 |
Mask to clear flags after a request completes. | |
#define | MA_CONN_CLOSE 0x1 |
Connection needs to be closed. | |
#define | MA_DEFAULT_MAX_THREADS 10 |
Default number of threads. | |
#define | MA_KEEP_TIMEOUT 60000 |
Keep connection alive timeout. | |
#define | MA_LOC_APP 0x2 |
Location defines an application. | |
#define | MA_LOC_APP_DIR 0x4 |
Location defines a directory of applications. | |
#define | MA_LOC_AUTO_SESSION 0x8 |
Auto create sessions in this location. | |
#define | MA_LOC_BROWSER 0x10 |
Send errors back to the browser for this location. | |
#define | MA_MAX_ACCESS_LOG (20971520) |
Access file size (20 MB). | |
#define | MA_MAX_IOVEC 16 |
Number of fragments in a single socket write. | |
#define | MA_MAX_KEEP_ALIVE 100 |
Default requests per TCP conn. | |
#define | MA_MAX_PASS 64 |
Size of password. | |
#define | MA_MAX_QUEUE 2 |
Number of queue types. | |
#define | MA_MAX_SECRET 32 |
Number of random bytes to use. | |
#define | MA_MAX_URL 512 |
Max URL size. | |
#define | MA_PACKET_DATA 0x4 |
Packet contains actual content data. | |
#define | MA_PACKET_END 0x8 |
End of stream packet. | |
#define | MA_PACKET_HEADER 0x1 |
Packet contains HTTP headers. | |
#define | MA_PACKET_RANGE 0x2 |
Packet is a range boundary packet. | |
#define | MA_QUEUE_ALL 0x8 |
Queue has all the data there is and will be. | |
#define | MA_QUEUE_DISABLED 0x2 |
Queue's service routine is disabled. | |
#define | MA_QUEUE_EOF 0x20 |
Queue at end of data. | |
#define | MA_QUEUE_FULL 0x4 |
Queue is full. | |
#define | MA_QUEUE_OPEN 0x1 |
Queue's open routine has been called. | |
#define | MA_QUEUE_RECEIVE 1 |
Receive (read from client) queue. | |
#define | MA_QUEUE_SEND 0 |
Send (transmit to client) queue. | |
#define | MA_QUEUE_SERVICED 0x10 |
Queue has been serviced at least once. | |
#define | MA_REQ_CHUNKED 0x4 |
Content is chunk encoded. | |
#define | MA_REQ_CREATE_ENV 0x1 |
Must create env for this request. | |
#define | MA_REQ_DELETE 0x1 |
DELETE method. | |
#define | MA_REQ_GET 0x2 |
GET method. | |
#define | MA_REQ_HEAD 0x4 |
HEAD method. | |
#define | MA_REQ_IF_MODIFIED 0x2 |
If-[un]modified-since supplied. | |
#define | MA_REQ_MASK 0x7F |
Method mask. | |
#define | MA_REQ_MEM ((1 * 1024 * 1024) - HEAP_OVERHEAD) |
Default per-request memory arena size. | |
#define | MA_REQ_OPTIONS 0x8 |
OPTIONS method. | |
#define | MA_REQ_POST 0x10 |
Post method. | |
#define | MA_REQ_PUT 0x20 |
PUT method. | |
#define | MA_REQ_TRACE 0x40 |
TRACE method. | |
#define | MA_RESP_DONT_CACHE 0x1 |
Add no-cache to the response. | |
#define | MA_RESP_DONT_FINISH 0x2 |
Don't auto finish the request. | |
#define | MA_RESP_HEADERS_CREATED 0x8 |
Response headers have been created. | |
#define | MA_RESP_NO_BODY 0x4 |
No respose body, only return headers to client. | |
#define | MA_STAGE_ALL MA_REQ_MASK |
Mask for all methods. | |
#define | MA_STAGE_AUTO_DIR 0x100000 |
Want auto directory redirection. | |
#define | MA_STAGE_CONNECTOR 0x1000 |
Stage is a connector. | |
#define | MA_STAGE_DELETE MA_REQ_DELETE |
Support DELETE requests. | |
#define | MA_STAGE_ENV_VARS 0x20000 |
Create CGI style environment variables table. | |
#define | MA_STAGE_FILTER 0x4000 |
Stage is a filter. | |
#define | MA_STAGE_FORM_VARS 0x10000 |
Create query and form variables table. | |
#define | MA_STAGE_GET MA_REQ_GET |
Support GET requests. | |
#define | MA_STAGE_HANDLER 0x2000 |
Stage is a handler. | |
#define | MA_STAGE_HEAD MA_REQ_HEAD |
Support HEAD requests. | |
#define | MA_STAGE_MODULE 0x8000 |
Stage is a filter. | |
#define | MA_STAGE_OPTIONS MA_REQ_OPTIONS |
Support OPTIONS requests. | |
#define | MA_STAGE_PATH_INFO 0x80000 |
Always do path info processing. | |
#define | MA_STAGE_POST MA_REQ_POST |
Support POST requests. | |
#define | MA_STAGE_PUT MA_REQ_PUT |
Support PUT requests. | |
#define | MA_STAGE_TRACE MA_REQ_TRACE |
Support TRACE requests. | |
#define | MA_STAGE_VIRTUAL 0x40000 |
Handler serves virtual resources not the physical file system. | |
#define | MA_TIMER_PERIOD 1000 |
Timer checks ever 1 second. |
Aliases.
char * | filename | Alias to a physical path name. | |
char * | prefix | Original URI prefix. | |
int | prefixLen | Prefix length. | |
char * | uri | Redirect to a uri. |
Authorization The MaAuth struct is the foundation authorization object and is used as base class by MaDirectory and MaLocation.
Current config parse state.
MaAuth * | auth | Current auth object. | |
MaDir * | dir | Current directory block. | |
int | enabled | True if the current block is enabled. | |
MprFile * | file | Config file handle. | |
MaHost * | host | Current host. | |
int | lineNumber | Config file name. Current line number. | |
MaLocation * | location | Current location. | |
MaServer * | server | Current server. |
Http Connections.
int | abandonConnection | Abandon all processing on the current connection. Emit no data. | |
MaHostAddress * | address | Host address structure for this connection. | |
MprHeap * | arena | Connection memory arena. | |
int | canProceed | State machine should continue to process the request. | |
MprTime | expire | When the connection should expire. | |
int | flags | Connection flags. | |
MaHost * | host | Owning host for this request. | |
MaHttp * | http | Http handle. | |
MaPacket * | input | Header packet. | |
int | keepAliveCount | Count of remaining keep alive requests for this connection. | |
MaHost * | originalHost | Owning host for this connection. May be changed by Host header. | |
int | protocol | HTTP protocol version 0 == HTTP/1.0, 1 == HTTP/1.1. | |
char * | remoteIpAddr | Remote client IP address (REMOTE_ADDR). | |
int | remotePort | Remote client IP port number. | |
struct MaRequest * | request | Request object. | |
int | requestFailed | Request failed. Abbreviate request processing. | |
struct MaResponse * | response | Response object. | |
struct MaQueue | serviceq | List of queues that require service for request pipeline. | |
MprSocket * | sock | Underlying socket handle. | |
int | socketEventMask | Mask of events to receive. | |
MprTime | started | When the connection started. | |
int | state | Connection state. | |
MprTime | time | Cached current time. | |
int | timeout | Timeout period in msec. |
Directory Control.
MaAuth * | auth | Authorization control. | |
struct MaHost * | host | Host owning this directory. | |
char * | indexName | Default index document name. | |
char * | path | Directory filename. | |
int | pathLen | Length of the directory path. |
Filter Stages.
Host Object A Host object represents a single listening HTTP connection endpoint.
MprFile * | accessLog | File object for access logging. | |
MprList * | aliases | List of Alias definitions. | |
MprList * | connections | Currently open connection requests. | |
char * | currentDate | Date string for HTTP response headers. | |
MprList * | dirs | List of Directory definitions. | |
int | httpVersion | HTTP/1.X. | |
char * | ipAddrPort | IP:PORT address (with wildcards). | |
int | keepAlive | Keep alive supported - TODO should be in flags. | |
int | keepAliveTimeout | Timeout for keep-alive. | |
MaLimits * | limits | Pointer to http->limits. | |
MaLocation * | location | Default location. | |
MprList * | locations | List of Location defintions. | |
struct MaHost * | logHost | If set, use this hosts logs. | |
int | maxKeepAlive | Max keep-alive requests. | |
char * | mimeFile | Name of the mime types file. | |
MprHashTable * | mimeTypes | Hash table of mime types (key is extension). | |
char * | moduleDirs | Directories for modules. | |
char * | name | ServerName directive. | |
struct MaHost * | parent | Parent host for virtual hosts. | |
char * | secret | Random bytes for authentication. | |
bool | secure | Host is a secure (SSL) host. | |
MaServer * | server | Server owning this host. | |
int | timeout | Max time a request can take. | |
MprEvent * | timer | Admin service timer. | |
MprTime | whenCurrentDate | When was the current date last computed. |
Host Address Mapping.
int | flags | Mapping flags. | |
char * | ipAddr | IP Address for this endpoint. | |
int | port | Port for this endpoint. | |
MprList * | vhosts | Vhosts using this address. |
Http Service.
struct MaStage * | authFilter | Authorization filter (digest and basic). | |
struct MaStage * | chunkFilter | Chunked transfer encoding filter. | |
struct MaServer * | defaultServer | Default web server object. | |
struct MaStage * | dirHandler | Directory listing handler. | |
struct MaStage * | egiHandler | Embedded Gateway Interface (EGI) handler. | |
struct MaStage * | ejsHandler | Ejscript Web Framework handler. | |
struct MaStage * | fileHandler | Static file handler. | |
int | gid | Group Id. | |
char * | groupname | Http server group name. | |
MaLimits | limits | Security and resource limits. | |
MprMutex * | mutex | Multi-thread sync. | |
struct MaStage * | netConnector | Network connector. | |
struct MaStage * | passHandler | Pass through handler. | |
struct MaStage * | rangeFilter | Ranged requests filter. | |
struct MaStage * | sendConnector | Send file connector. | |
MprList * | servers | List of web servers objects. | |
MprHashTable * | stages | Hash table of stages. | |
int | uid | User Id. | |
char * | username | Http server user name. |
Create the MaHttp object.
ctx | Any memory context object returned by mprAlloc. |
Set the Http Group.
http | MaHttp object created via maCreateHttp. |
group | Group name. Must be defined in the system group file. |
Set the Http User.
http | MaHttp object created via maCreateHttp. |
user | User name. Must be defined in the system password file. |
Start Http services.
http | MaHttp object created via maCreateHttp. |
Stop Http services.
http | MaHttp object created via maCreateHttp. |
Server limits.
int | maxBody | Max size of an incoming request. | |
int | maxChunkSize | Max chunk size for transfer encoding. | |
int | maxHeader | Max size of the total header. | |
int | maxNumHeaders | Max number of lines of header. | |
int | maxResponseBody | Max size of generated response content. | |
int | maxStageBuffer | Max buffering by any pipeline stage. | |
int | maxThreads | Max number of pool threads. | |
int | maxUploadSize | Max size of an uploaded file. | |
int | maxUrl | Max size of a URL. | |
int | minThreads | Min number of pool threads. | |
int | threadStackSize | Stack size for each pool thread. |
Listen endpoint.
int | flags | Listen flags. | |
char * | ipAddr | IP address on which to listen. | |
int | port | Port number to listen on. | |
struct MaServer * | server | Server owning this listening endpoint. | |
MprSocket * | sock | Underlying socket. | |
struct MprSsl * | ssl | SSL configuration. |
Location Control.
MaAuth * | auth | Per location block authentication. | |
struct MaStage * | connector | Network connector. | |
MprHashTable * | extensions | Hash of handlers by extensions. | |
int | flags | Location flags. | |
struct MaStage * | handler | Set handler. | |
void * | handlerData | Data reserved for the handler. | |
MprList * | handlers | List of handlers for this location. | |
MprList * | inputStages | Input stages. | |
MprList * | outputStages | Output stages. | |
struct MaLocation * | parent | Parent location. | |
char * | prefix | Location prefix name. | |
int | prefixLen | Length of the prefix name. | |
int | sessionTimeout | Session timeout for this location. | |
struct MprSsl * | ssl | SSL configuration. |
Mime Type hash table entry (the URL extension is the key).
Data packet.
struct MaConn * | conn | Owning connection. | |
MprBuf * | content | Chunk content. | |
int | count | Count of bytes in packet. | |
int | flags | Packet flags. | |
struct MaPacket * | next | Next packet in chain. | |
MprBuf * | prefix | Prefix message to be emitted before the content. | |
MprBuf * | suffix | Prefix message to be emitted after the content. |
Create a data packet.
conn | MaConn connection object. |
size | Size of the package data storage. |
Create an end packet.
conn | MaConn connection object. |
Create a response header packet.
conn | MaConn connection object. |
Create a data packet.
conn | MaConn connection object. |
size | Size of the package data storage. |
Get the length of the packet data contents.
packet | Packet to examine. |
Join tow packets.
packet | Destination packet. |
other | Other packet to copy data from. |
Split a data packet.
conn | MaConn connection object. |
packet | Packet to split. |
offset | Location in the original packet at which to split. |
Queue Head.
MaQueueClose | close | Close the queue. | |
struct MaConn * | conn | Connection ownning this queue. | |
int | count | Bytes in queue. | |
int | direction | Flow direction. | |
MaPacket * | first | First packet in queue (singly linked). | |
int | flags | Queue flags. | |
int | ioCount | Count of bytes in iovec. | |
int | ioFileEntry | Has file entry in iovec. | |
int | ioFileOffset | The next file position to use. | |
int | ioIndex | Next index into iovec. | |
MaPacket * | last | Last packet in queue (tail pointer). | |
int | low | Low water mark for flow control. | |
int | max | Maxiumum queue size. | |
struct MaQueue * | nextQ | Downstream queue for next stage. | |
MaQueueOpen | open | Open the queue. | |
cchar * | owner | Name of owning stage. | |
int | packetSize | Maximum acceptable packet size. | |
struct MaQueue * | pair | Queue for the same stage in the opposite direction. | |
MaPacket * | pending | Packets pending more dynamic data output. | |
struct MaQueue * | prevQ | Upstream queue for prior stage. | |
MaQueueData | put | Put a message on the queue. | |
void * | queueData | Stage instance data. | |
struct MaQueue * | scheduleNext | Next linkage when queue is on the service queue. | |
struct MaQueue * | schedulePrev | Previous linkage when queue is on the service queue. | |
MaQueueService | service | Service the queue. | |
struct MaStage * | stage | Stage owning this queue. |
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.
q | Queue reference. |
Get the next packet from a queue.
q | Queue reference. |
Get the room in the queue.
q | Queue reference. |
Determine if the queue is empty.
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. |
Test if a packet is too big.
q | Queue reference. |
packet | Packet to test. |
Put a packet onto a queue.
q | Queue reference. |
packet | Packet to put. |
Put a packet back onto a queue.
q | Queue reference. |
packet | Packet to put back. |
Put a packet onto the service queue.
Put a packet onto a service queueq | Queue reference. |
packet | Packet to join to the queue. |
serviceQ | If true, schedule the queue for service. |
q | Queue reference. |
packet | Packet to put. |
Put a packet onto the next queue.
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. |
Schedule a queue.
q | Queue reference. |
Send an end packet.
q | Queue reference. |
Send all queued packets.
q | Queue reference. |
Service a queue.
q | Queue reference. |
Determine if the downstream queue will accept this packet.
q | Queue reference. |
packet | Packet to put. |
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. |
block | Set to true to block and wait for data to drain if the downstream queue is full. If false, the call may return not having written all the data. The return value indicates how many bytes were actually written. |
Write a string of data to the queue.
q | Queue reference. |
s | String containing the data to write. |
Content range structure.
int | end | End byte of range + 1. | |
int | len | Redundant range length. | |
struct MaRange * | next | Next range. | |
int | start | Start of range. |
Http Requests.
char * | accept | Accept header. | |
char * | acceptCharset | Accept-Charset header. | |
char * | acceptEncoding | Accept-Encoding header. | |
MaAlias * | alias | Matching alias. | |
MprHeap * | arena | Request memory arena. | |
MaAuth * | auth | Set to either dir or location auth information. | |
char * | authType | Authorization type (basic|digest) (ENV: AUTH_TYPE). | |
struct MaConn * | conn | Connection object. | |
char * | connection | Connection header. | |
char * | contentLengthStr | Content length string value. | |
char * | cookie | Request cookie header. | |
MaDir * | dir | Best matching dir (PTR only). | |
MprList * | etags | Document etag to uniquely identify the document version. | |
int | flags | Request modifiers. | |
MprHashTable * | formVars | Query and post data variables. | |
char * | forwarded | Forwarded header. | |
char * | group | Supplied via basic / digest auth. | |
MaPacket * | headerpacket | Packet containing all headers ( == conn->input). | |
MaPacket * | headerPacket | HTTP headers. | |
MprHashTable * | headers | Header variables. | |
MaHost * | host | Owning host for this request. | |
char * | hostName | Client supplied host name. | |
char * | httpProtocol | HTTP/1.0 or HTTP/1.1. | |
bool | ifMatch | If-Match processing requested. | |
bool | ifModified | If-Modified processing requested. | |
MprList * | inputPipeline | Input processing. | |
MaRange * | inputRange | Specified range for input (post) data. | |
int | length | Declared content length (ENV: CONTENT_LENGTH). | |
MaLocation * | location | Location block. | |
int | method | Request method. | |
char * | methodName | Protocol method GET|PUT. (ENV: REQUEST_METHOD). | |
char * | mimeType | Mime type of the request payload (ENV: CONTENT_TYPE). | |
MaPacket * | packet | Current input packet. | |
MprUri * | parsedUri | Parsed query string. parsedUri->query is the query string. | |
char * | pathInfo | Extra path information (ENV: PATH_INFO). | |
char * | pathTranslated | Mapped extraPath to storage (ENV: PATH_TRANSLATED). | |
char * | pragma | Pragma header. | |
MaRange * | ranges | Requested ranges for response data. | |
int | receivedContent | Length of content actually received. | |
char * | referer | Refering URL. | |
int | remainingChunk | Remaining chunk data to read. | |
int | remainingContent | Remaining content data to read. | |
MprTime | since | If-Modified date. | |
char * | url | Decoded URL. Doesn't include scheme, host, extra path, query or fragments. | |
char * | user | Remote user (ENV: REMOTE_USER). | |
char * | userAgent | User-Agent header. |
Add form variables.
conn | MaConn connection object. |
buf | Buffer containing www-urlencoded data. |
len | Length of buf. |
Compare a form variable.
conn | MaConn connection object. |
var | Name of the form variable. |
value | Value to compare. |
Get the cookies.
conn | MaConn connection object. |
Get a form variable.
conn | MaConn 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 a form variable as an integer.
conn | MaConn 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 request query string.
conn | MaConn connection object. |
Set a form variable value.
conn | MaConn connection object. |
var | Name of the form variable to retrieve. |
value | Default value to return if the variable is not defined. Can be null. |
Set a form variable value.
conn | MaConn connection object. |
var | Name of the form variable to retrieve. |
value | Default value to return if the variable is not defined. Can be null. |
Test if a form variable is defined.
conn | MaConn connection object. |
var | Name of the form variable to retrieve. |
Http Response.
char * | altBody | Alternate response for errors. | |
int | bytesWritten | Bytes written including headers. | |
int | chunkSize | Chunk size to use when using transfer encoding. | |
int | code | HTTP response code. | |
struct MaConn * | conn | Current connection object. | |
MaStage * | connector | Response connector. | |
MaRange * | currentRange | Current range being fullfilled. | |
int | entityLength | Original content length before range subsetting. | |
char * | etag | Unique identifier tag. | |
cchar * | extension | 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. | |
int | flags | Response flags. | |
MaPacket * | freePackets | List of free packets. | |
MaStage * | handler | Response handler. | |
void * | handlerData | Data reserved for the handler. | |
char * | header | HTTP response header. | |
MprHashTable * | headers | Custom response headers. | |
int | headerSize | Size of the header written. | |
int | length | Response content length. | |
cchar * | mimeType | Mime type of the response document. | |
MprList * | outputPipeline | Output processing. | |
int | pos | Current I/O position. | |
MaQueue | queue[2] | Dummy head for the response queues. | |
char * | rangeBoundary | Inter-range boundary. |
Dont cache the response.
conn | MaConn connection object. |
Fail a request.
conn | MaConn connection object. |
code | Http status code. |
fmt | Printf style formatted string. |
... | Arguments for fmt. |
Create the response headers.
conn | MaConn connection object. |
packet | Packet into which to place the headers. |
Format an alternate response body.
conn | MaConn connection object. |
title | Title string to format into the HTML response 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. |
Redirect the client.
conn | MaConn connection object. |
code | Http status code to send with the response. |
uri | New uri for the client. |
Set a response cookie.
conn | MaConn connection object. |
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. |
lifetime | Duration for the cookie to persist in seconds. |
secure | Set to true if the cookie only applies for SSL based connections. |
Set a response header.
conn | MaConn connection object. |
allowMultiple | If true, allow duplicate keys of the same value. |
key | Http response header key. |
fmt | Printf style formatted string to use as the header key value. |
... | Arguments for fmt. |
Set a Http response code.
conn | MaConn connection object. |
code | Http status code. |
Set the response mime type.
conn | MaConn connection object. |
mimeType | Mime type string. |
Http Server Control An application may have any number of HTTP servers, each managed by an instance of the Server class.
bool | alreadyLogging | Already logging. | |
struct MaHost * | defaultHost | Primary host. | |
MprList * | hostAddresses | List of HostAddress objects. | |
MprList * | hosts | List of host objects. | |
MprList * | listens | List of listening sockets. | |
int | maxConcurrentRequests | Maximum number of clients. | |
char * | name | Unique name for this server. | |
char * | serverRoot | Server root. |
Configure a web server.
ctx | Any memory context object returned by mprAlloc. |
http | MaHttp object created via maCreateHttp. |
server | MaServer object created via maCreateServer. |
configFile | File name of the Appweb configuration file (appweb.conf) that defines the web server configuration. |
ipAddr | If using a config file, set to null. Otherwise, set to a host name or IP address. |
port | If using a config file, set to -1. Otherwise, set to the port number to listen on. |
documentRoot | If not using a config file, set this to the directory containing the web documents to serve. |
Create a MaServer object.
http | Http object returned from maCreateHttp. |
name | Name of the web server. This name is used as the initial server name. |
root | Server root directory. |
ipAddr | If not-null, create and open a listening endpoint on this IP address. If you are configuring via a config file, use maConfigureServer and set ipAddr to null. |
port | Port number to listen on. Set to -1 if you do not want to open a listening endpoint on ipAddr:port. |
Create a web server.
configFile | File name of the Appweb configuration file (appweb.conf) that defines the web server configuration. |
Load static modules.
http | MaHttp object created via maCreateHttp. |
Create and run a simple web server listening on a single IP address.
ipAddress | IP address on which to listen. Set to "0.0.0.0" to listen on all interfaces. |
port | Port number to listen to. |
docRoot | Directory containing the documents to serve. |
Create and run a web server based on a configuration file.
configFile | File name of the Appweb configuration file (appweb.conf) that defines the web server configuration. |
Service a web server.
http | Http object created via maCreateWebServer or maCreateHttp. |
Pipeline Stages.
void(* | close)(MaQueue *q) |
Close the queue.
|
|
int | flags | Stage flags. | |
void(* | incomingData)(MaQueue *q, MaPacket *packet) |
Process incoming data.
|
|
void(* | incomingService)(MaQueue *q) |
Service the incoming data queue.
|
|
bool(* | match)(struct MaConn *conn, struct MaStage *stage, cchar *uri) |
Match a request.
|
|
char * | name | Stage name. | |
void(* | open)(MaQueue *q) |
Open the queue.
|
|
void(* | outgoingData)(MaQueue *q, MaPacket *packet) |
Process outgoing data.
|
|
void(* | outgoingService)(MaQueue *q) |
Service the outgoing data queue.
|
|
int(* | parse)(MaHttp *http, cchar *key, char *value, MaConfigState *state) |
Parse configuration data.
|
|
void(* | run)(MaQueue *q) |
Run the queue.
|
|
void * | stageData | Per-stage data. |
Create a connector stage.
http | MaHttp object returned from maCreateHttp. |
name | Name of connector stage. |
flags | Stage flags mask. These specify what Http request methods will be supported by this stage. Or together any of the following flags:
|
Create a filter stage.
http | MaHttp object returned from maCreateHttp. |
name | Name of connector stage. |
flags | Stage flags mask. These specify what Http request methods will be supported by this stage. Or together any of the following flags:
|
Create a request handler stage.
http | MaHttp object returned from maCreateHttp. |
name | Name of connector stage. |
flags | Stage flags mask. These specify what Http request methods will be supported by this stage. Or together any of the following flags:
|
Default outgoing data handling.
q | Queue object. |
Lookup stage data.
http | MaHttp object returned from maCreateHttp. |
name | Name of the stage concerned. |
Upload File.