00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef _SOCKETS_Ajp13Socket_H
00034 #define _SOCKETS_Ajp13Socket_H
00035
00036 #include "AjpBaseSocket.h"
00037 #include "HttpRequest.h"
00038 #include "IHttpServer.h"
00039 #include "HttpResponse.h"
00040
00041 #ifdef SOCKETS_NAMESPACE
00042 namespace SOCKETS_NAMESPACE {
00043 #endif
00044
00045
00046 class HttpResponse;
00047
00048 class Ajp13Socket : public AjpBaseSocket, public IHttpServer
00049 {
00050 public:
00051 Ajp13Socket(ISocketHandler& h);
00052
00053 void OnHeader( short id, short len );
00054 void OnPacket( const char *buf, size_t sz );
00055
00056
00057 void IHttpServer_Respond(const HttpResponse& res);
00058
00059 void OnTransferLimit();
00060
00061 void SetReused(bool x = true);
00062 bool IsReused();
00063
00064 private:
00065 void ReceiveBody( const char *buf, size_t sz );
00066 void ReceiveForwardRequest( const char *buf, size_t sz );
00067 void ReceiveShutdown( const char *buf, size_t sz );
00068 void ReceivePing( const char *buf, size_t sz );
00069 void ReceiveCPing( const char *buf, size_t sz );
00070 void Execute();
00071 void Reset();
00072
00073 size_t m_body_size_left;
00074 HttpRequest m_req;
00075 HttpResponse m_res;
00076 bool m_b_reused;
00077 };
00078
00079
00080 #ifdef SOCKETS_NAMESPACE
00081 }
00082 #endif
00083
00084 #endif // _SOCKETS_Ajp13Socket_H
00085