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

MembersDescription
nConnectionsNumber of simultaneous HTTP connections allowed.
dataLenSize of the data buffer for reading cookie and GET?POST arguments (bytes).
skTxBuffSizeSize of TX buffer for the associated socket. Leave 0 for default.
skRxBuffSizeSize of RX buffer for the associated socket. Leave 0 for default.
listenPortHTTP listening port: 80, 443, etc.
nDescriptorsHow 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.
nChunksMaximum 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.
maxRecurseLevelThe 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.
configFlagsA TCPIP_HTTP_NET_MODULE_FLAGS value.
nFileBuffersNumber 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.
fileBufferSizeSize of each of these file buffers should correspond to TCPIP_HTTP_NET_FILE_PROCESS_BUFFER_SIZE.
chunkPoolRetriesHow many retries to get chunk from the pool before giving up.
fileBufferRetriesHow many retries to get a fileBuffer before giving up.
dynVarRetriesHow many retries to havve for a dynamic variable dynamicPrint() function before calling it done.
connTimeoutPersistent 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_dirWeb 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.