mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 02:03:03 +01:00
Make fb_cancel_operation() public API call. Related cleanup.
This commit is contained in:
parent
55a5904cac
commit
0ba2ab7ea7
@ -933,12 +933,20 @@
|
||||
#define isc_dpb_set_db_SQL_dialect 65
|
||||
|
||||
/***********************************/
|
||||
/* Masks for fb_shutdown_callback */
|
||||
/* Masks for fb_shutdown_callback */
|
||||
/***********************************/
|
||||
|
||||
#define fb_shut_preproviders 1
|
||||
#define fb_shut_postproviders 2
|
||||
|
||||
/****************************************/
|
||||
/* Cancel types for fb_cancel_operation */
|
||||
/****************************************/
|
||||
|
||||
#define fb_cancel_disable 1
|
||||
#define fb_cancel_enable 2
|
||||
#define fb_cancel_raise 3
|
||||
|
||||
/********************************************/
|
||||
/* Debug information items */
|
||||
/********************************************/
|
||||
|
@ -8572,7 +8572,7 @@ static int API_ROUTINE query_abort()
|
||||
if (DB)
|
||||
{
|
||||
ISC_STATUS_ARRAY status;
|
||||
flag = (gds__cancel_operation(status, &DB, CANCEL_raise) == FB_SUCCESS);
|
||||
flag = (fb_cancel_operation(status, &DB, fb_cancel_raise) == FB_SUCCESS);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -72,8 +72,6 @@
|
||||
#define GARBAGE_THREAD
|
||||
#endif
|
||||
|
||||
#define CANCEL_OPERATION
|
||||
|
||||
|
||||
#ifdef SUPERSERVER
|
||||
#define FB_ARCHITECTURE isc_info_db_class_server_access
|
||||
|
@ -1127,12 +1127,19 @@ ISC_STATUS ISC_EXPORT isc_service_start(ISC_STATUS*,
|
||||
unsigned short,
|
||||
const ISC_SCHAR*);
|
||||
|
||||
/***********************/
|
||||
/* Shutdown and cancel */
|
||||
/***********************/
|
||||
|
||||
int ISC_EXPORT fb_shutdown(unsigned int);
|
||||
|
||||
ISC_STATUS ISC_EXPORT fb_shutdown_callback(ISC_STATUS*,
|
||||
FB_SHUTDOWN_CALLBACK,
|
||||
const int);
|
||||
|
||||
ISC_STATUS ISC_EXPORT fb_cancel_operation(ISC_STATUS*,
|
||||
isc_db_handle*,
|
||||
ISC_USHORT);
|
||||
|
||||
/********************************/
|
||||
/* Client information functions */
|
||||
|
@ -526,7 +526,7 @@ const char SINGLE_QUOTE = '\'';
|
||||
#define GDS_BLOB_INFO jrd8_blob_info
|
||||
#define GDS_CANCEL_BLOB jrd8_cancel_blob
|
||||
#define GDS_CANCEL_EVENTS jrd8_cancel_events
|
||||
#define GDS_CANCEL_OPERATION jrd8_cancel_operation
|
||||
#define FB_CANCEL_OPERATION jrd8_cancel_operation
|
||||
#define GDS_CLOSE_BLOB jrd8_close_blob
|
||||
#define GDS_COMMIT jrd8_commit_transaction
|
||||
#define GDS_COMMIT_RETAINING jrd8_commit_retaining
|
||||
@ -1354,9 +1354,9 @@ ISC_STATUS GDS_CANCEL_EVENTS(ISC_STATUS* user_status,
|
||||
}
|
||||
|
||||
|
||||
ISC_STATUS GDS_CANCEL_OPERATION(ISC_STATUS* user_status,
|
||||
Attachment** handle,
|
||||
USHORT option)
|
||||
ISC_STATUS FB_CANCEL_OPERATION(ISC_STATUS* user_status,
|
||||
Attachment** handle,
|
||||
USHORT option)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -1377,15 +1377,15 @@ ISC_STATUS GDS_CANCEL_OPERATION(ISC_STATUS* user_status,
|
||||
DatabaseContextHolder dbbHolder(tdbb, false);
|
||||
|
||||
switch (option) {
|
||||
case CANCEL_disable:
|
||||
case fb_cancel_disable:
|
||||
attachment->att_flags |= ATT_cancel_disable;
|
||||
break;
|
||||
|
||||
case CANCEL_enable:
|
||||
case fb_cancel_enable:
|
||||
attachment->att_flags &= ~ATT_cancel_disable;
|
||||
break;
|
||||
|
||||
case CANCEL_raise:
|
||||
case fb_cancel_raise:
|
||||
attachment->att_flags |= ATT_cancel_raise;
|
||||
break;
|
||||
|
||||
|
@ -46,9 +46,6 @@ ISC_STATUS jrd8_blob_info(ISC_STATUS*, Jrd::blb**, SSHORT, const SCHAR*, SSHORT,
|
||||
ISC_STATUS jrd8_cancel_blob(ISC_STATUS *, Jrd::blb **);
|
||||
ISC_STATUS jrd8_cancel_events(ISC_STATUS *, Jrd::Attachment**, SLONG *);
|
||||
|
||||
#define CANCEL_disable 1
|
||||
#define CANCEL_enable 2
|
||||
#define CANCEL_raise 3
|
||||
ISC_STATUS jrd8_cancel_operation(ISC_STATUS *, Jrd::Attachment**,
|
||||
USHORT);
|
||||
|
||||
|
@ -961,7 +961,7 @@ namespace
|
||||
#define GDS_BLOB_INFO isc_blob_info
|
||||
#define GDS_CANCEL_BLOB isc_cancel_blob
|
||||
#define GDS_CANCEL_EVENTS isc_cancel_events
|
||||
#define GDS_CANCEL_OPERATION gds__cancel_operation
|
||||
#define FB_CANCEL_OPERATION fb_cancel_operation
|
||||
#define GDS_CLOSE_BLOB isc_close_blob
|
||||
#define GDS_COMMIT isc_commit_transaction
|
||||
#define GDS_COMMIT_RETAINING isc_commit_retaining
|
||||
@ -1480,7 +1480,7 @@ ISC_STATUS API_ROUTINE GDS_CANCEL_EVENTS(ISC_STATUS * user_status,
|
||||
}
|
||||
|
||||
|
||||
ISC_STATUS API_ROUTINE GDS_CANCEL_OPERATION(ISC_STATUS * user_status,
|
||||
ISC_STATUS API_ROUTINE FB_CANCEL_OPERATION(ISC_STATUS * user_status,
|
||||
FB_API_HANDLE * handle,
|
||||
USHORT option)
|
||||
{
|
||||
@ -6053,8 +6053,8 @@ int API_ROUTINE fb_shutdown(unsigned int timeout)
|
||||
for (unsigned int i = 0; i < attachments().getCount(); ++i)
|
||||
{
|
||||
Attachment* att = attachments()[i];
|
||||
CALL(PROC_CANCEL_OPERATION, att->implementation) (status, &att->handle, CANCEL_enable);
|
||||
CALL(PROC_CANCEL_OPERATION, att->implementation) (status, &att->handle, CANCEL_raise);
|
||||
CALL(PROC_CANCEL_OPERATION, att->implementation) (status, &att->handle, fb_cancel_enable);
|
||||
CALL(PROC_CANCEL_OPERATION, att->implementation) (status, &att->handle, fb_cancel_raise);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -251,10 +251,7 @@ SLONG API_ROUTINE isc_reset_fpe(USHORT);
|
||||
|
||||
#endif /* JRD_IBASE_H */
|
||||
|
||||
#define CANCEL_disable 1
|
||||
#define CANCEL_enable 2
|
||||
#define CANCEL_raise 3
|
||||
ISC_STATUS API_ROUTINE gds__cancel_operation(ISC_STATUS*, FB_API_HANDLE*, USHORT);
|
||||
ISC_STATUS API_ROUTINE fb_cancel_operation(ISC_STATUS*, FB_API_HANDLE*, USHORT);
|
||||
|
||||
ISC_STATUS API_ROUTINE fb_disconnect_transaction(ISC_STATUS*, FB_API_HANDLE*);
|
||||
|
||||
|
@ -108,7 +108,7 @@ void EXEC_abort(void)
|
||||
{
|
||||
if (database->dbb_handle)
|
||||
{
|
||||
if (gds__cancel_operation(status_vector, &database->dbb_handle, CANCEL_raise) == 0)
|
||||
if (fb_cancel_operation(status_vector, &database->dbb_handle, fb_cancel_raise) == 0)
|
||||
{
|
||||
QLI_abort = true;
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ inline bool defer_packet(rem_port* port, PACKET* packet, ISC_STATUS* status, boo
|
||||
#define GDS_TRANSACT_REQUEST REM_transact_request
|
||||
#define GDS_TRANSACTION_INFO REM_transaction_info
|
||||
#define GDS_UNWIND REM_unwind_request
|
||||
#define GDS_CANCEL_OPERATION REM_cancel_operation
|
||||
#define FB_CANCEL_OPERATION REM_cancel_operation
|
||||
|
||||
/* DSQL definitions */
|
||||
|
||||
@ -7040,7 +7040,7 @@ static void zap_packet(PACKET* packet)
|
||||
}
|
||||
|
||||
|
||||
ISC_STATUS GDS_CANCEL_OPERATION(ISC_STATUS* user_status, Rdb** db_handle, USHORT kind)
|
||||
ISC_STATUS FB_CANCEL_OPERATION(ISC_STATUS* user_status, Rdb** db_handle, USHORT kind)
|
||||
{
|
||||
/*************************************
|
||||
*
|
||||
|
@ -128,9 +128,7 @@ static void aux_request(rem_port*, P_REQ*, PACKET*);
|
||||
static ISC_STATUS cancel_events(rem_port*, P_EVENT*, PACKET*);
|
||||
static void addClumplets(Firebird::ClumpletWriter&, const ParametersSet&, const rem_port*);
|
||||
|
||||
#ifdef CANCEL_OPERATION
|
||||
static void cancel_operation(rem_port*, USHORT);
|
||||
#endif
|
||||
|
||||
static bool check_request(Rrq*, USHORT, USHORT);
|
||||
static USHORT check_statement_type(Rsr*);
|
||||
@ -440,10 +438,8 @@ static bool link_request(rem_port* port, SERVER_REQ request)
|
||||
|
||||
if (queue)
|
||||
{
|
||||
#ifdef CANCEL_OPERATION
|
||||
if (operation == op_exit || operation == op_disconnect)
|
||||
cancel_operation(port, CANCEL_raise);
|
||||
#endif
|
||||
cancel_operation(port, fb_cancel_raise);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1236,7 +1232,6 @@ static ISC_STATUS cancel_events( rem_port* port, P_EVENT * stuff, PACKET* send)
|
||||
}
|
||||
|
||||
|
||||
#ifdef CANCEL_OPERATION
|
||||
static void cancel_operation( rem_port* port, USHORT kind)
|
||||
{
|
||||
/**************************************
|
||||
@ -1263,11 +1258,10 @@ static void cancel_operation( rem_port* port, USHORT kind)
|
||||
if (!(rdb->rdb_flags & Rdb::SERVICE))
|
||||
{
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
gds__cancel_operation(status_vector, &rdb->rdb_handle, kind);
|
||||
fb_cancel_operation(status_vector, &rdb->rdb_handle, kind);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static bool check_request(Rrq* request,
|
||||
@ -1526,12 +1520,10 @@ void rem_port::disconnect(PACKET* sendL, PACKET* receiveL)
|
||||
ISC_STATUS_ARRAY status_vector;
|
||||
|
||||
if (!(rdb->rdb_flags & Rdb::SERVICE)) {
|
||||
#ifdef CANCEL_OPERATION
|
||||
/* Prevent a pending or spurious cancel from aborting
|
||||
a good, clean detach from the database. */
|
||||
|
||||
gds__cancel_operation(status_vector, &rdb->rdb_handle, CANCEL_disable);
|
||||
#endif
|
||||
fb_cancel_operation(status_vector, &rdb->rdb_handle, fb_cancel_disable);
|
||||
while (rdb->rdb_requests)
|
||||
release_request(rdb->rdb_requests);
|
||||
while (rdb->rdb_sql_requests)
|
||||
@ -3335,9 +3327,7 @@ static bool process_packet(rem_port* port,
|
||||
break;
|
||||
|
||||
case op_cancel:
|
||||
#ifdef CANCEL_OPERATION
|
||||
cancel_operation(port, receive->p_cancel_op.p_co_kind);
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -5233,9 +5223,7 @@ bool rem_port::asyncReceive(PACKET* asyncPacket, const UCHAR* buffer, SSHORT dat
|
||||
switch(asyncPacket->p_operation)
|
||||
{
|
||||
case op_cancel:
|
||||
#ifdef CANCEL_OPERATION
|
||||
cancel_operation(this, asyncPacket->p_cancel_op.p_co_kind);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user