Changeset 44 in cheroxy for trunk/src/main.cpp


Ignore:
Timestamp:
11/22/12 15:21:02 (11 years ago)
Author:
cheese
Message:

#1 change logic more detail

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main.cpp

    r36 r44  
    9191        }
    9292
    93         if ((aProxy = CRXProxy::GetNewInstance ()) == NULL)
     93        if ((aProxy = new(std::nothrow) CRXProxy ()) == NULL)
    9494        {
    9595            cerr << "Failed to get proxy." << endl;
     
    114114            aHttpMessageLength = aProxy->GetHttpRequestLength ();
    115115            aHttpMessage = (char *) calloc (aHttpMessageLength + 1, 1);
    116             cout << aProxy->GetHttpRequest (aHttpMessage, aHttpMessageLength) << endl;
     116            aProxy->GetHttpRequest (aHttpMessage, aHttpMessageLength);
     117            CRX_DEBUG_TRACE ("== Request: \n%s\n", aHttpMessage);
    117118            free (aHttpMessage);
    118119
    119120            aHttpMessageLength = aProxy->GetHttpResponseHeaderLength ();
    120121            aHttpMessage = (char *) calloc (aHttpMessageLength + 1, 1);
    121             cout << aProxy->GetHttpResponseHeader (aHttpMessage, aHttpMessageLength) << endl;
     122            aProxy->GetHttpResponseHeader (aHttpMessage, aHttpMessageLength);
     123            CRX_DEBUG_TRACE ("== Response: \n%s\n", aHttpMessage);
     124            free (aHttpMessage);
     125
     126            aHttpMessageLength = aProxy->GetHttpResponseBodyLength ();
     127            aHttpMessage = (char *) calloc (aHttpMessageLength + 1, 1);
     128            aProxy->GetHttpResponseBody (aHttpMessage, aHttpMessageLength);
     129            CRX_DEBUG_TRACE_BIN (aHttpMessage, aHttpMessageLength, "== Content-Body: \n");
    122130            free (aHttpMessage);
    123131        }
    124132
    125         aProxy->ReleaseInstance ();
     133        delete aProxy;
    126134    }
    127135
Note: See TracChangeset for help on using the changeset viewer.