ZOO-Project
|
Macros | |
#define | _ULINET |
#define | MAX_WAIT_MSECS 180*1000 /* Wait max. 180 seconds */ |
Functions | |
size_t | write_data_into (void *buffer, size_t size, size_t nmemb, void *data) |
Write the downloaded content to a _HINTERNET structure. More... | |
size_t | write_data_into_file (void *buffer, size_t size, size_t nmemb, void *data) |
Write the downloaded content in the file pouted by the _HINTERNET structure. More... | |
size_t | header_write_data (void *buffer, size_t size, size_t nmemb, void *data) |
In case of presence of "Set-Cookie" in the headers red, store the cookie identifier in cookie. More... | |
void | setProxy (CURL *handle, char *host, long port) |
Define the proxy to use for a CURL handler. More... | |
int | setProxiesForProtcol (CURL *handle, const char *proto) |
MACOSX. More... | |
HINTERNET | InternetOpen (char *lpszAgent, int dwAccessType, char *lpszProxyName, char *lpszProxyBypass, int dwFlags) |
Create a HINTERNET. More... | |
char * | getProvenance (maps *conf, const char *url) |
Verify if the URL should use a shared cache or not. More... | |
int | AddMissingHeaderEntry (_HINTERNET *handle, const char *key, const char *value) |
Add missing headers to an existing _HINTERNET. More... | |
int | isProtectedHost (const char *protectedHosts, const char *url) |
Verify if a host is protected (appear in [security] > hosts) More... | |
void | AddHeaderEntries (HINTERNET *handle, maps *conf) |
Add headers defined in [security] > attributes to an existing HINTERNET. More... | |
void | InternetCloseHandle (HINTERNET *handle0) |
Close a HINTERNET connection and free allocated resources. More... | |
HINTERNET | InternetOpenUrl (HINTERNET *hInternet, LPCTSTR lpszUrl, LPCTSTR lpszHeaders, size_t dwHeadersLength, size_t dwFlags, size_t dwContext, const maps *conf) |
Create a new element in the download queue. More... | |
int | processDownloads (HINTERNET *hInternet) |
Download all opened urls in the queue. More... | |
int | freeCookieList (HINTERNET hInternet) |
Initialize the cookie for a specific index (hInternet.nb) More... | |
int | InternetReadFile (_HINTERNET hInternet, LPVOID lpBuffer, int dwNumberOfBytesToRead, size_t *lpdwNumberOfBytesRead) |
Copy a downloaded content. More... | |
int | setBasicAuth (HINTERNET hInternet, char *login, char *passwd) |
Use basic authentication for accessing a resource. More... | |
#define _ULINET |
#define MAX_WAIT_MSECS 180*1000 /* Wait max. 180 seconds */ |
Add headers defined in [security] > attributes to an existing HINTERNET.
handle | the _HINTERNET pointer |
conf | the header parameter name |
value | the header parameter value |
int AddMissingHeaderEntry | ( | _HINTERNET * | handle, |
const char * | key, | ||
const char * | value | ||
) |
Add missing headers to an existing _HINTERNET.
handle | the _HINTERNET pointer |
key | the header parameter name |
value | the header parameter value |
int freeCookieList | ( | HINTERNET | hInternet | ) |
char* getProvenance | ( | maps * | conf, |
const char * | url | ||
) |
Verify if the URL should use a shared cache or not.
In case the security section contains a key named "shared", then if the domain listed in the shared key are contained in the url given as parameter then it return "SHARED" in other cases, it returns "OTHER".
conf | the main configuration file maps |
url | the URL to evaluate |
size_t header_write_data | ( | void * | buffer, |
size_t | size, | ||
size_t | nmemb, | ||
void * | data | ||
) |
In case of presence of "Set-Cookie" in the headers red, store the cookie identifier in cookie.
buffer | the buffer to read |
size | size of each member |
nmemb | number of element to read |
data | the _HINTERNET structure to write in |
void InternetCloseHandle | ( | HINTERNET * | handle0 | ) |
HINTERNET InternetOpen | ( | char * | lpszAgent, |
int | dwAccessType, | ||
char * | lpszProxyName, | ||
char * | lpszProxyBypass, | ||
int | dwFlags | ||
) |
Create a HINTERNET.
lpszAgent | the HTPP User-Agent to use to send requests |
dwAccessType | type of access required |
lpszProxyName | the name of the proxy server(s) to use |
lpszProxyBypass | ip address or host names which should not be routed through the proxy |
dwFlags | Options (INTERNET_FLAG_ASYNC,INTERNET_FLAG_FROM_CACHE,INTERNET_FLAG_OFFLINE) |
HINTERNET InternetOpenUrl | ( | HINTERNET * | hInternet, |
LPCTSTR | lpszUrl, | ||
LPCTSTR | lpszHeaders, | ||
size_t | dwHeadersLength, | ||
size_t | dwFlags, | ||
size_t | dwContext, | ||
const maps * | conf | ||
) |
Create a new element in the download queue.
hInternet | the HINTERNET connection to add the download link |
lpszUrl | the url to download |
lpszHeaders | the additional headers to be sent to the HTTP server |
dwHeadersLength | the size of the additional headers |
dwFlags | desired download mode (INTERNET_FLAG_NO_CACHE_WRITE for not using cache file) |
dwContext | not used |
conf | the main configuration file maps pointer |
int InternetReadFile | ( | _HINTERNET | hInternet, |
LPVOID | lpBuffer, | ||
int | dwNumberOfBytesToRead, | ||
size_t * | lpdwNumberOfBytesRead | ||
) |
Copy a downloaded content.
hInternet | the _HINTERNET structure |
lpBuffer | the memory space to copy the downloaded content |
dwNumberOfBytesToRead | the size of lpBuffer |
lpdwNumberOfBytesRead | number of bytes red |
int isProtectedHost | ( | const char * | protectedHosts, |
const char * | url | ||
) |
Verify if a host is protected (appear in [security] > hosts)
protectedHosts | string containing all the protected hosts (coma separated) |
url | string used to extract the host from |
int processDownloads | ( | HINTERNET * | hInternet | ) |
Download all opened urls in the queue.
hInternet | the HINTERNET structure containing the queue |
int setBasicAuth | ( | HINTERNET | hInternet, |
char * | login, | ||
char * | passwd | ||
) |
Use basic authentication for accessing a resource.
hInternet | the _HINTERNET structure |
login | the login to use to authenticate |
passwd | the password to use to authenticate |
int setProxiesForProtcol | ( | CURL * | handle, |
const char * | proto | ||
) |
MACOSX.
Should autodetect the proxy configuration (do nothing on linux)
handle | a CURL handle |
proto | the protocol requiring the use of a proxy |
void setProxy | ( | CURL * | handle, |
char * | host, | ||
long | port | ||
) |
Define the proxy to use for a CURL handler.
handle | the CURL handler |
host | the proxy host (including http://) |
port | the proxy port |
size_t write_data_into | ( | void * | buffer, |
size_t | size, | ||
size_t | nmemb, | ||
void * | data | ||
) |
Write the downloaded content to a _HINTERNET structure.
buffer | the buffer to read |
size | size of each member |
nmemb | number of element to read |
data | the _HINTERNET structure to write in |
size_t write_data_into_file | ( | void * | buffer, |
size_t | size, | ||
size_t | nmemb, | ||
void * | data | ||
) |
Write the downloaded content in the file pouted by the _HINTERNET structure.
buffer | the buffer to read |
size | size of each member |
nmemb | number of element to read |
data | the _HINTERNET structure to write in |