Changeset 46 in cheroxy for trunk/include


Ignore:
Timestamp:
11/26/12 15:23:31 (11 years ago)
Author:
cheese
Message:

#1 rename http message to http header and change way to process response content as binary

Location:
trunk/include
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/include/CRXHttpHeader.h

    r45 r46  
    11/**
    2  * CRXHttpMessage.h
     2 * CRXHttpHeader.h
    33 */
    44#ifndef __CRXHTTPMESSAGE_H__
     
    1010#define CRLF2               "\r\n\r\n" 
    1111
    12 class CRXHttpMessage
     12class CRXHttpHeader
    1313{
    1414protected:
    15     std::string mHttpMessage;
     15    std::string mHttpHeader;
    1616    std::string mHttpVersion;
    1717
    1818public:
    19     CRXHttpMessage              (void);
    20     virtual ~CRXHttpMessage     (void);
     19    CRXHttpHeader           (void);
     20    virtual ~CRXHttpHeader  (void);
    2121
    2222protected:
    23     virtual void    Parse           (void) = 0;
    24     virtual void    Reset           (void) = 0;
     23    virtual void    Parse   (void) = 0;
    2524
    2625public:
    27     void            SetMessage      (const char * aHttpMessage);
    28     std::string     GetMessage      (void) const;
    29 
    30     void            ResetMessage    (void);
     26    void            Set     (const char * aHeader);
     27    std::string     Get     (void) const;
    3128};
    3229
  • trunk/include/CRXHttpRequest.h

    r44 r46  
    55#define __CRXHTTPREQUEST_H__
    66
    7 #include "CRXHttpMessage.h"
     7#include "CRXHttpHeader.h"
    88
    9 class CRXHttpRequest : public CRXHttpMessage
     9class CRXHttpRequest : public CRXHttpHeader
    1010{
    1111private:
     
    2525    void                Parse               (void);
    2626    void                ParseFileExtension  (void);
    27     void                Reset               (void);
    2827
    2928public:
  • trunk/include/CRXHttpResponse.h

    r44 r46  
    55#define __CRXHTTPRESPONSE_H__
    66
    7 #include "CRXHttpMessage.h"
     7#include "CRXHttpHeader.h"
     8
     9#include <vector>
    810
    911#define ERROR_HTTP_RESPONSE                                 -4000
     
    1315#define ERROR_HTTP_RESPONSE_FAILED_TO_PARSE_CONTENT         ERROR_HTTP_RESPONSE - 4
    1416
    15 class CRXHttpResponse : public CRXHttpMessage
     17class CRXHttpResponse : public CRXHttpHeader
    1618{
    1719private:
    18     int         mStatusCode;
    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;
     20    int                 mStatusCode;
     21    std::string         mStatusString;
     22    bool                mIsChunked;     /* Transfer-Encoding */
     23    unsigned int        mContentLength;
     24    std::vector <char>  mContent;
    2725
    2826public:
     
    3331    void                Parse               (void);
    3432    void                Reset               (void);
    35     void                ResetContent        (void);
    3633
    3734public:
     
    3936
    4037    bool                IsChunked           (void) const;
    41     int                 SetResponseAll      (const char * aHttpResponse,
    42                                              const int  aResponseLength);
    43     void                SetHeader           (const char * aHttpResponse);
     38    void                SetHeader           (const char * aHeader);
    4439    std::string         GetHeader           (void) const;
    4540    int                 SetContent          (const char * aContent,
  • trunk/include/CRXProxy.h

    r45 r46  
    77#include "CRXException.h"
    88#include "CRXSocket.h"
    9 #include "CRXHttpMessage.h"
     9#include "CRXHttpHeader.h"
    1010#include "CRXHttpRequest.h"
    1111#include "CRXHttpResponse.h"
Note: See TracChangeset for help on using the changeset viewer.