a8/a8/basehttpsession.h
2019-05-27 11:35:35 +08:00

32 lines
789 B
C++

#ifndef A8_BASE_HTTPSESSION_H
#define A8_BASE_HTTPSESSION_H
#ifdef A8_TCP_SESSION2
#include <a8/tcpsession2.h>
#else
#include <a8/tcpsession.h>
#endif
namespace a8
{
typedef std::map<std::string, a8::XValue> HTTPRequest;
class BaseHttpSession : public TcpSession
{
protected:
virtual void OnRawHttpGet(const std::string& url, const std::string& querystr, std::string& response);
virtual void OnHttpGet(const std::string& url, a8::HTTPRequest& request, std::string& response);
void ProcessHttpHandShake(char* buf, int& offset, unsigned int buflen);
protected:
virtual void Reset() override;
virtual void DecodePacket(char*, int& offset, unsigned int) override;
protected:
bool handled_ = false;
};
}
#endif