Changeset 28 in cheroxy for trunk/include


Ignore:
Timestamp:
11/16/12 13:07:05 (12 years ago)
Author:
cheese
Message:

#1 add filter class

Location:
trunk/include
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/CRXHttpRequest.h

    r26 r28  
    1212    std::string mMethod;
    1313    std::string mUrl;
     14    std::string mFileExtension;
    1415
    1516    std::string mProtocol;
     
    1819
    1920public:
    20     CRXHttpRequest                  (void);
    21     ~CRXHttpRequest                 (void);
     21    CRXHttpRequest      (void);
     22    ~CRXHttpRequest     (void);
    2223
    2324private:
    24     void                Parse       (void);
    25     void                Reset       (void);
     25    void                Parse               (void);
     26    void                ParseFileExtension  (void);
     27    void                Reset               (void);
    2628
    2729public:
    28     void                SetHeader   (const char * aHttpRequest);
    29     std::string         GetHeader   (void) const;
     30    void                SetHeader           (const char * aHttpRequest);
     31    std::string         GetHeader           (void) const;
    3032
    31     CRXHttpRequest &    operator =  (const char * aHttpRequest);
     33    CRXHttpRequest &    operator =          (const char * aHttpRequest);
    3234
    3335public:
    34     std::string         GetURL      (void) const;
    35     std::string         GetHost     (void) const;
    36     int                 GetPort     (void) const;
     36    std::string         GetURL              (void) const;
     37    std::string         GetHost             (void) const;
     38    int                 GetPort             (void) const;
     39    std::string         GetFileExtension    (void) const;
    3740};
    3841
  • trunk/include/CRXProxy.h

    r24 r28  
    1010#include "CRXHttpRequest.h"
    1111#include "CRXHttpResponse.h"
     12#include "CRXFilter.h"
    1213
    1314#define ERROR_PROXY                             -10000
     
    1718#define ERROR_PROXY_FAILED_TO_SEND_RESPONSE     ERROR_PROXY - 4
    1819#define ERROR_PROXY_FAILED_TO_CONNECT_TO_SERVER ERROR_PROXY - 5
    19 #define ERROR_PROXY_FAILED_TO_SET_RESPONSE      ERROR_PROXY - 5
     20#define ERROR_PROXY_FAILED_TO_SET_RESPONSE      ERROR_PROXY - 6
    2021
    21 typedef enum {
    22     CRX_PROXY_STATUS_ERROR = -1,
    23     CRX_PROXY_STATUS_IDLE,
    24     CRX_PROXY_STATUS_BUSY
    25 } E_CRX_PROXY_STATUS;
    2622
    2723class CRXProxy : public CRXException
    2824{
    2925private:
     26    bool                mIsIntercepted;
     27
    3028    CRXSocket           mClient;
    3129    CRXSocket           mServer;
     
    3432    CRXHttpResponse     mHttpResponse;
    3533
    36     E_CRX_PROXY_STATUS  mProxyStatus;
     34    static CRXFilter    mFilter;
    3735
    3836public:
     
    4341
    4442public:
     43    /* common utilities */
    4544    void    ReleaseInstance             (void);
    4645
     
    4847    void    Close                       (void);
    4948
    50     int     GetStatus                   (void);
     49public:
     50    /* interface to filter */
     51    void    SetRequestFilter            (const E_CRX_FILTER_REQUEST aType,
     52                                         const bool                 aIsMatched,
     53                                         const std::string          aValue);
     54    void    RemoveRequestFilter         (const E_CRX_FILTER_REQUEST aType);
     55    bool    CheckRequestFilter          (const E_CRX_FILTER_REQUEST aType);
    5156
    5257public:
     58    /* for communication */
    5359    int     Forward                     (void);
    5460
Note: See TracChangeset for help on using the changeset viewer.