Attention is currently required from: dexter, laforge.
13 comments:
File pySim/cattp.py:
Patch Set #1, Line 54: HDR_LEN = 18 # TS 102 127 5.6.2, without a variable header area
Shouldn't this be 12 instead of 18? - However, in the code below I can see that 18 is actually corre […]
Done
Patch Set #1, Line 105: self.data = bytes(data)
what if someone tries to instantiate a SYN PDU with data in it? Wouldn't that be illegal (see my oth […]
checked now.
Patch Set #1, Line 136: var = self._variable_header()
As far as I can see you are calling _variable_header only from here. […]
Done
Patch Set #1, Line 137: hdr = bytearray([self.flags | (self.version & 0x03), 0, 0, HDR_LEN + len(var)])
using construct wasn't an option? In other location you use it quite often, why not use it here too?
Done
Patch Set #1, Line 144: return bytes(hdr) + self.data
I wonder what would happen if self.syn is true and self.data has bytes. […]
checked now.
Patch Set #1, Line 154: (hdr_len, data_len, len(raw)))
I would recommend to split this. […]
Done
Patch Set #1, Line 156: raise CatTpError('checksum mismatch')
maybe use constants for those offsets. I think this would be a lot easier to read.
Done
Patch Set #1, Line 163: if len(var) < 5 or len(var) != 5 + var[4]:
I think you should comment this. […]
Done
Patch Set #1, Line 172: raise CatTpError('malformed EACK variable header')
So this checks if we have an uneven or even number of bytes in the variable part of the PDU. […]
Done
Patch Set #1, Line 537: ACK into the same PDU."""
maybe put an API docstring for every constructor parameter? I think here it is most important as thi […]
Done
Patch Set #1, Line 551: def bind(self) -> int:
Called by the API user, add API docstring.
Done
Patch Set #1, Line 558: def serve_forever(self):
Called by the API user, add API docstring.
Done
Patch Set #1, Line 564: raw, addr = self._sock.recvfrom(65535)
maybe add a constant for the number of bytes?
Done
To view, visit change 43719. To unsubscribe, or for help writing mail filters, visit settings.