sella::server::HTTP Class Reference

List of all members.

Public Types

typedef std::shared_ptr< HTTPshared
typedef HTTPptr
typedef std::function< bool(HTTPConnection::shared)> acl_callback
typedef std::function< bool(HTTPConnection::shared)> request_callback
typedef std::function< bool(HTTPConnection::shared)> authentication_callback
typedef std::function< bool(HTTPConnection::shared,
int, const std::string &)> 
error_callback

Public Member Functions

 HTTP (sella::util::Log::shared log) throw (ServerException)
virtual bool receive (void) throw (ServerException)
virtual bool receive (timeval *tv) throw (ServerException)
virtual bool run (size_t workers=MaximumWorkersDefault) throw (ServerException)
virtual void start (size_t workers=MaximumWorkersDefault) throw (ServerException)
virtual void start (size_t maximumWorkers, size_t minimumWorkers, size_t spareWorkers=SpareWorkersDefault) throw (ServerException)
virtual void start (sella::util::ThreadPool::shared pool) throw (ServerException)
virtual bool stop (void) throw ()
void setListeners (const sella::net::IPAddressPort::vector &listeners) throw ()
void setListeners (const std::string &listeners) throw ()
void setRequestBodyLimit (size_t requestBodyLimit) throw ()
void setConnectionLimit (size_t connectionLimit) throw ()
void setRoot (const std::string &root) throw (ServerException)
void setDirectoryIndex (const std::vector< std::string > &indexes) throw ()
void addDirectoryIndex (const std::string &index) throw ()
void setBanner (const std::string &banner) throw ()
void setCustomHeaders (const std::vector< std::string > &headers) throw ()
void setAllow (HTTPRequest::Method method) throw ()
void setACLCallback (const acl_callback &callback) throw ()
void setAuthenticationCallback (const authentication_callback &callback) throw ()
void setRequestCallback (const request_callback &callback) throw ()
void setErrorCallback (const error_callback &callback) throw ()
sella::net::IPAddressPort::vector getListeners (void) const throw ()
std::string getListenersString (void) const throw ()
size_t getRequestBodyLimit (void) const throw ()
size_t getConnectionLimit (void) const throw ()
const std::string & getRoot (void) const throw ()
const std::vector< std::string > & getDirectoryIndexes (void) const throw ()
const std::string & getBanner (void) const throw ()
const std::vector< std::string > & getCustomHeaders (void) const throw ()
std::set< HTTPRequest::Method > getAllow (void) const throw ()
void clearAllow (HTTPRequest::Method method) throw ()
bool isRunning (void) const throw ()
virtual void clear (void)
virtual void print (void)

Static Public Member Functions

static const HTTP::shared shared_ptr () throw (ServerException)
static const HTTP::shared shared_ptr (sella::util::Log::shared log) throw (ServerException)

Static Public Attributes

static const
sella::net::IPAddressPort::vector 
ListenersDefault = { IPAddressPort("0.0.0.0:1080"), IPAddressPort("[::]:1080") }
static const size_t RequestBodyLimitDefault = 25 * 102400
static const size_t ConnectionLimitDefault = 256
static const size_t DelaySecondsDefault = 7200
static const std::string RootDefault
static const std::vector
< std::string > 
DirectoryIndexesDefault
static const std::string BannerDefault
static const std::set
< HTTPRequest::Method > 
AllowDefault = { HTTPRequest::Options, HTTPRequest::Get, HTTPRequest::Head, HTTPRequest::Trace }
static const size_t MaximumWorkersDefault = 0
static const size_t MinimumWorkersDefault = 2
static const size_t SpareWorkersDefault = 2

Protected Member Functions

void startup (void) throw (ServerException)
void shutdown (void) throw ()
int select (timeval *tv) throw (ServerException)
HTTPConnection::shared accept (const sella::net::Socket::shared &socket) throw (ServerException)
void process (HTTPConnection::shared &connection) throw ()
void server (void) throw ()
void worker (HTTPConnection::shared &connection) throw ()

Detailed Description

Definition at line 39 of file HTTP.h.


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

Generated on 20 Nov 2014 for libutil++ by  doxygen 1.6.1