• About TV's server
  • New in version 3.20
  • New in version 3.10
  • About the source code
  • About protocols/plugins
  • TV's server API
  • Protocol Initialisation
  • Protocol binding
  • Protocol Listening and handling
  • Protocol data storage
  • Control panel
  • Multi column list
  • Time and date
  • Http protocol functions
  • Unimplemented and/or replaced functions
  • RecvAndParseHTTP function

    The RecvAndParseHTTP function will receive the HTTP-header from the client and parse it to a HTTPSession structure.

    Syntax

    HTTPSession* __stdcall RecvAndParseHTTP(
    __in ProtocolSession *psess,
    __in ClientSession *sess,
    __in int maxHeaderSizeLimit,
    __in int maxTimeToReceive,
    __in int flags,
    __out int *error
    );

    Parameters

    psess [in]sess [in]maxHeaderSizeLimit [in]maxTimeToReceive [in]flags [in]
    ValueMeaning
    RPF_DONT_PARSE
    0x1
    The received header should not be parsed. This means the members defaultVariables, otherVariablesStringIndexedCollection, optionsQuestionmarkStringIndexedCollection, optionsQuestionmarkStringIndexedCollection, urlBuffer and cookieBuffer from structure HTTPSession will not be filled. The member buffer will contain the full received header and is not broken in fragments like the documentation says.
    RPF_USE_HEADER_SIZE_LIMIT
    0x2
    The parameter maxHeaderSizeLimit is valid and represents the maximum allowed size for the header to be received from the client.
    RPF_USE_TIME_LIMIT
    0x4
    The parameter maxTimeToReceive is valid and represents the maximum allowed time for the client to send the header to the server.
    RPF_CHECK_VALID_METHOD
    0x8
    The function will check the method to be one of the known values(method: "GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE" or "CONNECT") and will fail if they do not match. This check is done while the header is not full been received yet and is therefore faster than checking it afterwards.

    error [out]
    ValueMeaning
    RPE_NO_ERROR
    0
    No error.
    RPE_EXCEEDED_SIZE_LIMIT
    1
    The header send by the client has exceeded the limit passed on parameter maxHeaderSizeLimit.
    RPE_EXCEEDED_TIME_LIMIT
    2
    The maximum allowed time, passed on parameter maxTimeToReceive, has been exceeded.
    RPE_UNKNOWN_METHOD
    3
    The method send by the client is not a known method.
    RPE_UNKNOWN_PROTOCOL
    4
    The received data is not a HTTP header.
    RPE_CONNECTION_LOST
    5
    The connection to the client has been disconnected before the end of the transmission.

    Return value

    If no error occurs the function returns a pointer to a HTTPSession. If the function fails it will returns zero.

    Remarks

    You should free the HTTPSession structure with function FreeHttpSession when done using the structure.

    Requirements

    Should be exported by -
    Minimum supported API 1.00
    Header tvsserver_base.h
    Library(x86) tvs_server_http_protocol_x86.lib
    Library(x64) tvs_server_http_protocol_x64.lib
    DLL(x86) tvs_server_http_protocol_x86.DLL
    DLL(x64) tvs_server_http_protocol_x64.DLL