]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Forgot to copy the read slot into caller's buffer, causing SWAPFAIL_MISSes.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 1 Feb 2011 09:50:11 +0000 (02:50 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 1 Feb 2011 09:50:11 +0000 (02:50 -0700)
src/DiskIO/IpcIo/IpcIoFile.cc

index f6e7f8450025df987d84657263e4fbb2c5578932..2564a7bd4758545ee0619c19415ee270312aedfc 100644 (file)
@@ -160,12 +160,13 @@ IpcIoFile::readCompleted(ReadRequest *readRequest,
     if (ipcResponse.xerrno) {
         debugs(79,1, HERE << "error: " << xstrerr(ipcResponse.xerrno));
         error_ = true;
-       }
+       } else {
+        memcpy(readRequest->buf, ipcResponse.buf, ipcResponse.len);
+    }
 
     const ssize_t rlen = error_ ? -1 : (ssize_t)readRequest->len;
     const int errflag = error_ ? DISK_ERROR : DISK_OK;
-    // XXX: check buffering expectations of the recepient
-    ioRequestor->readCompleted(ipcResponse.buf, rlen, errflag, readRequest);
+    ioRequestor->readCompleted(readRequest->buf, rlen, errflag, readRequest);
 }
 
 void