httpxx 0.1
Streaming HTTP Parser for C++

http::Flags Class Reference

Extra information about the request or response. More...

#include <Flags.hpp>

List of all members.

Public Types

typedef ::flags Value

Public Member Functions

bool operator& (const Flags &rhs) const
 Check for signaled flags.

Static Public Member Functions

static const Flags of (const ::http_parser &parser)
 Extract the flags set in parser.
static const Flags chunked ()
 Check if the message body is in chuncked format.
static const Flags keepalive ()
 Check if the client requested keep-alive.
static const Flags close ()
 Check if a new connection should be established for the next request.
static const Flags trailing ()
static const Flags upgrade ()
 Check if the client requested a protocol upgrade.
static const Flags skipbody ()

Detailed Description

Extra information about the request or response.

Flags mainly help with connection/socket management. In particular, you can determine whether to keep the connection open for keep alive or if you should use switch to an alternate protocol handler (WebSockets, for instance).

Definition at line 23 of file Flags.hpp.


Member Function Documentation

const Flags http::Flags::close ( ) [static]

Check if a new connection should be established for the next request.

See also:
keepalive()

Definition at line 28 of file Flags.cpp.

const Flags http::Flags::keepalive ( ) [static]

Check if the client requested keep-alive.

Note:
Handling keep alive is only requested by the client, it is in no fashion required to accept this. Many servers disable keep alive for performance reasons when their are hordes of requests coming mostly from different clients.
See also:
close()

Definition at line 23 of file Flags.cpp.

bool http::Flags::operator& ( const Flags rhs) const

Check for signaled flags.

Returns:
true if all flags in rhs are signaled.

Definition at line 53 of file Flags.cpp.

const Flags http::Flags::upgrade ( ) [static]

Check if the client requested a protocol upgrade.

Newer HTTP versions support derived protocol (such as WebSockets) to re-use port 80 for additional connections. When an upgrade is requested, the parser stops accepting data as soon as the headers end. Whatever data is received next should be interpreted by a specialized protocol handler.

In particular, check the "Upgrade" header to determine what protocol was requested.

Definition at line 38 of file Flags.cpp.


The documentation for this class was generated from the following files:
 All Classes Functions