3 /*********************************************************************
5 * File : $Source: /cvsroot/ijbswa/current/jcc.h,v $
7 * Purpose : Main file. Contains main() method, main loop, and
8 * the main connection-handling function.
10 * Copyright : Written by and Copyright (C) 2001-2014 the
11 * Privoxy team. https://www.privoxy.org/
13 * Based on the Internet Junkbuster originally written
14 * by and Copyright (C) 1997 Anonymous Coders and
15 * Junkbusters Corporation. http://www.junkbusters.com
17 * This program is free software; you can redistribute it
18 * and/or modify it under the terms of the GNU General
19 * Public License as published by the Free Software
20 * Foundation; either version 2 of the License, or (at
21 * your option) any later version.
23 * This program is distributed in the hope that it will
24 * be useful, but WITHOUT ANY WARRANTY; without even the
25 * implied warranty of MERCHANTABILITY or FITNESS FOR A
26 * PARTICULAR PURPOSE. See the GNU General Public
27 * License for more details.
29 * The GNU General Public License should be included with
30 * this file. If not, you can view it at
31 * http://www.gnu.org/copyleft/gpl.html
32 * or write to the Free Software Foundation, Inc., 59
33 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
35 *********************************************************************/
41 /* Global variables */
43 #ifdef FEATURE_STATISTICS
45 extern int urls_rejected;
46 #endif /*def FEATURE_STATISTICS*/
48 extern struct client_states clients[1];
49 extern struct file_list files[1];
52 extern const char *pidfile;
54 extern int daemon_mode;
56 #ifdef FEATURE_GRACEFUL_TERMINATION
57 extern int g_terminate;
60 #if defined(FEATURE_PTHREAD) || defined(_WIN32)
61 #define MUTEX_LOCKS_AVAILABLE
63 #ifdef FEATURE_PTHREAD
66 typedef pthread_mutex_t privoxy_mutex_t;
70 typedef CRITICAL_SECTION privoxy_mutex_t;
74 extern void privoxy_mutex_lock(privoxy_mutex_t *mutex);
75 extern void privoxy_mutex_unlock(privoxy_mutex_t *mutex);
77 extern privoxy_mutex_t log_mutex;
78 extern privoxy_mutex_t log_init_mutex;
79 extern privoxy_mutex_t connection_reuse_mutex;
81 #ifdef FEATURE_EXTERNAL_FILTERS
82 extern privoxy_mutex_t external_filter_mutex;
85 #ifdef FEATURE_CLIENT_TAGS
86 extern privoxy_mutex_t client_tags_mutex;
89 #ifdef FEATURE_EXTENDED_STATISTICS
90 extern privoxy_mutex_t filter_statistics_mutex;
91 extern privoxy_mutex_t block_statistics_mutex;
95 extern privoxy_mutex_t gmtime_mutex;
96 #endif /* ndef HAVE_GMTIME_R */
98 #ifndef HAVE_LOCALTIME_R
99 extern privoxy_mutex_t localtime_mutex;
100 #endif /* ndef HAVE_GMTIME_R */
102 #if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_GETHOSTBYNAME_R)
103 extern privoxy_mutex_t resolver_mutex;
104 #endif /* !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_GETHOSTBYNAME_R) */
107 extern privoxy_mutex_t rand_mutex;
108 #endif /* ndef HAVE_RANDOM */
110 #ifdef FEATURE_HTTPS_INSPECTION
111 extern privoxy_mutex_t certificate_mutex;
112 extern privoxy_mutex_t rng_mutex;
115 #endif /* FEATURE_PTHREAD */
120 int real_main(int argc, char **argv);
122 int main(int argc, char **argv);
126 extern int fuzz_client_request(struct client_state *csp, char *fuzz_input_file);
127 extern int fuzz_server_response(struct client_state *csp, char *fuzz_input_file);
128 extern int fuzz_chunked_transfer_encoding(struct client_state *csp, char *fuzz_input_file);
131 #endif /* ndef JCC_H_INCLUDED */