]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
This change should fix bug #1829.
authorrousskov <>
Thu, 12 Apr 2007 23:56:39 +0000 (23:56 +0000)
committerrousskov <>
Thu, 12 Apr 2007 23:56:39 +0000 (23:56 +0000)
The DiskdFile::close function calls the DiskdIOStrategy::send function and
consequently the DiskdIOStrategy::SEND function, with shm_offset value of -1.
If the msgsnd in SEND fails, the SharedMemory::put function is called with
offset=-1, triggering an abort.

Patch by Christos Tsantilas. Reviewed by Guido Serassio and Duane Wessels.

src/DiskIO/DiskDaemon/DiskdIOStrategy.cc

index 60441a636baaf6675092217d990928b178e3a339..6e73855a48e07d2f6932509e85761c9374fdb4c4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: DiskdIOStrategy.cc,v 1.7 2007/04/07 16:29:06 serassio Exp $
+ * $Id: DiskdIOStrategy.cc,v 1.8 2007/04/12 17:56:39 rousskov Exp $
  *
  * DEBUG: section 79    Squid-side DISKD I/O functions.
  * AUTHOR: Duane Wessels
@@ -404,7 +404,8 @@ DiskdIOStrategy::SEND(diomsg *M, int mtype, int id, int size, int offset, off_t
         debug(79, 1) ("storeDiskdSend: msgsnd: %s\n", xstrerror());
         cbdataReferenceDone(M->callback_data);
         assert(++send_errors < 100);
-        shm.put (shm_offset);
+        if (shm_offset > -1)
+            shm.put(shm_offset);
     }
 
     /*