Update the 'important changes' section.
[privoxy.git] / project.h
index 0cf9880..65bd400 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.155 2010/04/12 16:51:31 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.159 2010/09/03 17:38:20 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
 /* Needed for pcre choice */
 #include "config.h"
 
-#ifdef HAVE_RFC2553
 /* Need for struct sockaddr_storage */
-#include <sys/socket.h>
+#ifdef HAVE_RFC2553
+#  ifndef _WIN32
+#    include <netdb.h>
+#    include <sys/socket.h>
+#  else
+#    include <stdint.h>
+#    include <winsock2.h>
+#    include <ws2tcpip.h>
+     typedef unsigned short in_port_t;
+#  endif
 #endif
 
 
@@ -329,15 +337,15 @@ enum crunch_reason
  */
 struct http_response
 {
-  char  *status;          /**< HTTP status (string). */
-  struct list headers[1]; /**< List of header lines. */
-  char  *head;            /**< Formatted http response head. */
-  size_t head_length;     /**< Length of http response head. */
-  char  *body;            /**< HTTP document body. */
-  size_t content_length;  /**< Length of body, REQUIRED if binary body. */
-  int    is_static;       /**< Nonzero if the content will never change and
-                               should be cached by the browser (e.g. images). */
   enum crunch_reason crunch_reason; /**< Why the response was generated in the first place. */
+  char  *status;                    /**< HTTP status (string). */
+  struct list headers[1];           /**< List of header lines. */
+  char  *head;                      /**< Formatted http response head. */
+  size_t head_length;               /**< Length of http response head. */
+  char  *body;                      /**< HTTP document body. */
+  size_t content_length;            /**< Length of body, REQUIRED if binary body. */
+  int    is_static;                 /**< Nonzero if the content will never change and
+                                         should be cached by the browser (e.g. images). */
 };
 
 /**
@@ -914,11 +922,17 @@ struct client_state
     * or NULL. Currently only used for socks errors.
     */
    char *error_message;
-
-   /** Next thread in linked list. Only read or modify from the main thread! */
-   struct client_state *next;
 };
 
+/**
+ * List of client states so the main thread can keep
+ * track of them and garbage collect their resources.
+ */
+struct client_states
+{
+   struct client_states *next;
+   struct client_state csp;
+};
 
 /**
  * A function to add a header
@@ -1058,12 +1072,14 @@ struct forward_spec
 #define FORWARD_SPEC_INITIALIZER { { URL_SPEC_INITIALIZER }, 0, NULL, 0, NULL, 0, NULL }
 
 /* Supported filter types */
-#define FT_CONTENT_FILTER       0
-#define FT_CLIENT_HEADER_FILTER 1
-#define FT_SERVER_HEADER_FILTER 2
-#define FT_CLIENT_HEADER_TAGGER 3
-#define FT_SERVER_HEADER_TAGGER 4
-
+enum filter_type
+{
+   FT_CONTENT_FILTER       = 0,
+   FT_CLIENT_HEADER_FILTER = 1,
+   FT_SERVER_HEADER_FILTER = 2,
+   FT_CLIENT_HEADER_TAGGER = 3,
+   FT_SERVER_HEADER_TAGGER = 4,
+};
 #define MAX_FILTER_TYPES        5
 
 /**
@@ -1078,7 +1094,7 @@ struct re_filterfile_spec
    char *description;               /**< Description from FILTER: statement in re_filterfile. */
    struct list patterns[1];         /**< The patterns from the re_filterfile. */
    pcrs_job *joblist;               /**< The resulting compiled pcrs_jobs. */
-   int type;                        /**< Filter type (content, client-header, server-header). */
+   enum filter_type type;           /**< Filter type (content, client-header, server-header). */
    int dynamic;                     /**< Set to one if the pattern might contain variables
                                          and has to be recompiled for every request. */
    struct re_filterfile_spec *next; /**< The pointer for chaining. */