Changeset 26 in cheroxy
- Timestamp:
- 11/14/12 14:28:59 (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/CRXHttpMessage.h
r24 r26 20 20 21 21 protected: 22 virtual void Parse (void); 22 virtual void Parse (void); 23 virtual void Reset (void); 23 24 24 25 public: 25 void SetMessage (const char * aHttpMessage);26 std::string GetMessage (void) const;26 void SetMessage (const char * aHttpMessage); 27 std::string GetMessage (void) const; 27 28 28 void Reset 29 void ResetMessage (void); 29 30 30 31 virtual CRXHttpMessage & operator = (const char * aHttpMessage); -
trunk/include/CRXHttpRequest.h
r24 r26 19 19 public: 20 20 CRXHttpRequest (void); 21 ~CRXHttpRequest (void); 21 22 22 23 private: 23 24 void Parse (void); 25 void Reset (void); 24 26 25 27 public: -
trunk/include/CRXHttpResponse.h
r24 r26 34 34 int ParseContent (const char * aContent, 35 35 const int aLength); 36 void Reset (void); 36 37 void ResetContent (void); 37 38 -
trunk/src/CRXHttpMessage.cpp
r24 r26 10 10 CRXHttpMessage::CRXHttpMessage (void) 11 11 { 12 /*----------------------------------------------------------------*/ 13 /*----------------------------------------------------------------*/ 12 14 } 13 15 14 16 CRXHttpMessage::~CRXHttpMessage (void) 15 17 { 18 /*----------------------------------------------------------------*/ 19 /*----------------------------------------------------------------*/ 20 } 21 22 void 23 CRXHttpMessage::Parse (void) 24 { 25 /*----------------------------------------------------------------*/ 26 /*----------------------------------------------------------------*/ 27 } 28 29 void 30 CRXHttpMessage::Reset (void) 31 { 32 /*----------------------------------------------------------------*/ 33 /*----------------------------------------------------------------*/ 16 34 } 17 35 … … 19 37 CRXHttpMessage::SetMessage (const char * aHttpMessage) 20 38 { 39 /*----------------------------------------------------------------*/ 21 40 if (aHttpMessage == NULL) 22 41 return ; … … 25 44 26 45 this->Parse (); 46 /*----------------------------------------------------------------*/ 27 47 } 28 48 … … 30 50 CRXHttpMessage::GetMessage (void) const 31 51 { 52 /*----------------------------------------------------------------*/ 53 /*----------------------------------------------------------------*/ 54 32 55 return mHttpMessage; 33 56 } 34 57 35 58 void 36 CRXHttpMessage::Reset (void)59 CRXHttpMessage::ResetMessage (void) 37 60 { 61 /*----------------------------------------------------------------*/ 38 62 mHttpMessage.clear (); 39 } 40 41 void 42 CRXHttpMessage::Parse (void) 43 { 63 /*----------------------------------------------------------------*/ 44 64 } 45 65 … … 47 67 CRXHttpMessage::operator = (const char * aHttpMessage) 48 68 { 69 /*----------------------------------------------------------------*/ 49 70 SetMessage (aHttpMessage); 71 /*----------------------------------------------------------------*/ 72 50 73 return *this; 51 74 } -
trunk/src/CRXHttpRequest.cpp
r24 r26 14 14 : mPort (0) 15 15 { 16 /*----------------------------------------------------------------*/ 17 /*----------------------------------------------------------------*/ 18 } 19 20 CRXHttpRequest::~CRXHttpRequest (void) 21 { 22 /*----------------------------------------------------------------*/ 23 Reset (); 24 /*----------------------------------------------------------------*/ 25 } 26 27 void 28 CRXHttpRequest::Reset (void) 29 { 30 /*----------------------------------------------------------------*/ 31 ResetMessage (); 32 /*----------------------------------------------------------------*/ 16 33 } 17 34 … … 19 36 CRXHttpRequest::SetHeader (const char * aHttpRequest) 20 37 { 38 /*----------------------------------------------------------------*/ 21 39 SetMessage (aHttpRequest); 40 /*----------------------------------------------------------------*/ 22 41 } 23 42 … … 25 44 CRXHttpRequest::GetHeader (void) const 26 45 { 46 /*----------------------------------------------------------------*/ 47 /*----------------------------------------------------------------*/ 48 27 49 return GetMessage (); 28 50 } … … 31 53 CRXHttpRequest::GetURL (void) const 32 54 { 55 /*----------------------------------------------------------------*/ 56 /*----------------------------------------------------------------*/ 57 33 58 return mUrl; 34 59 } … … 37 62 CRXHttpRequest::GetHost (void) const 38 63 { 64 /*----------------------------------------------------------------*/ 65 /*----------------------------------------------------------------*/ 66 39 67 return mHost; 40 68 } … … 43 71 CRXHttpRequest::GetPort (void) const 44 72 { 73 /*----------------------------------------------------------------*/ 74 /*----------------------------------------------------------------*/ 75 45 76 return mPort; 46 77 } … … 49 80 CRXHttpRequest::operator = (const char * aHttpMessage) 50 81 { 82 /*----------------------------------------------------------------*/ 51 83 SetHeader (aHttpMessage); 84 /*----------------------------------------------------------------*/ 85 52 86 return *this; 53 87 } -
trunk/src/CRXHttpResponse.cpp
r25 r26 23 23 mContentLength (0) 24 24 { 25 /*----------------------------------------------------------------*/ 25 26 memset (&mContent, 0x00, sizeof (mContent)); 27 /*----------------------------------------------------------------*/ 26 28 } 27 29 28 30 CRXHttpResponse::~CRXHttpResponse (void) 29 31 { 32 /*----------------------------------------------------------------*/ 33 Reset (); 34 /*----------------------------------------------------------------*/ 35 } 36 37 void 38 CRXHttpResponse::Reset (void) 39 { 40 /*----------------------------------------------------------------*/ 41 ResetMessage (); 30 42 ResetContent (); 43 /*----------------------------------------------------------------*/ 31 44 } 32 45 … … 34 47 CRXHttpResponse::ResetContent (void) 35 48 { 49 /*----------------------------------------------------------------*/ 36 50 if (mContent.mBody) 37 51 free (mContent.mBody); 38 52 39 53 memset (&mContent, 0x00, sizeof (mContent)); 54 /*----------------------------------------------------------------*/ 40 55 } 41 56 … … 81 96 CRXHttpResponse::operator = (const char * aHttpMessage) 82 97 { 98 /*----------------------------------------------------------------*/ 83 99 SetMessage (aHttpMessage); 100 /*----------------------------------------------------------------*/ 101 84 102 return *this; 85 103 } … … 88 106 CRXHttpResponse::GetHeader (void) const 89 107 { 108 /*----------------------------------------------------------------*/ 109 /*----------------------------------------------------------------*/ 110 90 111 return GetMessage (); 91 112 } … … 94 115 CRXHttpResponse::GetStatusCode (void) const 95 116 { 117 /*----------------------------------------------------------------*/ 118 /*----------------------------------------------------------------*/ 119 96 120 return mStatusCode; 97 121 } … … 100 124 CRXHttpResponse::GetContentLength (void) const 101 125 { 126 /*----------------------------------------------------------------*/ 127 /*----------------------------------------------------------------*/ 128 102 129 return mContentLength; 103 130 } … … 106 133 CRXHttpResponse::GetContentBody (void) const 107 134 { 135 /*----------------------------------------------------------------*/ 136 /*----------------------------------------------------------------*/ 137 108 138 return mContent.mBody; 109 139 } … … 171 201 172 202 /*----------------------------------------------------------------*/ 173 174 203 if (!mIsChunked) 175 204 {
Note:
See TracChangeset
for help on using the changeset viewer.