File src/dinoex_http.c

* by Dirk Meyer (dinoex) * Copyright (C) 2004-2011 Dirk Meyer * * By using this file, you agree to the terms and conditions set * forth in the GNU General Public License. More information is * available in the LICENSE file. * * If you received this file without documentation, it can be * downloaded from http://iroffer.dinoex.net/ * * $Id: dinoex_http.c,v 1.161 2012/03/16 20:49:37 cvs Exp $ *


Included Files

include the headers


Preprocessor definitions

#define _LONGLONG 1

#define MAX_WEBLIST_SIZE

#define HTTP_DATE_LINE "%a, %d %b %Y %T GMT"


Typedef html_group_t

typedef struct {...} html_group_t
struct  
   {  
      const char* hg_group;  
      const char* hg_desc;  
      off_t hg_sizes;  
      off_t hg_traffic;  
      unsigned int hg_packs;  
      unsigned int hg_agets;  
      float hg_rgets;  
      float hg_dummy;  
   }  

Typedef http_magic_const_t

typedef struct {...} http_magic_const_t
struct  
   {  
      const char* m_ext;  
      const char* m_mime;  
   }  

Typedef http_special_t

typedef struct {...} http_special_t
struct  
   {  
      int s_ch;  
      int dummy;  
      const char* s_html;  
   }  

Typedef cmpfunc_t

typedef int (*cmpfunc_t)(const void* a,const void* b)

Local Variables

http_listen
static int http_listen[2U]
Used in: h_accept()  
  h_close_listen()  
  h_open_listen()  
  h_perform()  
  h_select_fdset()  
  h_setup_listen()  

http_family
static int http_family[2U]

Used in: h_accept()  
  h_open_listen()  
  h_setup_listen()  

http_header_status
NOTRANSLATE

static const char* http_header_status

Used in: h_write_status()  

http_header_notfound
NOTRANSLATE

static const char* http_header_notfound

Used in: h_herror_404()  

http_header_forbidden
NOTRANSLATE

static const char* http_header_forbidden

Used in: h_herror_403()  

http_header_admin
NOTRANSLATE

static const char* http_header_admin

Used in: h_parse()  

htpp_auth_key
NOTRANSLATE

static const char* htpp_auth_key

Used in: h_admin_auth()  

http_magic
NOTRANSLATE

static const http_magic_const_t http_magic[]

Used in: html_mime()  

http_special
NOTRANSLATE

static const http_special_t http_special[]

Used in: html_decode()  
  html_encode()  
  html_encode_size()  

HEX_NIBBLE
NOTRANSLATE

static const unsigned char HEX_NIBBLE[]

Used in: url_encode()  

BASE64
BASE 64
| b64 | b64 | b64 | b64 | | octect1 | octect2 | octect3 | NOTRANSLATE

static const unsigned char BASE64[]

Used in: init_base64decode()  

base64decode
static unsigned char base64decode[256]

Used in: b64decode_quartet()  
  init_base64decode()  

html_link_start
static int html_link_start

Used in: html_link_build()  
  html_link_option()  

Global Function h_close_listen()

close all HTTP interfaces

void h_close_listen ( void )

Prototyped in: src/dinoex_http.h
Calls: event_close() src/dinoex_kqueue.c
Called by: h_reash_listen() src/dinoex_http.c
  shutdown_dinoex() src/dinoex_misc.c
References Variables: http_listen src/dinoex_http.c

Global Function h_perform()

process all HTTP connections

void h_perform ( int changesec, int changequartersec )

Prototyped in: src/dinoex_http.h
Calls: h_accept() src/dinoex_http.c
  h_get() src/dinoex_http.c
  h_istimeout() src/dinoex_http.c
  h_post() src/dinoex_http.c
  h_send() src/dinoex_http.c
  irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
Called by: mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c
  http_listen src/dinoex_http.c

Global Function h_reash_listen()

close and setup all HTTP interfaces

void h_reash_listen ( void )

Prototyped in: src/dinoex_http.h
Calls: h_close_listen() src/dinoex_http.c
  h_setup_listen() src/dinoex_http.c
Called by: rehash_dinoex() src/dinoex_misc.c
References Variables: gdata src/dinoex_main.c

Global Function h_select_fdset()

register active connections for select()

int h_select_fdset ( int highests, int changequartersec )

Prototyped in: src/dinoex_http.h
Calls: irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
Called by: mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c
  http_listen src/dinoex_http.c

Global Function h_setup_listen()

setup all HTTP interfaces

unsigned int h_setup_listen ( void )

Prototyped in: src/dinoex_http.h
Calls: h_open_listen() src/dinoex_http.c
  updatecontext_f() src/iroffer_utilities.c
Called by: config_dinoex() src/dinoex_misc.c
  h_reash_listen() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c
  http_family src/dinoex_http.c
  http_listen src/dinoex_http.c

Global Function init_base64decode()

create a table for fast base64 decoding

void init_base64decode ( void )

Prototyped in: src/dinoex_http.h
Calls: memset()
Called by: startup_dinoex() src/dinoex_misc.c
References Variables: BASE64 src/dinoex_http.c
  base64decode src/dinoex_http.c

Local Function b64decode_quartet()

static void b64decode_quartet ( unsigned char* decoded, const unsigned char* coded )
Called by: b64decode_string() src/dinoex_http.c
References Variables: base64decode src/dinoex_http.c

Local Function b64decode_string()

static char* b64decode_string ( const char* coded )
Calls: b64decode_quartet() src/dinoex_http.c
  mymalloc2() src/iroffer_utilities.c
  strlen()
Called by: h_admin_auth() src/dinoex_http.c

Local Function get_host()

static const char* get_host ( http* const h )
Calls: html_str_split() src/dinoex_http.c
Called by: h_access_log() src/dinoex_http.c

Local Function get_url_number()

static int get_url_number ( const char* url, const char* key )
Calls: get_url_param() src/dinoex_http.c
  mydelete2() src/iroffer_utilities.c
  atoi()
Called by: h_webliste() src/dinoex_http.c

Local Function get_url_param()

static char* get_url_param ( const char* url, const char* key )
Calls: html_decode() src/dinoex_http.c
  html_str_split() src/dinoex_http.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  strcasestr(), strlen()
Called by: get_url_number() src/dinoex_http.c
  h_webliste() src/dinoex_http.c

Local Function gets_per_pack()

static float gets_per_pack ( unsigned int agets, unsigned int packs )
Called by: h_html_main() src/dinoex_http.c

Local Function h_accept()

static void h_accept ( unsigned int i )
Calls: get_port() src/dinoex_utilities.c
  h_closeconn() src/dinoex_http.c
  h_herror_403() src/dinoex_http.c
  ioutput() src/iroffer_utilities.c
  irlist_add2() src/iroffer_utilities.c
  irlist_size() src/iroffer_utilities.c
  is_in_badip() src/dinoex_badip.c
  my_getnameinfo() src/dinoex_irc.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  outerror() src/iroffer_utilities.c
  set_socket_nonblocking() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  verify_cidr() src/dinoex_misc.c
  __error(), accept(), strerror()
Called by: h_perform() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c
  http_family src/dinoex_http.c
  http_listen src/dinoex_http.c

Local Function h_access_log()

static void h_access_log ( http* const h )
Calls: get_host() src/dinoex_http.c
  http_access_log_add() src/dinoex_http.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  localtime(), snprintf(), strftime()
Called by: h_closeconn() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_admin()

static void h_admin ( http* const h, unsigned int UNUSED_level, const char* UNUSED_body )
Calls: get_xdcc_pack() src/dinoex_misc.c
  getfilename() src/dinoex_utilities.c
  h_herror_404() src/dinoex_http.c
  h_prepare_footer() src/dinoex_http.c
  h_prepare_header() src/dinoex_http.c
  h_readfile() src/dinoex_http.c
  h_respond() src/dinoex_http.c
  ioutput() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  atoi(), snprintf(), strcasecmp(), strchr(), strncasecmp()
Called by: h_admin_auth() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_admin_auth()

static unsigned int h_admin_auth ( http* const h, char* body )
Calls: b64decode_string() src/dinoex_http.c
  h_admin() src/dinoex_http.c
  html_str_prefix() src/dinoex_http.c
  html_str_split() src/dinoex_http.c
  mydelete2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  verifypass2() src/dinoex_utilities.c
  strcasecmp(), strcasestr(), strlen()
Called by: h_parse() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c
  htpp_auth_key src/dinoex_http.c

Local Function h_bad_request()

static char* h_bad_request ( http* const h )
Calls: html_decode() src/dinoex_http.c
  html_str_split() src/dinoex_http.c
  mymalloc2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  strcasecmp(), strlen()
Called by: h_get() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_bandwith()

static int h_bandwith ( http* const h )
Called by: h_send() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_closeconn()

connections

static void h_closeconn ( http* const h, const char* msg, int errno1 )

Calls: h_access_log() src/dinoex_http.c
  ioutput() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  shutdown_close() src/dinoex_kqueue.c
  updatecontext_f() src/iroffer_utilities.c
  close(), strerror()
Called by: h_accept() src/dinoex_http.c
  h_get() src/dinoex_http.c
  h_istimeout() src/dinoex_http.c
  h_read_http() src/dinoex_http.c
  h_send() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_error()

static void h_error ( http* const h, const char* header )
Calls: h_start_sending() src/dinoex_http.c
  h_write_header() src/dinoex_http.c
  updatecontext_f() src/iroffer_utilities.c
Called by: h_herror_403() src/dinoex_http.c
  h_herror_404() src/dinoex_http.c
  h_parse() src/dinoex_http.c

Local Function h_get()

static void h_get ( http* const h )
Calls: h_bad_request() src/dinoex_http.c
  h_closeconn() src/dinoex_http.c
  h_parse() src/dinoex_http.c
  h_read_http() src/dinoex_http.c
  html_str_split() src/dinoex_http.c
  mystrdup2() src/dinoex_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  strcmp(), strtok()
Called by: h_perform() src/dinoex_http.c

Local Function h_guess_weblist()

static size_t h_guess_weblist ( http* const h )
Calls: html_encode_size() src/dinoex_http.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  save_nick() src/dinoex_utilities.c
  strlen()
Called by: h_webliste() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_herror_403()

static void h_herror_403 ( http* const h, const char* msg )
Calls: h_error() src/dinoex_http.c
  h_readfile() src/dinoex_http.c
  ioutput() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  snprintf()
Called by: h_accept() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c
  http_header_forbidden src/dinoex_http.c

Local Function h_herror_404()

static void h_herror_404 ( http* const h )
Calls: h_error() src/dinoex_http.c
Called by: h_admin() src/dinoex_http.c
  h_parse() src/dinoex_http.c
  h_readfile() src/dinoex_http.c
References Variables: http_header_notfound src/dinoex_http.c

Local Function h_html_file()

static void h_html_file ( http* const h )
Calls: h_html_filter_group() src/dinoex_http.c
  h_html_link_group() src/dinoex_http.c
  h_html_search() src/dinoex_http.c
  h_respond() src/dinoex_http.c
  hide_pack() src/dinoex_misc.c
  html_encode() src/dinoex_http.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  number_of_pack() src/dinoex_misc.c
  sizestr() src/dinoex_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  user_getdatestr() src/dinoex_utilities.c
  snprintf(), strlen()
Called by: h_html_index() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_html_filter_group()

static unsigned int h_html_filter_group ( http* const h, xdcc* xd )
Calls: fnmatch(), strcasecmp(), strcmp()
Called by: h_html_file() src/dinoex_http.c

Local Function h_html_index()

static void h_html_index ( http* const h )
Calls: clean_quotes() src/dinoex_utilities.c
  get_current_bandwidth() src/dinoex_misc.c
  h_html_file() src/dinoex_http.c
  h_html_main() src/dinoex_http.c
  h_html_weblist_info() src/dinoex_http.c
  h_respond() src/dinoex_http.c
  html_decode() src/dinoex_http.c
  html_encode() src/dinoex_http.c
  html_str_split() src/dinoex_http.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  pattern_decode() src/dinoex_http.c
  sizestr() src/dinoex_utilities.c
  slotsfree() src/dinoex_misc.c
  updatecontext_f() src/iroffer_utilities.c
  user_getdatestr() src/dinoex_utilities.c
  snprintf(), strlen()
Called by: h_webliste() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_html_link_group()

static char* h_html_link_group ( http* const h, const char* caption, const char* text, const char* group )
Calls: html_link_build() src/dinoex_http.c
Called by: h_html_file() src/dinoex_http.c
  h_html_main() src/dinoex_http.c

Local Function h_html_link_more()

static char* h_html_link_more ( http* const h, const char* caption, const char* text )
Calls: html_link_build() src/dinoex_http.c
Called by: h_html_main() src/dinoex_http.c

Local Function h_html_link_order()

static char* h_html_link_order ( http* const h, const char* caption, const char* text, const char* order )
Calls: html_link_build() src/dinoex_http.c
  mystrdup2() src/dinoex_utilities.c
  strcasecmp()
Called by: h_html_main() src/dinoex_http.c

Local Function h_html_main()

static void h_html_main ( http* const h )
Calls: gets_per_pack() src/dinoex_http.c
  h_html_link_group() src/dinoex_http.c
  h_html_link_more() src/dinoex_http.c
  h_html_link_order() src/dinoex_http.c
  h_html_search() src/dinoex_http.c
  h_respond() src/dinoex_http.c
  hide_pack() src/dinoex_misc.c
  html_encode() src/dinoex_http.c
  html_filter_main() src/dinoex_http.c
  html_order_func() src/dinoex_http.c
  irlist_add2() src/iroffer_utilities.c
  irlist_delete() src/iroffer_utilities.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  irlist_sort2() src/dinoex_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  sizestr() src/dinoex_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  snprintf()
Called by: h_html_index() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_html_search()

static void h_html_search ( http* const h )
Calls: h_respond() src/dinoex_http.c
Called by: h_html_file() src/dinoex_http.c
  h_html_main() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_html_weblist_info()

static void h_html_weblist_info ( http* const h, char* key, char* text )
Calls: getuptime() src/iroffer_utilities.c
  h_respond() src/dinoex_http.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  sizestr() src/dinoex_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  snprintf(), strcmp()
Called by: h_html_index() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_include()

static void h_include ( http* const h, const char* file )
Calls: ioutput() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  __error(), close(), fstat(), open(), read(), strerror()
Called by: h_prepare_footer() src/dinoex_http.c
  h_prepare_header() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_istimeout()

static void h_istimeout ( http* const h )
Calls: h_closeconn() src/dinoex_http.c
  updatecontext_f() src/iroffer_utilities.c
Called by: h_perform() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_open_listen()

static unsigned int h_open_listen ( unsigned int i )
Calls: ioutput() src/iroffer_utilities.c
  irlist_get_nth() src/iroffer_utilities.c
  my_getnameinfo() src/dinoex_irc.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  open_listen() src/dinoex_irc.c
  updatecontext_f() src/iroffer_utilities.c
Called by: h_setup_listen() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c
  http_family src/dinoex_http.c
  http_listen src/dinoex_http.c

Local Function h_parse()

static void h_parse ( http* const h, char* body )
Calls: count_badip() src/dinoex_badip.c
  h_admin_auth() src/dinoex_http.c
  h_error() src/dinoex_http.c
  h_herror_404() src/dinoex_http.c
  h_readfile() src/dinoex_http.c
  h_webliste() src/dinoex_http.c
  ioutput() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  snprintf(), strcasecmp(), strchr(), strcmp(), strncasecmp()
Called by: h_get() src/dinoex_http.c
  h_post() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c
  http_header_admin src/dinoex_http.c

Local Function h_parse_range()

static int h_parse_range ( http* const h )
Calls: atoull() src/iroffer_utilities.c
  strchr(), strcmp()
Called by: h_write_status() src/dinoex_http.c

Local Function h_post()

static void h_post ( http* const h )
Calls: h_parse() src/dinoex_http.c
  h_read_http() src/dinoex_http.c
Called by: h_perform() src/dinoex_http.c

Local Function h_prepare_footer()

static void h_prepare_footer ( http* const h )
Calls: h_include() src/dinoex_http.c
  h_readbuffer() src/dinoex_http.c
Called by: h_admin() src/dinoex_http.c
  h_webliste() src/dinoex_http.c

Local Function h_prepare_header()

static void h_prepare_header ( http* const h, size_t guess )
Calls: h_include() src/dinoex_http.c
  h_prepare_respond() src/dinoex_http.c
  h_stat() src/dinoex_http.c
Called by: h_admin() src/dinoex_http.c
  h_webliste() src/dinoex_http.c

Local Function h_prepare_respond()

static void h_prepare_respond ( http* const h, size_t guess )
Calls: mymalloc2() src/iroffer_utilities.c
Called by: h_prepare_header() src/dinoex_http.c

Local Function h_read_http()

static char* h_read_http ( http* const h )
Calls: h_closeconn() src/dinoex_http.c
  ioutput() src/iroffer_utilities.c
  is_fd_readable() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  __error(), recv()
Called by: h_get() src/dinoex_http.c
  h_post() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_readbuffer()

static void h_readbuffer ( http* const h )
Calls: h_start_sending() src/dinoex_http.c
  h_write_status() src/dinoex_http.c
  updatecontext_f() src/iroffer_utilities.c
  strlen()
Called by: h_prepare_footer() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_readfile()

static void h_readfile ( http* const h, const char* file )
Calls: h_herror_404() src/dinoex_http.c
  h_runruby() src/dinoex_http.c
  h_start_sending() src/dinoex_http.c
  h_write_status() src/dinoex_http.c
  ioutput() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  outerror() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  __error(), close(), fstat(), open(), strerror()
Called by: h_admin() src/dinoex_http.c
  h_herror_403() src/dinoex_http.c
  h_parse() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_respond()

print and ad text to send it to the htpp client

static void h_respond ( http* const h, const char* format, ... )

Calls: __builtin_va_end(), __builtin_va_start(), vsnprintf()
Called by: h_admin() src/dinoex_http.c
  h_html_file() src/dinoex_http.c
  h_html_index() src/dinoex_http.c
  h_html_main() src/dinoex_http.c
  h_html_search() src/dinoex_http.c
  h_html_weblist_info() src/dinoex_http.c

Local Function h_runruby()

static unsigned int h_runruby ( http* const h )
Calls: http_ruby_script() src/dinoex_ruby.c
  mydelete2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  mystrsuffix2() src/dinoex_utilities.c
  setenv(), strcasecmp(), strchr(), strrchr()
Called by: h_readfile() src/dinoex_http.c

Local Function h_send()

static void h_send ( http* const h )
Calls: h_bandwith() src/dinoex_http.c
  h_closeconn() src/dinoex_http.c
  ioutput() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  __error(), close(), lseek(), read(), send(), strerror()
Called by: h_perform() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_start_sending()

static void h_start_sending ( http* const h )
Calls: ioutput() src/iroffer_utilities.c
Called by: h_error() src/dinoex_http.c
  h_readbuffer() src/dinoex_http.c
  h_readfile() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_stat()

static off_t h_stat ( const char* path )
Calls: stat()
Called by: h_prepare_header() src/dinoex_http.c

Local Function h_webliste()

static void h_webliste ( http* const h, const char* body )
Calls: get_url_number() src/dinoex_http.c
  get_url_param() src/dinoex_http.c
  h_guess_weblist() src/dinoex_http.c
  h_html_index() src/dinoex_http.c
  h_prepare_footer() src/dinoex_http.c
  h_prepare_header() src/dinoex_http.c
  mydelete2() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
Called by: h_parse() src/dinoex_http.c

Local Function h_write_header()

static void h_write_header ( http* const h, const char* header )
Calls: mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  gmtime(), send(), snprintf(), strftime()
Called by: h_error() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c

Local Function h_write_status()

static void h_write_status ( http* const h, const char* mime, time_t* now )
Calls: h_parse_range() src/dinoex_http.c
  html_mime() src/dinoex_http.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  gmtime(), send(), snprintf(), strcmp(), strftime()
Called by: h_readbuffer() src/dinoex_http.c
  h_readfile() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c
  http_header_status src/dinoex_http.c

Local Function html_cmp_offset()

static int html_cmp_offset ( off_t diff )
Called by: html_order_size() src/dinoex_http.c
  html_order_tvol() src/dinoex_http.c

Local Function html_decode()

static size_t html_decode ( char* buffer, size_t max, const char* src )
Calls: sscanf(), strlen(), strncmp()
Called by: get_url_param() src/dinoex_http.c
  h_bad_request() src/dinoex_http.c
  h_html_index() src/dinoex_http.c
References Variables: http_special src/dinoex_http.c

Local Function html_encode()

static size_t html_encode ( char* buffer, size_t max, const char* src )
Calls: __isctype(), strlen(), strncpy()
Called by: h_html_file() src/dinoex_http.c
  h_html_index() src/dinoex_http.c
  h_html_main() src/dinoex_http.c
References Variables: http_special src/dinoex_http.c

Local Function html_encode_size()

static ssize_t html_encode_size ( const char* src )
Calls: __isctype(), strlen()
Called by: h_guess_weblist() src/dinoex_http.c
References Variables: http_special src/dinoex_http.c

Local Function html_filter_main()

static unsigned int html_filter_main ( xdcc* xd, const char* group )
Calls: strcasecmp(), strcmp()
Called by: h_html_main() src/dinoex_http.c

Local Function html_link_build()

static char* html_link_build ( const char* css, const char* caption, const char* text, const char* group, unsigned int traffic, const char* order )
Calls: html_link_option() src/dinoex_http.c
  mymalloc2() src/iroffer_utilities.c
  snprintf()
Called by: h_html_link_group() src/dinoex_http.c
  h_html_link_more() src/dinoex_http.c
  h_html_link_order() src/dinoex_http.c
References Variables: html_link_start src/dinoex_http.c

Local Function html_link_option()

static size_t html_link_option ( char* str, size_t size, const char* option, const char* val )
Calls: mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  url_encode() src/dinoex_http.c
  snprintf()
Called by: html_link_build() src/dinoex_http.c
References Variables: html_link_start src/dinoex_http.c

Local Function html_mime()

static const char* html_mime ( const char* file )
Calls: irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  strcasecmp(), strrchr()
Called by: h_write_status() src/dinoex_http.c
References Variables: gdata src/dinoex_main.c
  http_magic src/dinoex_http.c

Local Function html_order_func()

static cmpfunc_t html_order_func ( const char* order )
Calls: strcmp()
Called by: h_html_main() src/dinoex_http.c
References Functions: html_order_gets() src/dinoex_http.c
  html_order_group() src/dinoex_http.c
  html_order_pack() src/dinoex_http.c
  html_order_rget() src/dinoex_http.c
  html_order_size() src/dinoex_http.c
  html_order_tvol() src/dinoex_http.c

Local Function html_order_gets()

static int html_order_gets ( const void* a, const void* b )
Used in: html_order_func() src/dinoex_http.c

Local Function html_order_group()

static int html_order_group ( const void* a, const void* b )
Calls: strcmp()
Used in: html_order_func() src/dinoex_http.c

Local Function html_order_pack()

static int html_order_pack ( const void* a, const void* b )
Used in: html_order_func() src/dinoex_http.c

Local Function html_order_rget()

static int html_order_rget ( const void* a, const void* b )
Used in: html_order_func() src/dinoex_http.c

Local Function html_order_size()

static int html_order_size ( const void* a, const void* b )
Calls: html_cmp_offset() src/dinoex_http.c
Used in: html_order_func() src/dinoex_http.c

Local Function html_order_tvol()

static int html_order_tvol ( const void* a, const void* b )
Calls: html_cmp_offset() src/dinoex_http.c
Used in: html_order_func() src/dinoex_http.c

Local Function html_str_prefix()

static void html_str_prefix ( char** str, size_t len )
Calls: mydelete2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
Called by: h_admin_auth() src/dinoex_http.c

Local Function html_str_split()

static char* html_str_split ( char* buffer, int delimiter )
Calls: strchr()
Called by: get_host() src/dinoex_http.c
  get_url_param() src/dinoex_http.c
  h_admin_auth() src/dinoex_http.c
  h_bad_request() src/dinoex_http.c
  h_get() src/dinoex_http.c
  h_html_index() src/dinoex_http.c

Local Function http_access_log_add()

static void http_access_log_add ( const char* logfile, const char* line, size_t len )
Calls: mylog_close() src/dinoex_utilities.c
  mylog_write() src/dinoex_utilities.c
  open_append() src/dinoex_utilities.c
Called by: h_access_log() src/dinoex_http.c

Local Function pattern_decode()

static ssize_t pattern_decode ( char* buffer, size_t max, const char* src )
Called by: h_html_index() src/dinoex_http.c

Local Function url_encode()

static size_t url_encode ( char* buffer, size_t max, const char* src )
Calls: __isctype()
Called by: html_link_option() src/dinoex_http.c
References Variables: HEX_NIBBLE src/dinoex_http.c