00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _RSSBGR_CONFIG_H
00023 #define _RSSBGR_CONFIG_H
00024 #include "config.h"
00025 #endif
00026
00027 #ifndef _RSSBGR_FETCH_H
00028 #define _RSSBGR_FETCH_H
00029
00030 #include <stdio.h>
00031 #include <ctype.h>
00032 #define __USE_XOPEN
00033 #include <time.h>
00034 #include <sys/types.h>
00035 #include <unistd.h>
00036 #include <sys/socket.h>
00037 #include <netdb.h>
00038 #include <netinet/in.h>
00039 #include <pthread.h>
00040 #include <libxml/parser.h>
00041 #include <libxml/tree.h>
00042
00043 #include "share.h"
00044 #include "execute.h"
00045 #include "lockfile.h"
00046 #include "md5.h"
00047 #include "readconfig.h"
00048 #include "replace_fields.h"
00049
00050
00051 #ifndef HAVE_STRLCPY
00052 #include "compat/strlcpy.h"
00053 #endif
00054
00055 #define FETCH_BUFFER_SIZE 10240
00056 #define WRITE_BUFFER_SIZE 100
00057
00058 enum HTTP_STATE {HTTP_STATE_OK = 200, HTTP_STATE_REDIRECT = 300, HTTP_STATE_ERROR = 400};
00059
00060 int find_in_file(FILE *fd, char *string);
00061
00062 void process_rss(xmlNode *root_node, int config_item_i);
00063
00064 time_t string_to_time(char *data);
00065
00066 enum HTTP_STATE process_header(char *data, int len, int config_item_i);
00067
00068 void *fetch_thread(void *parameters);
00069
00070 char *fetch(int *responsesize, const char *host, const uint16_t port, const char *request);
00071
00072 #endif