Main Page | Class List | File List | Class Members | File Members

fetch.h File Reference

#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include <time.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <pthread.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include "share.h"
#include "execute.h"
#include "lockfile.h"
#include "md5.h"
#include "readconfig.h"
#include "replace_fields.h"
#include "compat/strlcpy.h"

Go to the source code of this file.

Defines

#define __USE_XOPEN
#define FETCH_BUFFER_SIZE   10240
#define WRITE_BUFFER_SIZE   100

Enumerations

enum  HTTP_STATE { HTTP_STATE_OK = 200, HTTP_STATE_REDIRECT = 300, HTTP_STATE_ERROR = 400 }

Functions

int find_in_file (FILE *fd, char *string)
void process_rss (xmlNode *root_node, int config_item_i)
time_t string_to_time (char *data)
enum HTTP_STATE process_header (char *data, int len, int config_item_i)
void * fetch_thread (void *parameters)
char * fetch (int *responsesize, const char *host, const uint16_t port, const char *request)


Define Documentation

#define __USE_XOPEN
 

Definition at line 32 of file fetch.h.

#define FETCH_BUFFER_SIZE   10240
 

Definition at line 55 of file fetch.h.

Referenced by fetch().

#define WRITE_BUFFER_SIZE   100
 

Definition at line 56 of file fetch.h.

Referenced by fetch().


Enumeration Type Documentation

enum HTTP_STATE
 

Enumeration values:
HTTP_STATE_OK 
HTTP_STATE_REDIRECT 
HTTP_STATE_ERROR 

Definition at line 58 of file fetch.h.

Referenced by process_header().


Function Documentation

char* fetch int *  responsesize,
const char *  host,
const uint16_t  port,
const char *  request
 

Definition at line 286 of file fetch.c.

References DEBUG1, DEBUG2, FETCH_BUFFER_SIZE, and WRITE_BUFFER_SIZE.

Referenced by fetch_thread().

void* fetch_thread void *  parameters  ) 
 

Definition at line 207 of file fetch.c.

References config, config_item::cookies, config_item::cookies_count, DEBUG2, cookie::expires, fetch(), HTTP_STATE_ERROR, HTTP_STATE_OK, HTTP_STATE_REDIRECT, MIN, process_header(), process_rss(), and strlcpy().

Referenced by main().

int find_in_file FILE *  fd,
char *  string
 

Find line exact to null terminated string in opened for read file

Parameters:
fd file descriptor
string null terminated string to be found (without end-of-line char)

Definition at line 33 of file fetch.c.

References DEBUG3.

Referenced by process_rss().

enum HTTP_STATE process_header char *  data,
int  len,
int  config_item_i
 

Definition at line 117 of file fetch.c.

References config, config_item::cookies, config_item::cookies_count, cookie::data, DEBUG2, DEBUG4, cookie::expires, config_item::host, HTTP_STATE, HTTP_STATE_ERROR, HTTP_STATE_OK, HTTP_STATE_REDIRECT, MIN, parse_url(), config_item::port, config_item::request, string_to_time(), and strlcpy().

Referenced by fetch_thread().

void process_rss xmlNode *  root_node,
int  config_item_i
 

Definition at line 49 of file fetch.c.

References config, directory, execute(), find_in_file(), md5(), PATH_MAX, and replace_fields().

Referenced by fetch_thread().

time_t string_to_time char *  data  ) 
 

Definition at line 109 of file fetch.c.

Referenced by process_header().


Generated on Fri May 26 08:40:18 2006 for RSSbgr by doxygen 1.3.6