File tree Expand file tree Collapse file tree 5 files changed +8
-7
lines changed
Expand file tree Collapse file tree 5 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 1313)
1414from ..multiplexer .core import Multiplexer
1515from ..multiplexer .crypto import CryptoTransport
16- from ..utils import PROTOCOL_VERSION
16+ from ..utils import DEFAULT_PROTOCOL_VERSION
1717from ..utils .asyncio import asyncio_timeout , make_task_waiter_future
1818from .connector import Connector
1919
@@ -53,7 +53,7 @@ async def start(
5353 aes_key : bytes ,
5454 aes_iv : bytes ,
5555 throttling : int | None = None ,
56- protocol_version : int = PROTOCOL_VERSION ,
56+ protocol_version : int = DEFAULT_PROTOCOL_VERSION ,
5757 ) -> None :
5858 """Connect an start ClientPeer."""
5959 if self ._multiplexer :
Original file line number Diff line number Diff line change 11"""Utils & function for implementations."""
22
3- from .server import PROTOCOL_VERSION
3+ from .server import DEFAULT_PROTOCOL_VERSION , PROTOCOL_VERSION
44
5- __all__ = ("PROTOCOL_VERSION" , )
5+ __all__ = ("DEFAULT_PROTOCOL_VERSION" , "PROTOCOL_VERSION" )
Original file line number Diff line number Diff line change 1414
1515from ..client .client_peer import ClientPeer
1616from ..client .connector import Connector
17- from . import PROTOCOL_VERSION
17+ from . import DEFAULT_PROTOCOL_VERSION
1818from .asyncio import asyncio_timeout
1919
2020_LOGGER = logging .getLogger (__name__ )
@@ -102,7 +102,7 @@ async def connect(
102102 aes_key : bytes ,
103103 aes_iv : bytes ,
104104 throttling : int | None = None ,
105- protocol_version : int = PROTOCOL_VERSION ,
105+ protocol_version : int = DEFAULT_PROTOCOL_VERSION ,
106106 ) -> None :
107107 """Connect to SniTun server."""
108108 if self ._client .is_connected :
Original file line number Diff line number Diff line change 1111MAX_READ_SIZE = 4_096
1212MAX_BUFFER_SIZE = 1_024_000
1313PROTOCOL_VERSION = 1
14+ DEFAULT_PROTOCOL_VERSION = 0
1415
1516
1617class TokenData (TypedDict ):
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ async def test_client_connect_with_protocol_version() -> None:
5757 mock_client_peer .start .assert_called_once ()
5858 args = mock_client_peer .start .call_args
5959 assert "protocol_version" in args .kwargs
60- assert args .kwargs ["protocol_version" ] == 1 # Default PROTOCOL_VERSION
60+ assert args .kwargs ["protocol_version" ] == 0 # DEFAULT_PROTOCOL_VERSION
6161
6262 mock_client_peer .start .reset_mock ()
6363 await client .connect (
You can’t perform that action at this time.
0 commit comments