23 #include <curl/curl.h>
26 #include "wxgis/datasource/datasource.h"
30 wxString sHead, sBody;
38 wxGISCurl(wxString proxy, wxString sHeaders,
int dnscachetimeout,
int timeout,
int conntimeout);
40 bool IsValid(
void){
return m_bIsValid;};
43 bool m_bIsValid, m_bUseProxy;
51 struct curl_slist *slist;
52 struct MemoryStruct bodystruct;
53 struct MemoryStruct headstruct;
55 static void *myrealloc(
void *ptr,
size_t size)
60 return realloc(ptr, size);
65 static size_t write_data(
void *ptr,
size_t size,
size_t nmemb,
void *data)
67 size_t realsize = size * nmemb;
68 struct MemoryStruct *mem = (
struct MemoryStruct *)data;
70 mem->memory = (
char *)myrealloc(mem->memory, mem->size + realsize + 1);
73 memcpy(&(mem->memory[mem->size]), ptr, realsize);
74 mem->size += realsize;
75 mem->memory[mem->size] = 0;
81 virtual void SetRestrictions(wxString sRestrict);
82 virtual void AppendHeader(wxString sHeadStr);
83 virtual void SetDefaultHeader(
void);
84 virtual void FollowLocation(
bool bSet,
unsigned short iMaxRedirs);
86 virtual bool GetFile(wxString sURL, wxString sPath);
87 virtual PERFORMRESULT Post(wxString sURL, wxString sPostData);