tfHttpdUserSetOptions
Table of Contents >> Application Reference >> Web Server
#include <trsocket.h> |
int tfHttpdUserSetOptions | ( |
ttHttpdUserSrvHandle userSrvHandle, | |
int optName, | |
const char TM_FAR * optVal, | |
int optLen | |
); |
Function Description
TThis API allows the user to set run-time options for the web server. This function must be called after tfHttpdUserStart(). The options are set on a per-server basis.
Parameters
- userSrvHandle
- Handle of web server to set option on
- optName
- Name of the option to set
- optVal
- Pointer to the value to set the option to
- optLen
- Length of the variable pointed to by optVal
Options
- TM_HTTPD_OPT_REJECT_LONG_HEADERS
- Whether or not to reject incoming requests that contain headers longer than our internal buffer can store. If this is set to 0, and we receive a long header, the corresponding header in the ttHttpdUserConEntry structure will be truncated, and that structureâs uconHdrTooLong field will be set to 1. Default: 1
- TM_HTTPD_OPT_MAX_HEADER_LEN
- Size of internal buffer to store incoming HTTP request header lines in. If a header exceeds this length, the end of the header will be dropped. The HTTP request will also be rejected unless the server is configured to accept it anyhow via TM_HTTPD_OPT_REJECT_LONG_HEADERS. Default: 384
- TM_HTTPD_OPT_USER_VARIABLE
- Allow the user to set a user data pointer (per Web Server). The Web server will copy the user data pointer in the uconUserVariable field of the the ttHttpdUserConEntry structure, when a new connection is established. This will allow the user to access this per server data pointer (by calling the per connection tfHttpdUserGetConInfo API. Default: None
Returns
- TM_ENOERROR
- Success
- TM_EINVAL
- Invalid input parameter