Skip to content

Commit b7db76d

Browse files
committed
Add 5.0 to the handshake
1 parent 4c9ad21 commit b7db76d

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

packages/bolt-connection/src/bolt/create.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import BoltProtocolV4x1 from './bolt-protocol-v4x1'
2626
import BoltProtocolV4x2 from './bolt-protocol-v4x2'
2727
import BoltProtocolV4x3 from './bolt-protocol-v4x3'
2828
import BoltProtocolV4x4 from './bolt-protocol-v4x4'
29+
import BoltProtocolV5x0 from './bolt-protocol-v5x0'
2930
import { Chunker, Dechunker } from '../channel'
3031
import ResponseHandler from './response-handler'
3132

@@ -175,6 +176,16 @@ function createProtocol (
175176
onProtocolError,
176177
serversideRouting
177178
)
179+
case 5.0:
180+
return new BoltProtocolV5x0(
181+
server,
182+
chunker,
183+
packingConfig,
184+
createResponseHandler,
185+
log,
186+
onProtocolError,
187+
serversideRouting
188+
)
178189
default:
179190
throw newError('Unknown Bolt protocol version: ' + version)
180191
}

packages/bolt-connection/src/bolt/handshake.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ function parseNegotiatedResponse (buffer) {
7676
*/
7777
function newHandshakeBuffer () {
7878
return createHandshakeMessage([
79+
version(5, 0),
7980
[version(4, 4), version(4, 2)],
8081
version(4, 1),
81-
version(4, 0),
8282
version(3, 0)
8383
])
8484
}

packages/bolt-connection/test/bolt/index.test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import BoltProtocolV4x1 from '../../src/bolt/bolt-protocol-v4x1'
3030
import BoltProtocolV4x2 from '../../src/bolt/bolt-protocol-v4x2'
3131
import BoltProtocolV4x3 from '../../src/bolt/bolt-protocol-v4x3'
3232
import BoltProtocolV4x4 from '../../src/bolt/bolt-protocol-v4x4'
33+
import BoltProtocolV5x0 from '../../src/bolt/bolt-protocol-v5x0'
3334

3435
const {
3536
logger: { Logger }
@@ -43,13 +44,13 @@ describe('#unit Bolt', () => {
4344
const writtenBuffer = channel.written[0]
4445

4546
const boltMagicPreamble = '60 60 b0 17'
47+
const protocolVersion5x0 = '00 00 00 05'
4648
const protocolVersion4x4to4x2 = '00 02 04 04'
4749
const protocolVersion4x1 = '00 00 01 04'
48-
const protocolVersion4x0 = '00 00 00 04'
4950
const protocolVersion3 = '00 00 00 03'
5051

5152
expect(writtenBuffer.toHex()).toEqual(
52-
`${boltMagicPreamble} ${protocolVersion4x4to4x2} ${protocolVersion4x1} ${protocolVersion4x0} ${protocolVersion3}`
53+
`${boltMagicPreamble} ${protocolVersion5x0} ${protocolVersion4x4to4x2} ${protocolVersion4x1} ${protocolVersion3}`
5354
)
5455
})
5556

@@ -303,7 +304,8 @@ describe('#unit Bolt', () => {
303304
v(4.1, BoltProtocolV4x1),
304305
v(4.2, BoltProtocolV4x2),
305306
v(4.3, BoltProtocolV4x3),
306-
v(4.4, BoltProtocolV4x4)
307+
v(4.4, BoltProtocolV4x4),
308+
v(5.0, BoltProtocolV5x0)
307309
]
308310

309311
availableProtocols.forEach(lambda)

0 commit comments

Comments
 (0)