a8/a8/basehttpsession.h
2018-08-26 20:34:01 +08:00

28 lines
725 B
C++

#ifndef A8_BASE_HTTPSESSION_H
#define A8_BASE_HTTPSESSION_H
#include <a8/tcpsession.h>
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