BYTE HTTPNeedsAuth( BYTE* cFile );
This function is implemented by the application developer in CustomHTTPApp.c. Its function is to determine if a file being requested requires authentication to view. The user name and password, if supplied, will arrive later with the request headers, and will be processed at that time.
Return values 0x80 - 0xff indicate that authentication is not required, while values from 0x00 to 0x79 indicate that a user name and password are required before proceeding. While most applications will only use a single value to grant access and another to require authorization, the range allows multiple "realms" or sets of pages to be protected, with different credential requirements for each.
The return value of this function is saved as curHTTP.isAuthorized, and will be available to future callbacks, including HTTPCheckAuth and any of the HTTPExecuteGet, HTTPExecutePost, or HTTPPrint_varname callbacks.
None
Parameters |
Description |
cFile |
the name of the file being requested |
Return Values |
Description |
<= 0x79 |
valid authentication is required |
>= 0x80 |
access is granted for this connection |
This function may NOT write to the TCP buffer.