pconn-banger.c File Reference
#include "squid.h"
Include dependency graph for pconn-banger.c:

Go to the source code of this file.

Classes

struct  _r
 

Macros

#define PROXY_PORT   "3128"
 
#define PROXY_ADDR   "127.0.0.1"
 
#define MAX_FDS   1024
 
#define READ_BUF_SZ   4096
 
#define min(x, y)   ((x)<(y)? (x) : (y))
 
#define REPLY_HDR_SZ   8192
 

Functions

char * mkrfc850 (time_t *t)
 
char * mime_headers_end (const char *mime)
 
void sig_intr (int sig)
 
int open_http_socket (void)
 
int send_request (int fd, const char *data)
 
static int get_header_int_value (const char *hdr, const char *buf, const char *end)
 
static const char * get_header_string_value (const char *hdr, const char *buf, const char *end)
 
void request_done (struct _r *r)
 
int handle_read (char *inbuf, int len)
 
int read_reply (int fd)
 
void main_loop (void)
 
void usage (void)
 
int main (int argc, argv)
 

Variables

static int proxy_port = PROXY_PORT
 
static char * proxy_addr = PROXY_ADDR
 
static char * progname
 
static int noutstanding = 0
 
static int done_reading_urls = 0
 
static int opt_ims = 0
 
static int opt_checksum = 0
 
static int opt_reopen = 1
 
static int max_outstanding = 10
 
static time_t lifetime = 60
 
static const char *const crlf = "\r\n"
 
static int trace_fd = -1
 
static int total_bytes_read = 0
 
static struct _rRequests
 

Macro Definition Documentation

#define MAX_FDS   1024

Definition at line 56 of file pconn-banger.c.

#define min (   x,
 
)    ((x)<(y)? (x) : (y))

Definition at line 58 of file pconn-banger.c.

Referenced by handle_read().

#define PROXY_ADDR   "127.0.0.1"

Definition at line 55 of file pconn-banger.c.

#define PROXY_PORT   "3128"

Definition at line 54 of file pconn-banger.c.

#define READ_BUF_SZ   4096

Definition at line 57 of file pconn-banger.c.

Referenced by handle_read(), and read_reply().

#define REPLY_HDR_SZ   8192

Definition at line 74 of file pconn-banger.c.

Referenced by handle_read().

Function Documentation

static int get_header_int_value ( const char *  hdr,
const char *  buf,
const char *  end 
)
static

Definition at line 246 of file pconn-banger.c.

References crlf, and xisspace.

Referenced by handle_read().

static const char* get_header_string_value ( const char *  hdr,
const char *  buf,
const char *  end 
)
static

Definition at line 261 of file pconn-banger.c.

References crlf, NULL, and xisspace.

Referenced by handle_read().

char* mime_headers_end ( const char *  mime)

Definition at line 103 of file pconn-banger.c.

References NULL.

Referenced by handle_read().

char* mkrfc850 ( time_t *  t)

Definition at line 92 of file pconn-banger.c.

References buf.

Referenced by request(), and send_request().

int read_reply ( int  fd)

Definition at line 411 of file pconn-banger.c.

References buf, handle_read(), len, and READ_BUF_SZ.

Referenced by main_loop().

void request_done ( struct _r r)
int send_request ( int  fd,
const char *  data 
)

Definition at line 157 of file pconn-banger.c.

References buf, len, method, mkrfc850(), _r::next, noutstanding, NULL, opt_ims, size, _r::url, _r::validsize, _r::validsum, and xstrdup.

Referenced by main_loop().

void sig_intr ( int  sig)

Definition at line 122 of file pconn-banger.c.

References done_reading_urls.

Referenced by main().

void usage ( void  )

Definition at line 551 of file pconn-banger.c.

References progname.

Referenced by main().

Variable Documentation

const char* const crlf = "\r\n"
static

Definition at line 70 of file pconn-banger.c.

Referenced by get_header_int_value(), and get_header_string_value().

int done_reading_urls = 0
static

Definition at line 64 of file pconn-banger.c.

Referenced by main_loop(), and sig_intr().

time_t lifetime = 60
static

Definition at line 69 of file pconn-banger.c.

Referenced by main().

int max_outstanding = 10
static

Definition at line 68 of file pconn-banger.c.

Referenced by main(), and main_loop().

int noutstanding = 0
static

Definition at line 63 of file pconn-banger.c.

Referenced by handle_read(), main_loop(), and send_request().

int opt_checksum = 0
static

Definition at line 66 of file pconn-banger.c.

Referenced by handle_read(), main(), and request_done().

int opt_ims = 0
static

Definition at line 65 of file pconn-banger.c.

Referenced by main(), and send_request().

int opt_reopen = 1
static

Definition at line 67 of file pconn-banger.c.

Referenced by main(), and main_loop().

char* progname
static

Definition at line 62 of file pconn-banger.c.

Referenced by main(), and usage().

char* proxy_addr = PROXY_ADDR
static

Definition at line 61 of file pconn-banger.c.

Referenced by main(), and open_http_socket().

int proxy_port = PROXY_PORT
static

Definition at line 60 of file pconn-banger.c.

Referenced by main(), and open_http_socket().

struct _r* Requests
static

Definition at line 89 of file pconn-banger.c.

Referenced by handle_read(), and main_loop().

int total_bytes_read = 0
static

Definition at line 72 of file pconn-banger.c.

Referenced by handle_read(), and main_loop().

int trace_fd = -1
static

Definition at line 71 of file pconn-banger.c.

Referenced by handle_read(), and main().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors