20 #ifndef HTTP_FETCHER_H
21 #define HTTP_FETCHER_H
24 #define FETCHER_ERROR 0
30 #define HF_METAERROR 1
32 #define HF_HEADTIMEOUT 3
33 #define HF_DATATIMEOUT 4
34 #define HF_FRETURNCODE 5
35 #define HF_CRETURNCODE 6
36 #define HF_STATUSCODE 7
37 #define HF_CONTENTLEN 8
39 #define HF_CANTREDIRECT 10
40 #define HF_MAXREDIRECTS 11
42 #define PORT_NUMBER 80
43 #define HTTP_VERSION "HTTP/1.0"
44 #define DEFAULT_USER_AGENT "HTTP Fetcher"
45 #define DEFAULT_READ_TIMEOUT 30
48 #define REQUEST_BUF_SIZE 1024
49 #define HEADER_BUF_SIZE 1024
50 #define DEFAULT_PAGE_BUF_SIZE 1024 * 200
51 #define DEFAULT_REDIRECTS 3
76 int http_fetch(
const char *url,
char **fileBuf);
int _checkBufSize(char **buf, int *bufsize, int more)
int http_parseFilename(const char *url, char **filename)
void http_setTimeout(int seconds)
const char * http_strerror()
void http_perror(const char *string)
int http_setReferer(const char *newReferer)
void http_setRedirects(int redirects)
int _http_read_header(int sock, char *headerPtr)
int http_fetch(const char *url, char **fileBuf)
int makeSocket(char *host)
int http_setUserAgent(const char *newAgent)