52 bool operator() (
const std::string & s1,
const std::string & s2 )
const 54 return strcasecmp( s1.c_str(), s2.c_str() ) < 0;
59 # define ehs_autoptr std::unique_ptr 60 # define ehs_move(x) std::move(x) 63 # include <boost/shared_ptr.hpp> 64 # define ehs_autoptr boost::shared_ptr 65 # define ehs_move(x) (x) 69 #define DEPRECATED(x) __attribute__((deprecated (x))) 73 typedef uint64_t ehs_threadid_t;
74 extern ehs_threadid_t THREADID(pthread_t t);
76 typedef pthread_t ehs_threadid_t;
98 : m_nResponseId(inResponseId)
100 , m_poEHSConnection(ipoEHSConnection)
108 void SetBody(
const char *ipsBody,
size_t inBodyLength) {
109 m_sBody = std::string(ipsBody, inBodyLength);
134 void EnableIdleTimeout(
bool enable =
true);
143 void EnableKeepAlive(
bool enable =
true);
161 typedef std::map < std::string, std::string > StringMap;
164 typedef std::map < std::string, std::string, __caseless > StringCaseMap;
167 typedef std::list < std::string > StringList;
170 typedef std::list < EHSConnection * > EHSConnectionList;
173 typedef std::map < std::string, EHS * > EHSMap;
176 typedef std::map < std::string, Datum > EHSServerParameters;
179 typedef std::map < std::string, std::string > CookieMap;
182 typedef std::map < std::string, FormValue > FormValueMap;
185 typedef std::map < std::string, Datum > CookieParameters;
188 typedef std::deque <ehs_autoptr<GenericResponse> > ResponseQueue;
191 typedef std::map < ehs_threadid_t, HttpRequest * > CurrentRequestMap;
194 typedef std::list < HttpRequest * > HttpRequestList;
EHSServer contains all the network related services for EHS.
EHS provides HTTP server functionality to a child class.
std::string m_sBody
the actual body to be sent back
EHSConnection abstracts the concept of a connection to an EHS application.
GenericResponse(int inResponseId, EHSConnection *ipoEHSConnection)
Constructs a new instance.
int m_nResponseId
response id for making sure we send responses in the right order
Caseless Compare class for case insensitive map.
void SetBody(const char *ipsBody, size_t inBodyLength)
Sets the body of this instance.
virtual ~GenericResponse()
Destructor.
bool operator()(const std::string &s1, const std::string &s2) const
case-insensitive comparator
EHSConnection * m_poEHSConnection
ehs connection object this response goes back on
std::string & GetBody()
retrieves the body of this response.
EHSConnection * GetConnection()
retrieves the EHSConnection, on which this response is supposed to be send.
This class represents what is sent back to the client.
This class represents a clients HTTP request.
class that makes it easy to go between numbers and strings
This class represents what is sent back to the client.