Let IOB_RESET() take the iob to reset as argument
[privoxy.git] / project.h
index a8fc925..447d513 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.181 2012/10/17 18:19:29 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.183 2012/10/21 12:31:21 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/project.h,v $
@@ -422,7 +422,7 @@ struct iob
  * Remove any data in the I/O buffer associated with the passed
  * client_state pointer.
  */
-#define IOB_RESET(CSP) if(CSP->iob->buf) free(CSP->iob->buf); memset(CSP->iob, '\0', sizeof(CSP->iob));
+#define IOB_RESET(IOB) do {free(IOB->buf); memset(IOB, '\0', sizeof(*IOB));} while (0)
 
 /* Bits for csp->content_type bitmask: */
 #define CT_TEXT    0x0001U /**< Suitable for pcrs filtering. */
@@ -639,6 +639,16 @@ struct url_actions
    struct url_actions *next;   /**< Next action section in file, or NULL. */
 };
 
+enum forwarder_type {
+   /**< Don't use a SOCKS server               */
+   SOCKS_NONE =  0,
+   /**< original SOCKS 4 protocol              */
+   SOCKS_4    = 40,
+   /**< SOCKS 4A, DNS resolution is done by the SOCKS server */
+   SOCKS_4A   = 41,
+   /**< SOCKS 5 with hostnames, DNS resolution is done by the SOCKS server */
+   SOCKS_5    = 50,
+};
 
 /*
  * Structure to hold the server socket and the information
@@ -662,7 +672,7 @@ struct reusable_connection
 
    char *host;
    int  port;
-   int  forwarder_type;
+   enum forwarder_type forwarder_type;
    char *gateway_host;
    int  gateway_port;
    char *forward_host;
@@ -1048,17 +1058,6 @@ struct block_spec
 
 #endif /* def FEATURE_TRUST */
 
-enum forwarder_type {
-   /**< Don't use a SOCKS server               */
-   SOCKS_NONE =  0,
-   /**< original SOCKS 4 protocol              */
-   SOCKS_4    = 40,
-   /**< SOCKS 4A, DNS resolution is done by the SOCKS server */
-   SOCKS_4A   = 41,
-   /**< SOCKS 5 with hostnames, DNS resolution is done by the SOCKS server */
-   SOCKS_5    = 50,
-};
-
 /**
  * How to forward a connection to a parent proxy.
  */