From 3e25efc010876b42dbc890760a576794eec7ddce Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 21 Nov 2008 20:29:32 -0700 Subject: [PATCH] upload: when using a Helper, insist that it provide protocols/helper/v1 . Related to #538. --- src/allmydata/immutable/upload.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/allmydata/immutable/upload.py b/src/allmydata/immutable/upload.py index 3b653d8a..c37aa0e9 100644 --- a/src/allmydata/immutable/upload.py +++ b/src/allmydata/immutable/upload.py @@ -18,7 +18,8 @@ from allmydata.util import base32, idlib, mathutil from allmydata.util.assertutil import precondition from allmydata.util.rrefutil import get_versioned_remote_reference from allmydata.interfaces import IUploadable, IUploader, IUploadResults, \ - IEncryptedUploadable, RIEncryptedUploadable, IUploadStatus, NotEnoughSharesError + IEncryptedUploadable, RIEncryptedUploadable, IUploadStatus, \ + NotEnoughSharesError, InsufficientVersionError from allmydata.immutable import layout from pycryptopp.cipher.aes import AES @@ -1242,6 +1243,9 @@ class Uploader(service.MultiService): d.addCallback(self._got_versioned_helper) def _got_versioned_helper(self, helper): + needed = "http://allmydata.org/tahoe/protocols/helper/v1" + if needed not in helper.version: + raise InsufficientVersionError(needed, helper.version) self._helper = helper helper.notifyOnDisconnect(self._lost_helper) -- 2.45.2