Make optional connection header fields available
This commit is contained in:
parent
77e68e8191
commit
c2bbeec7aa
@ -69,6 +69,8 @@ class Connection(NamedTuple):
|
|||||||
msgtype: str
|
msgtype: str
|
||||||
md5sum: str
|
md5sum: str
|
||||||
msgdef: str
|
msgdef: str
|
||||||
|
callerid: Optional[str]
|
||||||
|
latching: Optional[int]
|
||||||
indexes: List
|
indexes: List
|
||||||
|
|
||||||
|
|
||||||
@ -490,7 +492,19 @@ class Reader:
|
|||||||
md5sum = header.get_string('md5sum')
|
md5sum = header.get_string('md5sum')
|
||||||
msgdef = header.get_string('message_definition')
|
msgdef = header.get_string('message_definition')
|
||||||
|
|
||||||
return conn, Connection(conn, topic, normalize_msgtype(typ), md5sum, msgdef, [])
|
callerid = header.get_string('callerid') if 'callerid' in header else None
|
||||||
|
latching = int(header.get_string('latching')) if 'latching' in header else None
|
||||||
|
|
||||||
|
return conn, Connection(
|
||||||
|
conn,
|
||||||
|
topic,
|
||||||
|
normalize_msgtype(typ),
|
||||||
|
md5sum,
|
||||||
|
msgdef,
|
||||||
|
callerid,
|
||||||
|
latching,
|
||||||
|
[],
|
||||||
|
)
|
||||||
|
|
||||||
def read_chunk_info(self) -> ChunkInfo:
|
def read_chunk_info(self) -> ChunkInfo:
|
||||||
"""Read chunk info record from current position."""
|
"""Read chunk info record from current position."""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user