Changeset 19 in cheroxy
- Timestamp:
- 11/08/12 17:12:01 (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/CRXException.h
r18 r19 6 6 7 7 #include <string> 8 #include <stdarg.h> 8 9 9 10 #ifdef _WIN32 … … 11 12 #endif 12 13 13 #define CRX_ERROR(__CODE,__FMT,...) \ 14 do { \ 15 SetErrorCode (__CODE); \ 16 SetErrorMessage (__FILE__,__func__,__LINE__,__FMT,__VA_ARGS__); \ 14 #define CRX_ERROR(__CODE,__FMT,...) \ 15 do { \ 16 SetErrorCode (__CODE); \ 17 SetErrorMessage (__FILE__,__func__,__LINE__,__FMT,##__VA_ARGS__); \ 18 } while (0) 19 20 #define CRX_ERROR_ADD(__MESSAGE) \ 21 do { \ 22 AddMessage (__MESSAGE); \ 17 23 } while (0) 18 24 … … 47 53 const char * aFormat, 48 54 va_list aVaList); 55 56 void AddMessage (const char * aMessage); 49 57 }; 50 58 -
trunk/src/CRXException.cpp
r18 r19 5 5 #include "CRXException.h" 6 6 7 #include <stdarg.h>8 7 #include <sstream> 9 8 … … 60 59 CRXException::SetErrorMessage (const char * aFile, 61 60 const char * aFunction, 62 const int 61 const int aLine, 63 62 const char * aFormat, ...) 64 63 { … … 147 146 return aErrorStream.str(); 148 147 } 148 149 void 150 CRXException::AddMessage (const char * aMessage) 151 { 152 mMessage += aMessage; 153 } -
trunk/src/CRXProxy.cpp
r18 r19 8 8 9 9 #include "CRXProxy.h" 10 11 #include <string.h> 10 12 11 13 #ifdef _DEBUG … … 30 32 THREAD_FUNCTION_RETURN 31 33 THREAD_FUNCTION_CALLING_CONVENTION 32 CRXProxyWrapper (void * a Proxy)34 CRXProxyWrapper (void * aThreadArg) 33 35 { 34 return (THREAD_FUNCTION_RETURN)((CRXProxy *) aProxy)->Forward (); 36 int aResult = 0; 37 CRXProxy * aProxy = (CRXProxy *) aThreadArg; 38 39 aResult = aProxy->Forward (); 40 if (aResult) 41 PRINT_ERROR << aProxy->GetErrorMessage (); 42 43 return (THREAD_FUNCTION_RETURN)0; 35 44 } 36 45 … … 83 92 if (aResult < 0) 84 93 { 94 CRX_ERROR_ADD (mClient.GetErrorMessage ().c_str ()); 85 95 CRX_ERROR (aResult, "failed to receive from browser"); 86 PRINT_ERROR << mClient.GetErrorMessage() << GetErrorMessage();87 96 break; 88 97 } … … 99 108 if (aResult < 0) 100 109 { 110 CRX_ERROR_ADD (aWebServer.GetErrorMessage ().c_str ()); 101 111 CRX_ERROR (aResult, "failed to connect to server <%s>", aHttpRequest.GetURL ().c_str ()); 102 PRINT_ERROR << aWebServer.GetErrorMessage() << GetErrorMessage();103 112 return aResult; 104 113 } … … 109 118 if (aResult != aReceivedSize) 110 119 { 120 CRX_ERROR_ADD (aWebServer.GetErrorMessage ().c_str ()); 111 121 CRX_ERROR (aResult, "failed to send to server <%s>", aHttpRequest.GetURL ().c_str ()); 112 PRINT_ERROR << aWebServer.GetErrorMessage() << GetErrorMessage();113 122 return aResult; 114 123 } … … 122 131 if (aResult < 0) 123 132 { 133 CRX_ERROR_ADD (aWebServer.GetErrorMessage ().c_str ()); 124 134 CRX_ERROR (aResult, "failed to receive <%s>", aHttpRequest.GetURL ().c_str ()); 125 PRINT_ERROR << aWebServer.GetErrorMessage() << GetErrorMessage();126 135 break; 127 136 } … … 135 144 if (aResult != aReceivedSize) 136 145 { 146 CRX_ERROR_ADD (mClient.GetErrorMessage ().c_str ()); 137 147 CRX_ERROR (aResult, "failed to send <%s>", aHttpRequest.GetURL ().c_str ()); 138 PRINT_ERROR << mClient.GetErrorMessage() << GetErrorMessage();139 148 break; 140 149 } -
trunk/src/makefile
r14 r19 15 15 #---------------------------------------------------------- 16 16 FILES = \ 17 CRXException \ 17 18 CRXHttpMessage \ 18 19 CRXHttpRequest \ … … 20 21 CRXSocket \ 21 22 CRXMutex \ 23 CRXProxy \ 22 24 main \ 23 25 24 26 CXX = g++ 25 27 LD = g++ 26 CXXDEFS = 28 CXXDEFS = -D_DEBUG 27 29 CXXFLAGS = $(PLATFORM) -fPIC -Wall -Wcast-align -c -g 28 30 LDFLAGS = $(PLATFORM)
Note:
See TracChangeset
for help on using the changeset viewer.