@@ -175,20 +175,21 @@ def protocol_handlers(cls, protocol_version=None):
175
175
# Carry out Bolt subclass imports locally to avoid circular dependency issues.
176
176
from ._bolt3 import AsyncBolt3
177
177
from ._bolt4 import (
178
- AsyncBolt4x0 ,
179
178
AsyncBolt4x1 ,
180
179
AsyncBolt4x2 ,
181
180
AsyncBolt4x3 ,
182
181
AsyncBolt4x4 ,
183
182
)
183
+ from ._bolt5 import AsyncBolt5x0
184
184
185
185
handlers = {
186
186
AsyncBolt3 .PROTOCOL_VERSION : AsyncBolt3 ,
187
- AsyncBolt4x0 . PROTOCOL_VERSION : AsyncBolt4x0 ,
187
+ # 4.0 unsupported because no space left in the handshake
188
188
AsyncBolt4x1 .PROTOCOL_VERSION : AsyncBolt4x1 ,
189
189
AsyncBolt4x2 .PROTOCOL_VERSION : AsyncBolt4x2 ,
190
190
AsyncBolt4x3 .PROTOCOL_VERSION : AsyncBolt4x3 ,
191
191
AsyncBolt4x4 .PROTOCOL_VERSION : AsyncBolt4x4 ,
192
+ AsyncBolt5x0 .PROTOCOL_VERSION : AsyncBolt5x0 ,
192
193
}
193
194
194
195
if protocol_version is None :
@@ -208,9 +209,9 @@ def version_list(cls, versions, limit=4):
208
209
preference. The number of protocol versions (or ranges)
209
210
returned is limited to four.
210
211
"""
211
- # In fact, 4.3 is the fist version to support ranges. However, the range
212
- # support got backported to 4.2. But even if the server is too old to
213
- # have the backport, negotiating BOLT 4.1 is no problem as it's
212
+ # In fact, 4.3 is the fist version to support ranges. However, the
213
+ # range support got backported to 4.2. But even if the server is too
214
+ # old to have the backport, negotiating BOLT 4.1 is no problem as it's
214
215
# equivalent to 4.2
215
216
first_with_range_support = Version (4 , 2 )
216
217
result = []
@@ -288,9 +289,12 @@ async def open(
288
289
if pool_config .protocol_version == (3 , 0 ):
289
290
from ._bolt3 import AsyncBolt3
290
291
bolt_cls = AsyncBolt3
291
- elif pool_config .protocol_version == (4 , 0 ):
292
- from ._bolt4 import AsyncBolt4x0
293
- bolt_cls = AsyncBolt4x0
292
+ # Implementation for 4.0 exists, but there was no space left in the
293
+ # handshake to offer this version to the server. Hence, the server
294
+ # should never request us to speak bolt 4.0.
295
+ # elif pool_config.protocol_version == (4, 0):
296
+ # from ._bolt4 import AsyncBolt4x0
297
+ # bolt_cls = AsyncBolt4x0
294
298
elif pool_config .protocol_version == (4 , 1 ):
295
299
from ._bolt4 import AsyncBolt4x1
296
300
bolt_cls = AsyncBolt4x1
@@ -303,6 +307,9 @@ async def open(
303
307
elif pool_config .protocol_version == (4 , 4 ):
304
308
from ._bolt4 import AsyncBolt4x4
305
309
bolt_cls = AsyncBolt4x4
310
+ elif pool_config .protocol_version == (5 , 0 ):
311
+ from ._bolt5 import AsyncBolt5x0
312
+ bolt_cls = AsyncBolt5x0
306
313
else :
307
314
log .debug ("[#%04X] S: <CLOSE>" , s .getsockname ()[1 ])
308
315
AsyncBoltSocket .close_socket (s )
0 commit comments