ZOO-Project
|
#include <openssl/md5.h>
#include <openssl/evp.h>
#include "service.h"
#include "service_internal.h"
#include "response_print.h"
#include "caching.h"
Functions | |
char * | getMd5 (char *url) |
Compute md5. More... | |
char * | getMd5f (char *file) |
Compute md5 of a file. More... | |
char * | getFilenameForRequest (maps *conf, const char *request) |
Create a URL by appending every request header listed in the security section.This imply that the URL will contain any authentication informations that should be fowarded to the server from which de input was download. More... | |
int | storeMd5 (char *file) |
void | cacheFile (maps *conf, char *request, char *mimeType, int length, char *filename) |
Cache a file for a given request. More... | |
void | addToCache (maps *conf, char *request, char *content, char *mimeType, int length, char *filepath, size_t max_path) |
Cache a file for a given request. More... | |
char * | isInCache (maps *conf, char *request) |
Verify if a url is available in the cache. More... | |
int | readCurrentInput (maps **m, maps **in, int *index, HINTERNET *hInternet, map **error) |
Read the downloaded file for a specific input. More... | |
int | runHttpRequests (maps **m, maps **inputs, HINTERNET *hInternet, map **error) |
Effectively run all the HTTP requests in the queue. More... | |
void | addRequestToQueue (maps **m, HINTERNET *hInternet, const char *url, bool req) |
Add a request in the download queue. More... | |
int | loadRemoteFile (maps **m, map **content, HINTERNET *hInternet, char *url) |
Try to load file from cache or download a remote file if not in cache. More... | |
Add a request in the download queue.
m | the maps containing the settings of the main.cfg file |
url | the url to add to the queue |
void addToCache | ( | maps * | conf, |
char * | request, | ||
char * | content, | ||
char * | mimeType, | ||
int | length, | ||
char * | filepath, | ||
size_t | max_path | ||
) |
Cache a file for a given request.
For each cached file, the are two files stored, a .zca and a .zcm containing the downloaded content and the mimeType respectively.
conf | the maps containing the settings of the main.cfg file |
request | the url used too fetch the content |
content | the downloaded content |
mimeType | the content mimeType |
length | the content size |
filepath | a buffer for storing the path of the cached file; may be NULL |
max_path | the size of the allocated filepath buffer |
void cacheFile | ( | maps * | conf, |
char * | request, | ||
char * | mimeType, | ||
int | length, | ||
char * | filename | ||
) |
Cache a file for a given request.
For each cached file, the are two files stored, a .zca and a .zcm containing the downloaded content and the mimeType respectively.
conf | the maps containing the settings of the main.cfg file |
request | the url used too fetch the content |
content | the downloaded content |
mimeType | the content mimeType |
length | the content size |
filepath | a buffer for storing the path of the cached file; may be NULL |
max_path | the size of the allocated filepath buffer |
char* getFilenameForRequest | ( | maps * | conf, |
const char * | request | ||
) |
Create a URL by appending every request header listed in the security section.This imply that the URL will contain any authentication informations that should be fowarded to the server from which de input was download.
conf | the main configuration maps |
request | the URL to transform. |
char* getMd5 | ( | char * | url | ) |
Compute md5.
url | the char* |
char* getMd5f | ( | char * | file | ) |
Compute md5 of a file.
file | the char* |
char* isInCache | ( | maps * | conf, |
char * | request | ||
) |
Verify if a url is available in the cache.
conf | the maps containing the settings of the main.cfg file |
request | the url |
Try to load file from cache or download a remote file if not in cache.
m | the maps containing the settings of the main.cfg file |
content | the map to update |
hInternet | the HINTERNET pointer |
url | the url to fetch |
Read the downloaded file for a specific input.
m | the maps containing the settings of the main.cfg file |
in | the input |
index | the input index |
hInternet | the internet connection |
error | the error map pointer |
Effectively run all the HTTP requests in the queue.
m | the maps containing the settings of the main.cfg file |
inputs | the maps containing the inputs (defined in the requests+added per default based on the zcfg file) |
hInternet | the HINTERNET pointer |
error | the error map pointer |
int storeMd5 | ( | char * | file | ) |