• About TV's server
  • 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
  • ResponseHeader structure

    Contains information about a HTTP-response header to be generated by function SendHTTPHeader. Use this structure on 64-bit machines, use ResponseHeader32 on 32-bit macines.

    Syntax

    typedef struct ResponseHeader{
    int flags;
    int reserved;
    int *statusCode;
    int *contentType;
    char *contentTypeExtension;
    long long contentLength;
    long long contentRangeOffset;
    long long contentRangeTotalLength;
    long long lastModified;
    long long expires;
    struct CookieField *cookie;
    AuthorizationOptions requestAuthentication;
    char *location;
    } ResponseHeader;

    Members

    flags
    ValueMeaning
    FRH_DONT_SEND_TIMEDATE
    0x1
    The 'Date' field, holding the date and time of this machine, should not be send with this response header.
    FRH_USE_CONTENT_TYPE_EXTENSION
    0x2
    Member contentTypeExtension should be used instead of field contentType to determine the value of field 'Content-Type'.
    FRH_SEND_CONTENT_RANGE
    0x4
    The member contentRangeOffset and contentRangeTotalLength are valid and should be used to send field 'Content-Range'.
    FRH_FORCE_ZERO_CONTENT_LENGTH
    0x8
    Usally member contentLength is ignored if zero, what will result in not sending field 'Content-Length'. Setting this flag will assure the field 'Content-Length' to be send, even if the length itself is zero.
    FRH_SEND_LAST_MODIFIED
    0x10
    The member lastModified is valid and should be used to send field 'Last-Modified'.
    FRH_SEND_EXPIRES
    0x20
    The member expires is valid and should be used to send field 'Expires'.
    FRH_SEND_AUTHORIZATION_REQUEST
    0x40
    The member requestAuthentication is valid and should be used to send field 'WWW-Authenticate'.
    FRH_DONT_END_HEADER
    0x80
    The last new line that indicates the end of the header will not be send. This way you can send more header fields before closing the header with a new line.
    FRH_CONNECTION_CLOSE
    0x0
    The header field 'Connection' should be send with value 'close'.
    FRH_CONNECTION_KEEP_ALIVE
    0x100
    The header field 'Connection' should be send with value 'Keep-Alive'.
    FRH_DONT_ESCAPE_LOCATION
    0x200
    The special characters in the value hold by member location are already escaped. The value can be send without replacing the special characters.
    FRH_DONT_SEND_CONTENT_TYPE
    0x400
    The 'Content-type' field, holding the content type, should not be send with this response header.
    FRH_TRANSFER_ENCODING_CHUNKED
    0x800
    The header field 'Transfer-Encoding' should be send with value 'chunked'.

    reservedstatusCode
    ValueMeaning
    STATUS_100
    100
    "100 Continue"
    STATUS_200
    200
    "200 OK"
    STATUS_204
    204
    "204 No Content"
    STATUS_206
    206
    "206 Partial Content"
    STATUS_301
    301
    "301 Moved Permanently"
    STATUS_302
    302
    "302 Found"
    STATUS_304
    304
    "304 Not Modified"
    STATUS_307
    307
    "307 Temporary Redirect"
    STATUS_401
    401
    "401 Unauthorized"
    STATUS_403
    403
    "403 Forbidden"
    STATUS_404
    404
    "404 Not Found"
    STATUS_405
    405
    "405 Am I supposed to know the answer to everything?"
    STATUS_408
    408
    "408 Took you long enough!"
    STATUS_413
    413
    "413 Just too much!"
    STATUS_500
    500
    "500 Something is so wrong!"

    contentType
    ValueMeaning
    UNKNOWN_BINARY
    0
    "unknown/binary"
    TEXT_PLAIN
    1
    "text/plain"
    TEXT_HTML
    2
    "text/html"
    IMAGE_PNG
    3
    "image/png"
    IMAGE_GIF
    4
    "image/gif"
    IMAGE_JPEG
    5
    "image/jpeg"

    contentTypeExtensioncontentLengthcontentRangeOffsetcontentRangeTotalLengthlastModifiedexpirescookierequestAuthenticationlocation

    Requirements

    Minimum supported API 1.01
    Header tvs_server_http_protocol
    .h