]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Need a flag to know when to use cbdataFree() or safe_free() for an 'err'
authorwessels <>
Wed, 29 Oct 1997 04:54:28 +0000 (04:54 +0000)
committerwessels <>
Wed, 29 Oct 1997 04:54:28 +0000 (04:54 +0000)
structure

src/defines.h
src/errorpage.cc
src/structs.h

index 0f70c013982e3397b6a5e5270b743cd02f725cf5..9232886d3ccc3132f6f14a253e1b004e93b1598f 100644 (file)
 #define ERROR_BUF_SZ (MAX_URL << 2)
 #endif
 
+#define ERR_FLAG_CBDATA                0x01
+
 #define HTTP_PROXYING          (1<<0)
 #define HTTP_KEEPALIVE         (1<<1)
 
index 8d10d9f41cb69ca234fdfcdd230446551fa255ae..2f71470f3ac44cccfc7df6cdfc0f8701c4a1dc4a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: errorpage.cc,v 1.88 1997/10/28 20:42:50 wessels Exp $
+ * $Id: errorpage.cc,v 1.89 1997/10/28 21:54:30 wessels Exp $
  *
  * DEBUG: section 4     Error Generation
  * AUTHOR: Duane Wessels
@@ -93,7 +93,10 @@ errorStateFree(ErrorState * err)
     safe_free(err->redirect_url);
     safe_free(err->url);
     safe_free(err->host);
-    cbdataFree(err);
+    if (BIT_TEST(err->flags, ERR_FLAG_CBDATA))
+        cbdataFree(err);
+    else
+       safe_free(err);
 }
 
 #define CVT_BUF_SZ 512
@@ -261,6 +264,7 @@ errorSend(int fd, ErrorState * err)
     buf = errorBuildBuf(err, &len);
     cbdataAdd(err);
     cbdataLock(err);
+    BIT_SET(err->flags, ERR_FLAG_CBDATA);
     comm_write(fd, xstrdup(buf), len, errorSendComplete, err, xfree);
 }
 
index 830e184751d03195f823092738533ccb366f8a92..1e748e189e801179e8f5f613cdb6c553ff8d3d3b 100644 (file)
@@ -883,4 +883,5 @@ struct _ErrorState {
     char *redirect_url;
     ERCB *callback;
     void *callback_data;
+    int flags;
 };