Ctrl+C properly stop the program
This commit is contained in:
@ -356,7 +356,7 @@ class GoAwayTLV(TLV):
|
||||
self.type = raw_data[0]
|
||||
self.length = raw_data[1]
|
||||
self.code = GoAwayType(raw_data[2])
|
||||
self.message = raw_data[3:self.length - 1].decode("UTF-8")
|
||||
self.message = raw_data[3:2 + self.length].decode("UTF-8")
|
||||
|
||||
def marshal(self) -> bytes:
|
||||
return self.type.to_bytes(1, sys.byteorder) + \
|
||||
@ -376,7 +376,7 @@ class GoAwayTLV(TLV):
|
||||
tlv.type = 6
|
||||
tlv.code = ga_type
|
||||
tlv.message = message
|
||||
tlv.length = 1 + len(tlv.message)
|
||||
tlv.length = 1 + len(tlv.message.encode("UTF-8"))
|
||||
return tlv
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user