Allow to bind to multiple separate addresses.
[privoxy.git] / project.h
index 4eb8908..d44eed4 100644 (file)
--- a/project.h
+++ b/project.h
@@ -1,7 +1,7 @@
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
 /** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.165 2011/06/23 14:01:01 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.169 2011/07/08 13:30:08 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
@@ -187,12 +187,6 @@ typedef int jb_err;
  */
 #define CGI_PARAM_LEN_MAX 500U
 
-/**
- * Minimum length which a buffer has to reach before
- * Privoxy bothers to (re-)compress it. Completely arbitrary.
- */
-#define LOWER_LENGTH_LIMIT_FOR_COMPRESSION 1024U
-
 /**
  * Buffer size for capturing struct hostent data in the
  * gethostby(name|addr)_r library calls. Since we don't
@@ -849,6 +843,12 @@ struct reusable_connection
  */
 #define MAX_AF_FILES 10
 
+/**
+ * Maximum number of sockets to listen to.  This limit is arbitrary - it's just used
+ * to size an array.
+ */
+#define MAX_LISTENING_SOCKETS 10
+
 /**
  * The state of a Privoxy processing thread.
  */
@@ -1196,6 +1196,9 @@ struct access_control_list
 /** configuration_spec::feature_flags: Pages blocked with +handle-as-empty-doc get a return status of 200 OK. */
 #define RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK       512U
 
+/** configuration_spec::feature_flags: Buffered content is sent compressed if the client supports it. */
+#define RUNTIME_FEATURE_COMPRESSION               1024U
+
 /**
  * Data loaded from the configuration file.
  *
@@ -1262,11 +1265,11 @@ struct configuration_spec
    /** The hostname to show on CGI pages, or NULL to use the real one. */
    const char *hostname;
 
-   /** IP address to bind to.  Defaults to HADDR_DEFAULT == 127.0.0.1. */
-   const char *haddr;
+   /** IP addresses to bind to.  Defaults to HADDR_DEFAULT == 127.0.0.1. */
+   const char *haddr[MAX_LISTENING_SOCKETS];
 
-   /** Port to bind to.  Defaults to HADDR_PORT == 8118. */
-   int         hport;
+   /** Ports to bind to.  Defaults to HADDR_PORT == 8118. */
+   int         hport[MAX_LISTENING_SOCKETS];
 
    /** Size limit for IOB */
    size_t buffer_limit;
@@ -1311,6 +1314,10 @@ struct configuration_spec
    unsigned int default_server_timeout;
 #endif
 
+#ifdef FEATURE_COMPRESSION
+   int compression_level;
+#endif
+
    /** All options from the config file, HTML-formatted. */
    char *proxy_args;