squid/b8930.patch

75 lines
2.6 KiB
Diff

------------------------------------------------------------
revno: 8930
revision-id: squid3@treenet.co.nz-20081201053029-k18urfbqvmmo1whl
parent: squid3@treenet.co.nz-20081128120843-juy12m80zdtusl5v
committer: Amos Jeffries <squid3@treenet.co.nz>
branch nick: SQUID_3_0
timestamp: Mon 2008-12-01 18:30:29 +1300
message:
Rollback rev 8909
This change to StoreIO overlooked the signedness of the StoreIO* length
parameter. It may have resulted in objects that should not have been
store making their way into the cache.
Caches created by 3.0.STABLE10 release are known to contain many invalid
entries when rolled back to STABLE9 release. Whether or not these entries
are fatal to Squid is still unknown. It is currently expected that they
will be erased properly, but cause a lot of cache.log warnings while that
is happening. It is left to admin to decide if its worth purging their
cache on upgrade.
------------------------------------------------------------
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: squid3@treenet.co.nz-20081201053029-k18urfbqvmmo1whl
# target_branch: http://www.squid-cache.org/bzr/squid3/branches\
# /SQUID_3_0/
# testament_sha1: 491d242447b01a6ec90eb9983cc9384b050fae73
# timestamp: 2008-12-01 05:47:46 +0000
# source_branch: http://www.squid-cache.org/bzr/squid3/branches\
# /SQUID_3_0
# base_revision_id: squid3@treenet.co.nz-20081128120843-\
# juy12m80zdtusl5v
#
# Begin patch
=== modified file 'src/StoreIOBuffer.h'
--- src/StoreIOBuffer.h 2008-10-06 11:35:50 +0000
+++ src/StoreIOBuffer.h 2008-12-01 05:30:29 +0000
@@ -46,17 +46,9 @@
StoreIOBuffer():length(0), offset (0), data (NULL) {flags.error = 0;}
StoreIOBuffer(size_t aLength, int64_t anOffset, char *someData) :
- offset (anOffset), data (someData)
+ length (aLength), offset (anOffset), data (someData)
{
- /* maintain own state: detect size errors now */
- if (aLength <0) {
- flags.error = 1;
- length = 0;
- }
- else {
- flags.error = 0;
- length = aLength;
- }
+ flags.error = 0;
}
/* Create a StoreIOBuffer from a MemBuf and offset */
=== modified file 'src/store_client.cc'
--- src/store_client.cc 2008-10-06 11:35:50 +0000
+++ src/store_client.cc 2008-12-01 05:30:29 +0000
@@ -145,8 +145,11 @@
{
StoreIOBuffer result(sz, 0 ,copyInto.data);
- if (error) {
+ if (sz < 0) {
result.flags.error = 1;
+ result.length = 0;
+ } else {
+ result.flags.error = error ? 1 : 0;
}
result.offset = cmp_offset;