TCPIP_HTTP_NET_MODULE_CONFIG Structure
C
typedef struct {
uint16_t nConnections;
uint16_t dataLen;
uint16_t sktTxBuffSize;
uint16_t sktRxBuffSize;
uint16_t listenPort;
uint16_t nDescriptors;
uint16_t nChunks;
uint16_t maxRecurseLevel;
uint16_t configFlags;
uint16_t nFileBuffers;
uint16_t fileBufferSize;
uint16_t chunkPoolRetries;
uint16_t fileBufferRetries;
uint16_t dynVarRetries;
uint16_t connTimeout;
void* (* http_malloc_fnc)(size_t bytes);
void (* http_free_fnc)(void* ptr);
const char* web_dir;
} TCPIP_HTTP_NET_MODULE_CONFIG;
Description
HTTP module dynamic configuration data.
Members
Members | Description |
---|---|
nConnections | Number of simultaneous HTTP connections allowed. |
dataLen | Size of the data buffer for reading cookie and GET?POST arguments (bytes). |
skTxBuffSize | Size of TX buffer for the associated socket. Leave 0 for default. |
skRxBuffSize | Size of RX buffer for the associated socket. Leave 0 for default. |
listenPort | HTTP listening port: 80, 443, etc. |
nDescriptors | How many buffer descriptors for dynamic variable processing to create. They are independent of the HTTP connection number all the HTTP connections use from the dynamic descriptors pool. |
nChunks | Maximum number of chunks that are created. It depends on the TCPIP_HTTP_NET_MAX_RECURSE_LEVEL and on the number of connections. Maximum number should be TCPIP_HTTP_NET_MAX_CONNECTIONS * TCPIP_HTTP_NET_MAX_RECURSE_LEVEL. All the chunks are in a pool and are used by all connections. |
maxRecurseLevel | The maximum depth of recursive calls for serving a web page: - Files without dynvars: 1 - Files including another file: + 1 - File including a dynamic variable: + 1 etc. |
configFlags | A TCPIP_HTTP_NET_MODULE_FLAGS value. |
nFileBuffers | Number of file buffers to be created. These buffers are used to store data while file processing is done. They are organized in a pool. Each file being processed needs a file buffer and tries to get it from the pool. If a buffer is not available, the HTTP conenction will wait for one to become available. Once the file is done the file buffer is released and could be used by a different file. The number depends on the number of files that are processed in parallel. To avoid deadlock, the number should be >= than the number of maximum files that can be open simultaneously: i.e. for file1 ->include file2 -> include file3 you'll need >= 3 file process buffers. |
fileBufferSize | Size of each of these file buffers should correspond to TCPIP_HTTP_NET_FILE_PROCESS_BUFFER_SIZE. |
chunkPoolRetries | How many retries to get chunk from the pool before giving up. |
fileBufferRetries | How many retries to get a fileBuffer before giving up. |
dynVarRetries | How many retries to havve for a dynamic variable dynamicPrint() function before calling it done. |
connTimeout | Persistent connection timeout, in seconds. If non 0 and a persistent connection is idle for more than this timeout, the server will close it. Maximum supported value is 32767 seconds. HTTP specific allocation functions. These functions are used for: - The dynamic variable descriptor - SSI commands - File upload buffer allocation |
(* http_malloc_fnc)(size_t bytes) | Malloc style allocation function for HTTP module. |
(* http_free_fnc)(void* ptr) | Free style allocation function. |
web_dir | Web pages directory. The HTTP server will serve pages located under this top directory. No access is possible above this directory. As a good practive to follow, use something like: "/mnt_point/webpages/" to limit an external user access to this only directory in the file system when using the Web server. |