twisted: deallocate in more errorful situations
This commit is contained in:
parent
62ebd07036
commit
cdeaac0ad0
|
@ -249,6 +249,7 @@ class SymmetricWormhole:
|
||||||
if self.code is None: raise UsageError
|
if self.code is None: raise UsageError
|
||||||
d = self._get_key()
|
d = self._get_key()
|
||||||
d.addCallback(self._get_data2, outbound_data)
|
d.addCallback(self._get_data2, outbound_data)
|
||||||
|
d.addBoth(self._deallocate)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def _get_data2(self, key, outbound_data):
|
def _get_data2(self, key, outbound_data):
|
||||||
|
@ -268,7 +269,6 @@ class SymmetricWormhole:
|
||||||
except CryptoError:
|
except CryptoError:
|
||||||
raise WrongPasswordError
|
raise WrongPasswordError
|
||||||
d.addCallback(_got_data)
|
d.addCallback(_got_data)
|
||||||
d.addBoth(self._deallocate)
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def _deallocate(self, res):
|
def _deallocate(self, res):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user