Commit 020ba117 authored by Julien Muchembled's avatar Julien Muchembled

protocol: freeze code of RequestIdentification packet

parent 13182d61
...@@ -24,7 +24,7 @@ from struct import Struct ...@@ -24,7 +24,7 @@ from struct import Struct
from .util import Enum, getAddressType from .util import Enum, getAddressType
# The protocol version (major, minor). # The protocol version (major, minor).
PROTOCOL_VERSION = (7, 1) PROTOCOL_VERSION = (8, 1)
# Size restrictions. # Size restrictions.
MIN_PACKET_SIZE = 10 MIN_PACKET_SIZE = 10
...@@ -1559,14 +1559,19 @@ class Packets(dict): ...@@ -1559,14 +1559,19 @@ class Packets(dict):
# notifications # notifications
Error = register( Error = register(
Error) Error)
RequestIdentification, AcceptIdentification = register(
RequestIdentification)
# Code of RequestIdentification packet must never change so that 2
# incompatible nodes can reject themselves gracefully (i.e. comparing
# protocol versions) instead of raising PacketMalformedError.
assert RequestIdentification._code == 1
Ping, Pong = register( Ping, Pong = register(
Ping) Ping)
CloseClient = register( CloseClient = register(
CloseClient) CloseClient)
Notify = register( Notify = register(
Notify) Notify)
RequestIdentification, AcceptIdentification = register(
RequestIdentification)
AskPrimary, AnswerPrimary = register( AskPrimary, AnswerPrimary = register(
PrimaryMaster) PrimaryMaster)
AnnouncePrimary = register( AnnouncePrimary = register(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment