[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [stem/master] Make `Controller.close_stream` asynchronous
commit 6e0e2f4559bf0ed1ca4ef649652f6e2749ca4221
Author: Illia Volochii <illia.volochii@xxxxxxxxx>
Date: Tue Apr 21 22:23:35 2020 +0300
Make `Controller.close_stream` asynchronous
---
stem/control.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/stem/control.py b/stem/control.py
index 8eaa8bd8..b36497a5 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -3618,7 +3618,7 @@ class Controller(BaseController):
else:
raise stem.ProtocolError('ATTACHSTREAM returned unexpected response code: %s' % response.code)
- def close_stream(self, stream_id: str, reason: stem.RelayEndReason = stem.RelayEndReason.MISC, flag: str = '') -> None:
+ async def close_stream(self, stream_id: str, reason: stem.RelayEndReason = stem.RelayEndReason.MISC, flag: str = '') -> None:
"""
Closes the specified stream.
@@ -3634,7 +3634,7 @@ class Controller(BaseController):
# there's a single value offset between RelayEndReason.index_of() and the
# value that tor expects since tor's value starts with the index of one
- response = stem.response._convert_to_single_line(self.msg('CLOSESTREAM %s %s %s' % (stream_id, stem.RelayEndReason.index_of(reason) + 1, flag)))
+ response = stem.response._convert_to_single_line(await self.msg('CLOSESTREAM %s %s %s' % (stream_id, stem.RelayEndReason.index_of(reason) + 1, flag)))
if not response.is_ok():
if response.code in ('512', '552'):
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits