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

Method startAndSend

src/remote/client/interface.cpp:7290–7366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7288
7289
7290void Request::startAndSend(CheckStatusWrapper* status, ITransaction* apiTra, int level,
7291 unsigned int msg_type, unsigned int /*length*/, const void* msg)
7292{
7293/**************************************
7294 *
7295 * g d s _ s t a r t _ a n d _ s e n d
7296 *
7297 **************************************
7298 *
7299 * Functional description
7300 * Get a record from the host program.
7301 *
7302 **************************************/
7303 try
7304 {
7305 reset(status);
7306
7307 CHECK_HANDLE(rq, isc_bad_req_handle);
7308 Rrq* request = REMOTE_find_request(rq, level);
7309
7310 Rtr* transaction = remAtt->remoteTransaction(apiTra);
7311 CHECK_HANDLE(transaction, isc_bad_trans_handle);
7312
7313 Rdb* rdb = request->rrq_rdb;
7314 CHECK_HANDLE(rdb, isc_bad_db_handle);
7315
7316 rem_port* port = rdb->rdb_port;
7317 RefMutexGuard portGuard(*port->port_sync, FB_FUNCTION);
7318
7319 if (msg_type > request->rrq_max_msg)
7320 {
7321 handle_error(isc_badmsgnum);
7322 }
7323
7324 if (transaction->rtr_rdb != rdb)
7325 {
7326 Arg::Gds(isc_trareqmis).raise();
7327 }
7328
7329 clear_queue(rdb->rdb_port);
7330
7331 REMOTE_reset_request(request, 0);
7332 RMessage* message = request->rrq_rpt[msg_type].rrq_message;
7333 message->msg_address = const_cast<unsigned char*>(static_cast<const unsigned char*>(msg));
7334
7335 PACKET* packet = &rdb->rdb_packet;
7336 packet->p_operation = op_start_send_and_receive;
7337 P_DATA* data = &packet->p_data;
7338 data->p_data_request = request->rrq_id;
7339 data->p_data_transaction = transaction->rtr_id;
7340 data->p_data_message_number = msg_type;
7341 data->p_data_incarnation = level;
7342
7343 send_packet(port, packet);
7344
7345 // Bump up the message pointer to resync with rrq_xdr (rrq_xdr
7346 // was incremented by xdr_request in the SEND call).
7347

Callers 1

start_and_sendMethod · 0.45

Calls 13

CHECK_HANDLEFunction · 0.85
REMOTE_find_requestFunction · 0.85
handle_errorFunction · 0.85
GdsClass · 0.85
clear_queueFunction · 0.85
REMOTE_reset_requestFunction · 0.85
send_packetFunction · 0.85
receive_responseFunction · 0.85
receive_after_startFunction · 0.85
remoteTransactionMethod · 0.80
resetFunction · 0.70
raiseMethod · 0.45

Tested by

no test coverage detected