| 2753 | |
| 2754 | |
| 2755 | static void cancel_operation(rem_port* port, USHORT kind) |
| 2756 | { |
| 2757 | /************************************** |
| 2758 | * |
| 2759 | * c a n c e l _ o p e r a t i o n |
| 2760 | * |
| 2761 | ************************************** |
| 2762 | * |
| 2763 | * Functional description |
| 2764 | * Flag a running operation for cancel. |
| 2765 | * Service operations are not currently |
| 2766 | * able to be canceled. |
| 2767 | * |
| 2768 | **************************************/ |
| 2769 | if ((port->port_flags & (PORT_async | PORT_disconnect)) || !(port->port_context)) |
| 2770 | return; |
| 2771 | |
| 2772 | ServAttachment dbIface; |
| 2773 | ServService svcIface; |
| 2774 | { |
| 2775 | RefMutexGuard portGuard(*port->port_cancel_sync, FB_FUNCTION); |
| 2776 | |
| 2777 | Rdb* rdb = port->port_context; |
| 2778 | if ((port->port_flags & PORT_disconnect) || !rdb) |
| 2779 | return; |
| 2780 | |
| 2781 | if (rdb->rdb_svc) |
| 2782 | svcIface = rdb->rdb_svc->svc_iface; |
| 2783 | else |
| 2784 | dbIface = rdb->rdb_iface; |
| 2785 | } |
| 2786 | |
| 2787 | LocalStatus ls; |
| 2788 | CheckStatusWrapper status_vector(&ls); |
| 2789 | |
| 2790 | if (dbIface) |
| 2791 | dbIface->cancelOperation(&status_vector, kind); |
| 2792 | else if (svcIface && kind == fb_cancel_raise) |
| 2793 | svcIface->cancel(&status_vector); |
| 2794 | } |
| 2795 | |
| 2796 | |
| 2797 | static bool check_request(Rrq* request, USHORT incarnation, USHORT msg_number) |
no test coverage detected