]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Forward port of 2.x changes from Duane:
authorserassio <>
Sat, 7 Apr 2007 22:29:06 +0000 (22:29 +0000)
committerserassio <>
Sat, 7 Apr 2007 22:29:06 +0000 (22:29 +0000)
Set errno passed from diskd to squid.

The diskd helper passes errno in responses.  With this patch, errno
is now set in the main squid process after processing a diskd
response.

Initialize unused fields of diomsg in messages from diskd to squid.

Previously, the diskd helper did not initialize the unused fields
of diomsg.  This was annoying when looking at debugging output
and trying to match requests with responses.  This patch initializes
the unused fields.

src/DiskIO/DiskDaemon/DiskdIOStrategy.cc
src/DiskIO/DiskDaemon/diskd.cc

index 8819ba30d450657fe93196d354fe6f1a29df19fe..60441a636baaf6675092217d990928b178e3a339 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: DiskdIOStrategy.cc,v 1.6 2007/01/31 07:13:54 wessels Exp $
+ * $Id: DiskdIOStrategy.cc,v 1.7 2007/04/07 16:29:06 serassio Exp $
  *
  * DEBUG: section 79    Squid-side DISKD I/O functions.
  * AUTHOR: Duane Wessels
@@ -314,6 +314,10 @@ DiskdIOStrategy::handle(diomsg * M)
     }
 
 
+    /* set errno passed from diskd.  makes debugging more meaningful */
+    if (M->status < 0)
+        errno = -M->status;
+
     if (M->newstyle) {
         DiskdFile *theFile = (DiskdFile *)M->callback_data;
         theFile->RefCountDereference();
index c8275e3b3975e916cc6a32b2105a45bb0002e0f9..1c77bec63ca7f02bbe4e84dc37bab09d7612ded8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: diskd.cc,v 1.4 2006/05/08 23:05:45 wessels Exp $
+ * $Id: diskd.cc,v 1.5 2007/04/07 16:29:06 serassio Exp $
  *
  * DEBUG: section --    External DISKD process implementation.
  * AUTHOR: Harvest Derived
@@ -260,10 +260,13 @@ msg_handle(diomsg * r, int rl, diomsg * s)
 {
     char *buf = NULL;
     s->mtype = r->mtype;
+    s->id = r->id;
+    s->seq_no = r->seq_no;     /* optional, debugging */
     s->callback_data = r->callback_data;
     s->requestor = r->requestor;
+    s->size = 0;               /* optional, debugging */
+    s->offset = 0;             /* optional, debugging */
     s->shm_offset = r->shm_offset;
-    s->id = r->id;
     s->newstyle = r->newstyle;
 
     if (s->shm_offset > -1)