Changeset 28 in cheroxy for trunk/include/CRXProxy.h


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

#1 add filter class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.