Changeset 24 in cheroxy for trunk/include/CRXHttpResponse.h


Ignore:
Timestamp:
11/14/12 14:00:40 (12 years ago)
Author:
cheese
Message:

#1 change response, threading and proxy work-flow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/CRXHttpResponse.h

    r5 r24  
    77#include "CRXHttpMessage.h"
    88
     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
    915class CRXHttpResponse : public CRXHttpMessage
    1016{
     
    1218    int         mStatusCode;
    1319    std::string mStatusString;
     20    bool        mIsChunked;     /* Transfer-Encoding */
     21    int         mContentLength;
     22
     23    struct __content_body__ {
     24        char    * mBody;
     25        int     mLength;
     26    } mContent;
    1427
    1528public:
    16     CRXHttpResponse                 (void);
     29    CRXHttpResponse     (void);
     30    ~CRXHttpResponse    (void);
    1731
    1832private:
    19     void                Parse       (void);
     33    void                Parse               (void);
     34    int                 ParseContent        (const char * aContent,
     35                                             const int  aLength);
     36    void                ResetContent        (void);
    2037
    2138public:
    22     void                SetResponse (const char * aHttpResponse);
    23     std::string         GetResponse (void) const;
     39    int                 GetStatusCode       (void) const;
    2440
    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;
    2646
    27 public:
    28     int                 GetStatusCode (void) const;
     47    CRXHttpResponse &   operator =          (const char * aHttpResponse);
    2948};
    3049
Note: See TracChangeset for help on using the changeset viewer.