(self, p, pay)
| 633 | subslotNumber = 0xffff |
| 634 | |
| 635 | def post_build(self, p, pay): |
| 636 | # patch the update of block_length, as requests field must not be |
| 637 | # included. block_length is always 60 |
| 638 | if self.block_length is None: |
| 639 | p = p[:2] + struct.pack("!H", 60) + p[4:] |
| 640 | |
| 641 | # Remove the final padding added in requests |
| 642 | fld, val = self.getfield_and_val("blocks") |
| 643 | if fld.i2count(self, val) > 0: |
| 644 | length = len(val[-1]) |
| 645 | pad = fld.field.padlen(length, self) |
| 646 | if pad > 0: |
| 647 | p = p[:-pad] |
| 648 | # also reduce the recordDataLength accordingly |
| 649 | if self.recordDataLength is None: |
| 650 | val = struct.unpack("!I", p[36:40])[0] |
| 651 | val -= pad |
| 652 | p = p[:36] + struct.pack("!I", val) + p[40:] |
| 653 | |
| 654 | return Packet.post_build(self, p, pay) |
| 655 | |
| 656 | def get_response(self): |
| 657 | """Generate the response block of this request. |
nothing calls this directly
no test coverage detected