Changeset 24 in cheroxy for trunk/include
- Timestamp:
- 11/14/12 14:00:40 (12 years ago)
- Location:
- trunk/include
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/CRXException.h
r19 r24 30 30 31 31 public: 32 CRXException (void); 32 CRXException (void); 33 virtual ~CRXException (void); 33 34 34 35 public: -
trunk/include/CRXHttpMessage.h
r18 r24 17 17 public: 18 18 CRXHttpMessage (void); 19 virtual ~CRXHttpMessage (void); 19 20 20 21 protected: … … 25 26 std::string GetMessage (void) const; 26 27 27 virtual CRXHttpMessage & operator = (const char * aHttpMessage); 28 void Reset (void); 29 30 virtual CRXHttpMessage & operator = (const char * aHttpMessage); 28 31 }; 29 32 -
trunk/include/CRXHttpRequest.h
r17 r24 24 24 25 25 public: 26 void Set Request(const char * aHttpRequest);27 std::string Get Request(void) const;26 void SetHeader (const char * aHttpRequest); 27 std::string GetHeader (void) const; 28 28 29 29 CRXHttpRequest & operator = (const char * aHttpRequest); -
trunk/include/CRXHttpResponse.h
r5 r24 7 7 #include "CRXHttpMessage.h" 8 8 9 #define ERROR_HTTP_RESPONSE -4000 10 #define ERROR_HTTP_RESPONSE_INVALID_LENGTH ERROR_HTTP_RESPONSE - 1 11 #define ERROR_HTTP_RESPONSE_INVALID_FORMAT ERROR_HTTP_RESPONSE - 2 12 #define ERROR_HTTP_RESPONSE_FAILED_TO_MEMORY_ALLOCATION ERROR_HTTP_RESPONSE - 3 13 #define ERROR_HTTP_RESPONSE_FAILED_TO_PARSE_CONTENT ERROR_HTTP_RESPONSE - 4 14 9 15 class CRXHttpResponse : public CRXHttpMessage 10 16 { … … 12 18 int mStatusCode; 13 19 std::string mStatusString; 20 bool mIsChunked; /* Transfer-Encoding */ 21 int mContentLength; 22 23 struct __content_body__ { 24 char * mBody; 25 int mLength; 26 } mContent; 14 27 15 28 public: 16 CRXHttpResponse (void); 29 CRXHttpResponse (void); 30 ~CRXHttpResponse (void); 17 31 18 32 private: 19 void Parse (void); 33 void Parse (void); 34 int ParseContent (const char * aContent, 35 const int aLength); 36 void ResetContent (void); 20 37 21 38 public: 22 void SetResponse (const char * aHttpResponse); 23 std::string GetResponse (void) const; 39 int GetStatusCode (void) const; 24 40 25 CRXHttpResponse & operator = (const char * aHttpResponse); 41 int SetResponse (const char * aHttpResponse, 42 const int aResponseLength); 43 std::string GetHeader (void) const; 44 const char * GetContentBody (void) const; 45 int GetContentLength (void) const; 26 46 27 public: 28 int GetStatusCode (void) const; 47 CRXHttpResponse & operator = (const char * aHttpResponse); 29 48 }; 30 49 -
trunk/include/CRXProxy.h
r20 r24 6 6 7 7 #include "CRXException.h" 8 #include "CRXSocket.h" 9 #include "CRXHttpMessage.h" 10 #include "CRXHttpRequest.h" 11 #include "CRXHttpResponse.h" 8 12 9 class CRXSocket; 13 #define ERROR_PROXY -10000 14 #define ERROR_PROXY_FAILED_TO_RECEIVE_REQUEST ERROR_PROXY - 1 15 #define ERROR_PROXY_FAILED_TO_SEND_REQUEST ERROR_PROXY - 2 16 #define ERROR_PROXY_FAILED_TO_RECEIVE_RESPONSE ERROR_PROXY - 3 17 #define ERROR_PROXY_FAILED_TO_SEND_RESPONSE ERROR_PROXY - 4 18 #define ERROR_PROXY_FAILED_TO_CONNECT_TO_SERVER ERROR_PROXY - 5 19 #define ERROR_PROXY_FAILED_TO_SET_RESPONSE ERROR_PROXY - 5 20 21 typedef enum { 22 CRX_PROXY_STATUS_ERROR = -1, 23 CRX_PROXY_STATUS_IDLE, 24 CRX_PROXY_STATUS_BUSY 25 } E_CRX_PROXY_STATUS; 10 26 11 27 class CRXProxy : public CRXException … … 13 29 private: 14 30 CRXSocket mClient; 31 CRXSocket mServer; 32 33 CRXHttpRequest mHttpRequest; 34 CRXHttpResponse mHttpResponse; 35 36 E_CRX_PROXY_STATUS mProxyStatus; 15 37 16 38 public: 17 CRXProxy (const int aSocket = 0); 39 CRXProxy (void); 40 ~CRXProxy (void); 41 42 static CRXProxy * GetNewInstance (void); 18 43 19 44 public: 20 static CRXProxy * GetNewInstance (const int aSocket = 0); 45 void ReleaseInstance (void); 46 47 void SetClientSocket (const int aSocket); 48 void Close (void); 49 50 int GetStatus (void); 21 51 22 52 public: 23 int Forward (void); 24 int ForwardMT (void); 53 int Forward (void); 54 55 void SetHttpRequest (const char * aHttpRequest); 56 char * GetHttpRequest (char * aBuffer, 57 const int aBufferSize) const; 58 int GetHttpRequestLength (void) const; 59 60 void SetHttpResponse (const char * aHttpResponse); 61 char * GetHttpResponse (char * aBuffer, 62 const int aBufferSize) const; 63 int GetHttpResponseLength (void) const; 64 65 int ReceiveRequest (void); 66 int SendRequest (void); 67 68 int ReceiveResponse (void); 69 int SendResponse (void); 25 70 }; 26 71 -
trunk/include/CRXSocket.h
r18 r24 55 55 * @return available : true, else : false. 56 56 */ 57 inline boolIsCreated (void) const;57 bool IsCreated (void) const; 58 58 59 inline boolIsReady (void) const;59 bool IsReady (void) const; 60 60 61 61 /** … … 87 87 CRXSocket & operator = (int aSocket); 88 88 89 int SetTimeout (const int aTimeout); 90 89 91 /** 90 92 * for server … … 107 109 * for communication 108 110 */ 109 int Send (c har * aBuffer,110 int aSize);111 int Send (const char * aBuffer, 112 int aSize); 111 113 112 114 int Receive (char * aBuffer,
Note:
See TracChangeset
for help on using the changeset viewer.