(conn, direction, version, content_type, msg_type, data)
| 689 | raise TypeError(f"{callback} is not callable.") |
| 690 | |
| 691 | def inner(conn, direction, version, content_type, msg_type, data): |
| 692 | try: |
| 693 | version = TLSVersion(version) |
| 694 | except ValueError: |
| 695 | pass |
| 696 | |
| 697 | try: |
| 698 | content_type = _TLSContentType(content_type) |
| 699 | except ValueError: |
| 700 | pass |
| 701 | |
| 702 | if content_type == _TLSContentType.HEADER: |
| 703 | msg_enum = _TLSContentType |
| 704 | elif content_type == _TLSContentType.ALERT: |
| 705 | msg_enum = _TLSAlertType |
| 706 | else: |
| 707 | msg_enum = _TLSMessageType |
| 708 | try: |
| 709 | msg_type = msg_enum(msg_type) |
| 710 | except ValueError: |
| 711 | pass |
| 712 | |
| 713 | return callback(conn, direction, version, |
| 714 | content_type, msg_type, data) |
| 715 | |
| 716 | inner.user_function = callback |
| 717 |
no test coverage detected