Changed variable names for clearer structure.
This commit is contained in:
@@ -125,4 +125,16 @@ proc getVarLengthMetadata*(unpacker: Unpacker): string =
|
||||
return ""
|
||||
|
||||
# Read content
|
||||
return unpacker.getBytes(int(length)).toString()
|
||||
return unpacker.getBytes(int(length)).toString()
|
||||
|
||||
proc packHeader*(packer: Packer, header: Header, bodySize: uint32): seq[byte] =
|
||||
packer
|
||||
.add(header.magic)
|
||||
.add(header.version)
|
||||
.add(header.packetType)
|
||||
.add(header.flags)
|
||||
.add(header.seqNr)
|
||||
.add(bodySize)
|
||||
.addData(header.hmac)
|
||||
|
||||
return packer.pack()
|
||||
@@ -27,6 +27,7 @@ type
|
||||
# Flags should be powers of 2 so they can be connected with or operators
|
||||
FLAG_PLAINTEXT = 0'u16
|
||||
FLAG_ENCRYPTED = 1'u16
|
||||
FLAG_COMPRESSED = 2'u16
|
||||
|
||||
CommandType* = enum
|
||||
CMD_SLEEP = 0'u16
|
||||
@@ -154,7 +155,7 @@ type
|
||||
HTTP = "http"
|
||||
|
||||
Listener* = ref object
|
||||
name*: string
|
||||
listenerId*: string
|
||||
address*: string
|
||||
port*: int
|
||||
protocol*: Protocol
|
||||
|
||||
Reference in New Issue
Block a user