libutil++  1.9.3
 All Classes Functions Variables
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
sella::server::HTTP Class Reference

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 bool run (size_t maximumWorkers, size_t minimumWorkers, size_t spareWorkers=SpareWorkersDefault) 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 setSecureListeners (const sella::net::IPAddressPort::vector &listeners) throw ()
 
void setSecureListeners (const std::string &listeners) throw ()
 
void setSecureProtocols (const std::set< net::SecureTCPSocket::Protocol > &protocols=net::SecureTCPSocket::DefaultProtocols) throw ()
 
void setSecureProtocol (net::SecureTCPSocket::Protocol protocol, bool on=true) throw ()
 
void setSecureCipher (const std::string &ciphers) throw ()
 
void setSecurePreferServerCipher (bool on=true) throw ()
 
void setCertificateFile (const std::string &certificateFile) throw ()
 
void setPrivateKeyFile (const std::string &privateKeyFile) throw ()
 
void setPasswordFile (const std::string &passwordFile) throw ()
 
void setPassword (const std::string &password) throw ()
 
void setCertificateChainFile (const std::string &certificateChainFile) throw ()
 
void setCACertificateFile (const std::string &caCertificateFile) 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 setAllows (const std::set< HTTPRequest::Method > &methods=AllowDefault()) throw ()
 
void setAllow (HTTPRequest::Method method) throw ()
 
void setFallbackAcceptType (HTTPRequest::AcceptType fallbackAcceptType) throw ()
 
void setCompressionThreshold (size_t threshold=CompressionThresholdDefault) throw ()
 
void setCompressionLevel (int level=CompressionLevelDefault) 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 ()
 
sella::net::IPAddressPort::vector getSecureListeners (void) const throw ()
 
std::string getListenersString (void) const throw ()
 
std::string getSecureListenersString (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 ()
 
HTTPRequest::AcceptType getFallbackAcceptType (void) const throw ()
 
size_t getCompressionThreshold (void) const throw ()
 
int getCompressionLevel (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
sella::net::IPAddressPort::vector & 
ListenersDefault (void)
 
static const
sella::net::IPAddressPort::vector & 
SecureListenersDefault (void)
 
static const std::string & RootDefault (void)
 
static const std::vector
< std::string > & 
DirectoryIndexesDefault (void)
 
static const std::string & BannerDefault (void)
 
static const std::set
< HTTPRequest::Method > & 
AllowDefault (void)
 
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 size_t RequestBodyLimitDefault = 25 * 102400
 
static const size_t ConnectionLimitDefault = 256
 
static const size_t DelaySecondsDefault = 7200
 
static const
HTTPRequest::AcceptType 
FallbackAcceptTypeDefault = HTTPRequest::AcceptType::HTML
 
static const int CompressionThresholdDefault = 1024
 
static const int CompressionLevelDefault = 1
 
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: