From a1ad81aa2786bd0ef25d84ec8a0a133315386fd3 Mon Sep 17 00:00:00 2001 From: serassio <> Date: Sat, 7 Apr 2007 22:29:06 +0000 Subject: [PATCH] Forward port of 2.x changes from Duane: 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 | 6 +++++- src/DiskIO/DiskDaemon/diskd.cc | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc b/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc index 8819ba30d4..60441a636b 100644 --- a/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc +++ b/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc @@ -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(); diff --git a/src/DiskIO/DiskDaemon/diskd.cc b/src/DiskIO/DiskDaemon/diskd.cc index c8275e3b39..1c77bec63c 100644 --- a/src/DiskIO/DiskDaemon/diskd.cc +++ b/src/DiskIO/DiskDaemon/diskd.cc @@ -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) -- 2.47.2