Let IOB_RESET() take the iob to reset as argument
authorFabian Keil <fk@fabiankeil.de>
Sun, 21 Oct 2012 12:35:15 +0000 (12:35 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sun, 21 Oct 2012 12:35:15 +0000 (12:35 +0000)
This allows it to be used for iobs other than csp->iob.

filters.c
jcc.c
project.h

index 65308f5..ac35d4a 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -1,4 +1,4 @@
-const char filters_rcs[] = "$Id: filters.c,v 1.172 2012/06/08 15:15:11 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.173 2012/10/05 12:15:39 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
@@ -1692,7 +1692,7 @@ static char *pcrs_filter_response(struct client_state *csp)
 
    csp->flags |= CSP_FLAG_MODIFIED;
    csp->content_length = size;
 
    csp->flags |= CSP_FLAG_MODIFIED;
    csp->content_length = size;
-   IOB_RESET(csp);
+   IOB_RESET(csp->iob);
 
    return(new);
 
 
    return(new);
 
diff --git a/jcc.c b/jcc.c
index 7c58fec..294255c 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.389 2012/10/12 11:19:35 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.390 2012/10/21 12:30:37 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -1743,7 +1743,7 @@ static void chat(struct client_state *csp)
       {
          return;
       }
       {
          return;
       }
-      IOB_RESET(csp);
+      IOB_RESET(csp->iob);
    }
 
    log_error(LOG_LEVEL_CONNECT, "to %s successful", http->hostport);
    }
 
    log_error(LOG_LEVEL_CONNECT, "to %s successful", http->hostport);
index 45cf172..447d513 100644 (file)
--- a/project.h
+++ b/project.h
@@ -1,7 +1,7 @@
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
 /** Version string. */
 #ifndef PROJECT_H_INCLUDED
 #define PROJECT_H_INCLUDED
 /** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.182 2012/10/17 18:19:59 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 $
 /*********************************************************************
  *
  * 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.
  */
  * 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. */
 
 /* Bits for csp->content_type bitmask: */
 #define CT_TEXT    0x0001U /**< Suitable for pcrs filtering. */