-
Notifications
You must be signed in to change notification settings - Fork 1
/
mini_httpd.h
70 lines (66 loc) · 2.28 KB
/
mini_httpd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Copyright (C) 2000,2001 Florian Sander
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#define HTTPD_VERSION "1.1.0"
static void process_get_request(int);
struct http_connection_data {
int traffic;
int code;
char *browser;
char *referer;
char *path;
char *cmd;
char *postparams;
int getpostparams;
int content_length;
struct llist_2string *cookies;
struct llist_2string *params;
struct llist_1string *headers;
struct llist_1string *langs;
};
static void init_httpd();
static int expmem_httpd();
static void unload_httpd();
static void start_httpd(int);
static void stop_httpd();
static void init_http_connection_data(int);
static void free_http_connection_data(int);
static void http_activity(int, char *, int);
static void send_http_header(int, int);
static void add_cookies(int, char *);
static char *get_cookie_value(int, char *);
static void add_params(int, char *);
static char *get_param_value(int, char *);
#ifndef OLDBOT
static void outdone_http(int);
#endif
static void display_http(int, char *);
static void display_httpd_accept(int, char *);
static void timeout_http(int);
static void timeout_listen_httpd(int);
static void kill_http(int, void *);
static int expmem_http(void *);
static void out_http(int, char *, void *);
static void httpd_accept(int, char *, int);
static int http_flood();
static void eof_http(int);
static char *decode_url(char *);
static char *encode_url(char *);
static char *csplit(char **, char);
static void append_postparam_string(int, char *);
static void process_request(int);
static void add_language(int, char *);