From 0b29aae7cf29ea6c97fde45c9174c1a3ada1ce2f Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@lothar.com>
Date: Sun, 8 Feb 2009 19:56:02 -0700
Subject: [PATCH] storage #596: announce 'tolerates-immutable-read-overrun' to
 the version announcement, to indicate that a read() on an immutable share
 where offset+length is beyond the end of the file will return a truncated
 string instead of raising an exception

---
 src/allmydata/introducer/client.py | 4 +++-
 src/allmydata/storage.py           | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/allmydata/introducer/client.py b/src/allmydata/introducer/client.py
index 7c7e8959..dac8bbd5 100644
--- a/src/allmydata/introducer/client.py
+++ b/src/allmydata/introducer/client.py
@@ -32,7 +32,9 @@ class RemoteServiceConnector:
 
     VERSION_DEFAULTS = {
         "storage": { "http://allmydata.org/tahoe/protocols/storage/v1" :
-                     { "maximum-immutable-share-size": 2**32 },
+                     { "maximum-immutable-share-size": 2**32,
+                       "tolerates-immutable-read-overrun": False,
+                       },
                      "application-version": "unknown: no get_version()",
                      },
         "stub_client": { },
diff --git a/src/allmydata/storage.py b/src/allmydata/storage.py
index 0a15a123..8de5be3d 100644
--- a/src/allmydata/storage.py
+++ b/src/allmydata/storage.py
@@ -961,7 +961,9 @@ class StorageServer(service.MultiService, Referenceable):
             # guess.
             remaining_space = 2**64
         version = { "http://allmydata.org/tahoe/protocols/storage/v1" :
-                    { "maximum-immutable-share-size": remaining_space },
+                    { "maximum-immutable-share-size": remaining_space,
+                      "tolerates-immutable-read-overrun": True,
+                      },
                     "application-version": str(allmydata.__version__),
                     }
         return version
-- 
2.45.2