From: Alex Rousskov Date: Tue, 23 Aug 2022 03:13:29 +0000 (+0000) Subject: Maintenance: Remove an always-false condition (#1122) X-Git-Tag: SQUID_6_0_1~124 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c0bc2b1b62984aa7f570e8a6c9d37c0edcf7702f;p=thirdparty%2Fsquid.git Maintenance: Remove an always-false condition (#1122) The being-removed condition was added by beae59b, likely to compensate for another bug that was later discovered and fixed in 619da1e. That fix made the condition unnecessary and always false. There are other problems in this code, including the misleading comment describing the affected if statement. They will be fixed separately, and the removal of this effectively unused code may simplify that work. --- diff --git a/src/store_client.cc b/src/store_client.cc index 2f53b42421..725da0b911 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -509,8 +509,6 @@ store_client::fileRead() void store_client::readBody(const char *, ssize_t len) { - int parsed_header = 0; - // Don't assert disk_io_pending here.. may be called by read_header flags.disk_io_pending = false; assert(_callback.pending()); @@ -524,8 +522,6 @@ store_client::readBody(const char *, ssize_t len) /* Our structure ! */ if (!entry->mem_obj->adjustableBaseReply().parseCharBuf(copyInto.data, headersEnd(copyInto.data, len))) { debugs(90, DBG_CRITICAL, "ERROR: Could not parse headers from on disk object"); - } else { - parsed_header = 1; } } @@ -536,8 +532,7 @@ store_client::readBody(const char *, ssize_t len) /* Copy read data back into memory. * copyInto.offset includes headers, which is what mem cache needs */ - int64_t mem_offset = entry->mem_obj->endOffset(); - if ((copyInto.offset == mem_offset) || (parsed_header && mem_offset == rep->hdr_sz)) { + if (copyInto.offset == entry->mem_obj->endOffset()) { entry->mem_obj->write(StoreIOBuffer(len, copyInto.offset, copyInto.data)); } }