From: Brian Warner Date: Sat, 22 Nov 2008 03:29:32 +0000 (-0700) Subject: upload: when using a Helper, insist that it provide protocols/helper/v1 . Related... X-Git-Url: https://git.rkrishnan.org/pf/content/en/service/rgr-080307.php?a=commitdiff_plain;h=3e25efc010876b42dbc890760a576794eec7ddce;p=tahoe-lafs%2Ftahoe-lafs.git upload: when using a Helper, insist that it provide protocols/helper/v1 . Related to #538. --- 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)