Changeset 20 in cheroxy


Ignore:
Timestamp:
11/08/12 17:19:07 (11 years ago)
Author:
cheese
Message:

#1 fix and arrange exception handling

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/CRXProxy.h

    r18 r20  
    1212{
    1313private:
    14     CRXSocket   mClient;
     14    CRXSocket           mClient;
    1515
    1616public:
    17     CRXProxy                (const int aSocket = 0);
     17    CRXProxy            (const int aSocket = 0);
    1818
    1919public:
    20     int         Forward     (void);
    21     int         ForwardMT   (void);
     20    static CRXProxy *   GetNewInstance  (const int aSocket = 0);
     21
     22public:
     23    int                 Forward         (void);
     24    int                 ForwardMT       (void);
    2225};
    2326
  • trunk/src/CRXProxy.cpp

    r19 r20  
    5151}
    5252
     53CRXProxy *
     54CRXProxy::GetNewInstance(const int aSocket)
     55{
     56    return new(std::nothrow) CRXProxy (aSocket);
     57}
     58
    5359int
    5460CRXProxy::ForwardMT (void)
     
    9399        {
    94100            CRX_ERROR_ADD (mClient.GetErrorMessage ().c_str ());
    95             CRX_ERROR (aResult, "failed to receive from browser");
     101            CRX_ERROR (aResult, "Failed to receive from browser");
    96102            break;
    97103        }
     
    109115            {
    110116                CRX_ERROR_ADD (aWebServer.GetErrorMessage ().c_str ());
    111                 CRX_ERROR (aResult, "failed to connect to server <%s>", aHttpRequest.GetURL ().c_str ());
     117                CRX_ERROR (aResult, "Failed to connect to server <%s>", aHttpRequest.GetURL ().c_str ());
    112118                return aResult;
    113119            }
     
    119125        {
    120126            CRX_ERROR_ADD (aWebServer.GetErrorMessage ().c_str ());
    121             CRX_ERROR (aResult, "failed to send to server <%s>", aHttpRequest.GetURL ().c_str ());
     127            CRX_ERROR (aResult, "Failed to send to server <%s>", aHttpRequest.GetURL ().c_str ());
    122128            return aResult;
    123129        }
     
    132138            {
    133139                CRX_ERROR_ADD (aWebServer.GetErrorMessage ().c_str ());
    134                 CRX_ERROR (aResult, "failed to receive <%s>", aHttpRequest.GetURL ().c_str ());
     140                CRX_ERROR (aResult, "Failed to receive <%s>", aHttpRequest.GetURL ().c_str ());
    135141                break;
    136142            }
     
    145151            {
    146152                CRX_ERROR_ADD (mClient.GetErrorMessage ().c_str ());
    147                 CRX_ERROR (aResult, "failed to send <%s>", aHttpRequest.GetURL ().c_str ());
     153                CRX_ERROR (aResult, "Failed to send <%s>", aHttpRequest.GetURL ().c_str ());
    148154                break;
    149155            }
  • trunk/src/main.cpp

    r18 r20  
    6060        }
    6161
    62         if ((aProxy = new(std::nothrow) CRXProxy (aResult)) == NULL)
     62        if ((aProxy = CRXProxy::GetNewInstance (aResult)) == NULL)
    6363        {
    6464            aResult = -1;
Note: See TracChangeset for help on using the changeset viewer.