00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00044 #ifndef INCL_WIN32_TRANSPORT_AGENT
00045 #define INCL_WIN32_TRANSPORT_AGENT
00046
00048 #include "base/fscapi.h"
00049 #include "http/URL.h"
00050 #include "http/Proxy.h"
00051 #include "http/TransportAgent.h"
00052
00053
00054 #define MAX_AUTH_ATTEMPT 5 // Max number of attempts sending http requests.
00055
00056 #define ERR_HTTP_NOT_FOUND ERR_TRANSPORT_BASE+60
00057 #define ERR_HTTP_REQUEST_TIMEOUT ERR_TRANSPORT_BASE+61
00058 #define ERR_HTTP_INFLATE ERR_TRANSPORT_BASE+70
00059 #define ERR_HTTP_DEFLATE ERR_TRANSPORT_BASE+71
00060
00061 #define ERROR_INTERNET_OFFLINE_MODE 0x0002 // Not sure why it's not defined under wininet.h ...
00062
00063
00064
00065
00066
00067
00068
00069
00070 class Win32TransportAgent : public TransportAgent {
00071
00072
00073 public:
00074 Win32TransportAgent();
00075 Win32TransportAgent(URL& url, Proxy& proxy,
00076 unsigned int responseTimeout = DEFAULT_MAX_TIMEOUT,
00077 unsigned int maxmsgsize = DEFAULT_MAX_MSG_SIZE);
00078 ~Win32TransportAgent();
00079
00080
00081
00082
00083
00084 char* sendMessage(const char* msg);
00085
00086 private:
00087 BOOL isToDeflate;
00088 BOOL isFirstMessage;
00089 BOOL isToInflate;
00090
00091 char* createHttpErrorMessage(DWORD errorCode);
00092 };
00093
00095 #endif