(self)
| 68 | self.object = None |
| 69 | |
| 70 | def state_bm_header(self): |
| 71 | self.magic, self.command, self.payloadLength, self.checksum = protocol.Header.unpack(self.read_buf[:protocol.Header.size]) |
| 72 | self.command = self.command.rstrip('\x00') |
| 73 | if self.magic != 0xE9BEB4D9: |
| 74 | # skip 1 byte in order to sync |
| 75 | self.set_state("bm_header", length=1) |
| 76 | self.bm_proto_reset() |
| 77 | logger.debug("Bad magic") |
| 78 | if self.socket.type == socket.SOCK_STREAM: |
| 79 | self.close_reason = "Bad magic" |
| 80 | self.set_state("close") |
| 81 | return False |
| 82 | if self.payloadLength > BMProto.maxMessageSize: |
| 83 | self.invalid = True |
| 84 | self.set_state("bm_command", length=protocol.Header.size, expectBytes=self.payloadLength) |
| 85 | return True |
| 86 | |
| 87 | def state_bm_command(self): |
| 88 | self.payload = self.read_buf[:self.payloadLength] |
nothing calls this directly
no test coverage detected