MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / cancel_events

Function cancel_events

src/remote/server/server.cpp:2701–2752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2699
2700
2701static ISC_STATUS cancel_events( rem_port* port, P_EVENT * stuff, PACKET* send)
2702{
2703/**************************************
2704 *
2705 * c a n c e l _ e v e n t s
2706 *
2707 **************************************
2708 *
2709 * Functional description
2710 * Cancel events.
2711 *
2712 **************************************/
2713 LocalStatus ls;
2714 CheckStatusWrapper status_vector(&ls);
2715
2716 // Which database ?
2717
2718 Rdb* rdb = port->port_context;
2719 if (bad_db(&status_vector, rdb))
2720 return port->send_response(send, 0, 0, &status_vector, false);
2721
2722 // Find the event
2723
2724 Rvnt* event;
2725 for (event = rdb->rdb_events; event; event = event->rvnt_next)
2726 {
2727 if (event->rvnt_id == stuff->p_event_rid)
2728 break;
2729 }
2730
2731 // If no event found, pretend it was cancelled
2732
2733 if (!event)
2734 return port->send_response(send, 0, 0, &status_vector, false);
2735
2736 // cancel the event
2737
2738 const bool allowCancel = event->rvnt_destroyed.compareExchange(0, 1);
2739 if (allowCancel && event->rvnt_iface)
2740 {
2741 event->rvnt_iface->cancel(&status_vector);
2742 event->rvnt_iface = NULL;
2743 }
2744
2745 // zero event info
2746
2747 event->rvnt_id = 0L;
2748
2749 // return response
2750
2751 return port->send_response(send, 0, 0, &status_vector, false);
2752}
2753
2754
2755static void cancel_operation(rem_port* port, USHORT kind)

Callers 1

process_packetFunction · 0.85

Calls 4

bad_dbFunction · 0.85
send_responseMethod · 0.80
compareExchangeMethod · 0.80
cancelMethod · 0.45

Tested by

no test coverage detected