small patch fixes beta12 bugs

From: Duane Wessels <wessels>
Date: Fri, 07 Jun 96 09:30:10 -0700

Hi folks,

As a couple of people discovered, version 1.0.beta12 has a couple of
nasty bugs which can cause it to coredump rather quickly. This small
patch fixes them. It is also available as:
    http://www.nlanr.net/Squid/1.0.beta13/diff-1.0.beta12-1.0.beta13

Duane W.

(I even remembered to increment the version string!)

diff -Nru squid-1.0.beta12/ChangeLog squid-1.0.beta13/ChangeLog
--- squid-1.0.beta12/ChangeLog Thu Jun 6 21:43:24 1996
+++ squid-1.0.beta13/ChangeLog Fri Jun 7 09:06:49 1996
@@ -228,7 +228,7 @@
 
         - Fixed serious memory leak of MemObject->reply structures.
 
-Changes to squid-1.0.beta12:
+Changes to squid-1.0.beta12 (June 6, 1996):
 
         - Fixed problem when using udp_outgoing_addr where no ICP
           packets would be recieved because they were getting sent
@@ -249,3 +249,9 @@
         - Changed handling of IMS requests. Now will return "304
           Not Modified" if the requested object is in the cache
           and not expired.
+
+Changes to squid-1.0.beta13 (June 7, 1996):
+
+ - Fixed coredump bug where StoreEntry key was free'd too soon.
+ - Fixed UDP_HIT_OBJ bug: cancel the hierarchy timeout and set
+ the ping_status to DONE for UDP_HIT_OBJ replies.
diff -Nru squid-1.0.beta12/include/version.h squid-1.0.beta13/include/version.h
--- squid-1.0.beta12/include/version.h Tue Jun 4 15:15:03 1996
+++ squid-1.0.beta13/include/version.h Fri Jun 7 09:12:30 1996
@@ -1,7 +1,7 @@
-/* $Id: version.h,v 1.19.4.11 1996/06/04 22:15:03 wessels Exp $
+/* $Id: version.h,v 1.19.4.12 1996/06/07 16:12:30 wessels Exp $
  *
  * SQUID_VERSION - String for version id of this distribution
  */
 #ifndef SQUID_VERSION
-#define SQUID_VERSION "1.0.beta12"
+#define SQUID_VERSION "1.0.beta13"
 #endif
diff -Nru squid-1.0.beta12/src/ftpget.c squid-1.0.beta13/src/ftpget.c
--- squid-1.0.beta12/src/ftpget.c Tue Jun 4 13:41:01 1996
+++ squid-1.0.beta13/src/ftpget.c Fri Jun 7 09:00:46 1996
@@ -1,4 +1,4 @@
-/* $Id: ftpget.c,v 1.23.2.44 1996/06/04 20:41:01 wessels Exp $ */
+/* $Id: ftpget.c,v 1.23.2.45 1996/06/07 16:00:46 wessels Exp $ */
 
 /*
  * NOTES
@@ -2289,9 +2289,9 @@
             log_errno2(__FILE__, __LINE__, "fcntl F_GETFL");
 #ifdef O_NONBLOCK
         flags &= ~O_NONBLOCK;
-#else
- ifdef O_NDELAY
- flags &= ~O_NDELAY;
+#endif
+#ifdef O_NDELAY
+ flags &= ~O_NDELAY;
 #endif
         if (fcntl(c, F_SETFL, flags) < 0)
             log_errno2(__FILE__, __LINE__, "fcntl F_SETFL");
diff -Nru squid-1.0.beta12/src/neighbors.c squid-1.0.beta13/src/neighbors.c
--- squid-1.0.beta12/src/neighbors.c Thu Jun 6 15:29:46 1996
+++ squid-1.0.beta13/src/neighbors.c Fri Jun 7 09:06:04 1996
@@ -1,4 +1,4 @@
-/* $Id: neighbors.c,v 1.22.2.26 1996/06/06 22:29:46 wessels Exp $ */
+/* $Id: neighbors.c,v 1.22.2.27 1996/06/07 16:06:04 wessels Exp $ */
 
 /*
  * DEBUG: Section 15 neighbors:
@@ -580,7 +580,8 @@
             debug(15, 0, "Too late UDP_HIT_OBJ '%s'?\n", entry->url);
             return;
         }
- /* ACK, how to parse headers? */
+ protoCancelTimeout(0, entry);
+ entry->ping_status = PING_DONE;
         httpState = xcalloc(1, sizeof(HttpStateData));
         httpState->entry = entry;
         httpProcessReplyHeader(httpState, data, data_sz);
diff -Nru squid-1.0.beta12/src/proto.c squid-1.0.beta13/src/proto.c
--- squid-1.0.beta12/src/proto.c Thu Jun 6 15:29:47 1996
+++ squid-1.0.beta13/src/proto.c Fri Jun 7 09:10:22 1996
@@ -1,4 +1,4 @@
-/* $Id: proto.c,v 1.27.2.32 1996/06/06 22:29:47 wessels Exp $ */
+/* $Id: proto.c,v 1.27.2.33 1996/06/07 16:10:22 wessels Exp $ */
 
 /*
  * DEBUG: Section 17 proto:
@@ -292,7 +292,7 @@
     return 1;
 }
 
-static void protoCancelTimeout(fd, entry)
+void protoCancelTimeout(fd, entry)
      int fd;
      StoreEntry *entry;
 {
diff -Nru squid-1.0.beta12/src/proto.h squid-1.0.beta13/src/proto.h
--- squid-1.0.beta12/src/proto.h Wed Jun 5 14:42:36 1996
+++ squid-1.0.beta13/src/proto.h Fri Jun 7 09:10:23 1996
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.7.2.7 1996/06/05 21:42:36 wessels Exp $ */
+/* $Id: proto.h,v 1.7.2.8 1996/06/07 16:10:23 wessels Exp $ */
 
 #ifndef PROTO_H
 #define PROTO_H
@@ -187,6 +187,7 @@
 extern int protoUndispatch _PARAMS((int, char *, StoreEntry *, request_t *));
 extern int getFromDefaultSource _PARAMS((int, StoreEntry *));
 extern int getFromCache _PARAMS((int, StoreEntry *, edge *, request_t *));
+extern void protoCancelTimeout _PARAMS((int fd, StoreEntry *));
 
 #define DIRECT_NO 0
 #define DIRECT_MAYBE 1
diff -Nru squid-1.0.beta12/src/store.c squid-1.0.beta13/src/store.c
--- squid-1.0.beta12/src/store.c Thu Jun 6 15:29:50 1996
+++ squid-1.0.beta13/src/store.c Fri Jun 7 09:01:10 1996
@@ -1,5 +1,5 @@
 
-/* $Id: store.c,v 1.61.4.50 1996/06/06 22:29:50 wessels Exp $ */
+/* $Id: store.c,v 1.61.4.51 1996/06/07 16:01:10 wessels Exp $ */
 
 /*
  * DEBUG: Section 20 store
@@ -171,14 +171,14 @@
     debug(20, 3, "destroy_StoreEntry: destroying %p\n", e);
     if (!e)
         fatal_dump("destroy_StoreEntry: NULL Entry");
+ if (e->mem_obj)
+ destroy_MemObject(e->mem_obj);
     meta_data.url_strings -= strlen(e->url);
     safe_free(e->url);
     if (BIT_TEST(e->flag, KEY_URL))
         e->key = NULL;
     else
         safe_free(e->key);
- if (e->mem_obj)
- destroy_MemObject(e->mem_obj);
     xfree(e);
     meta_data.store_entries--;
 }
Received on Fri Jun 07 1996 - 09:30:10 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:32:29 MST