(conn, direction, version, content_type, msg_type, data)
| 626 | raise TypeError(f"{callback} is not callable.") |
| 627 | |
| 628 | def inner(conn, direction, version, content_type, msg_type, data): |
| 629 | try: |
| 630 | version = TLSVersion(version) |
| 631 | except ValueError: |
| 632 | pass |
| 633 | |
| 634 | try: |
| 635 | content_type = _TLSContentType(content_type) |
| 636 | except ValueError: |
| 637 | pass |
| 638 | |
| 639 | if content_type == _TLSContentType.HEADER: |
| 640 | msg_enum = _TLSContentType |
| 641 | elif content_type == _TLSContentType.ALERT: |
| 642 | msg_enum = _TLSAlertType |
| 643 | else: |
| 644 | msg_enum = _TLSMessageType |
| 645 | try: |
| 646 | msg_type = msg_enum(msg_type) |
| 647 | except ValueError: |
| 648 | pass |
| 649 | |
| 650 | return callback(conn, direction, version, |
| 651 | content_type, msg_type, data) |
| 652 | |
| 653 | inner.user_function = callback |
| 654 |
no test coverage detected