| 6964 | } |
| 6965 | |
| 6966 | void Request::send(CheckStatusWrapper* status, int level, unsigned int msg_type, |
| 6967 | unsigned int /*length*/, const void* msg) |
| 6968 | { |
| 6969 | /************************************** |
| 6970 | * |
| 6971 | * g d s _ s e n d |
| 6972 | * |
| 6973 | ************************************** |
| 6974 | * |
| 6975 | * Functional description |
| 6976 | * Send a message to the server. |
| 6977 | * |
| 6978 | **************************************/ |
| 6979 | try |
| 6980 | { |
| 6981 | reset(status); |
| 6982 | |
| 6983 | CHECK_HANDLE(rq, isc_bad_req_handle); |
| 6984 | Rrq* request = REMOTE_find_request(rq, level); |
| 6985 | |
| 6986 | Rdb* rdb = request->rrq_rdb; |
| 6987 | CHECK_HANDLE(rdb, isc_bad_db_handle); |
| 6988 | rem_port* port = rdb->rdb_port; |
| 6989 | RefMutexGuard portGuard(*port->port_sync, FB_FUNCTION); |
| 6990 | |
| 6991 | if (msg_type > request->rrq_max_msg) |
| 6992 | { |
| 6993 | handle_error(isc_badmsgnum); |
| 6994 | } |
| 6995 | |
| 6996 | RMessage* message = request->rrq_rpt[msg_type].rrq_message; |
| 6997 | // We are lying here, but the interface shows for years this param as const |
| 6998 | message->msg_address = const_cast<unsigned char*>(static_cast<const unsigned char*>(msg)); |
| 6999 | |
| 7000 | PACKET* packet = &rdb->rdb_packet; |
| 7001 | packet->p_operation = op_send; |
| 7002 | P_DATA* data = &packet->p_data; |
| 7003 | data->p_data_request = request->rrq_id; |
| 7004 | data->p_data_message_number = msg_type; |
| 7005 | data->p_data_incarnation = level; |
| 7006 | |
| 7007 | send_packet(port, packet); |
| 7008 | |
| 7009 | // Bump up the message pointer to resync with rrq_xdr (rrq_xdr |
| 7010 | // was incremented by xdr_request in the SEND call). |
| 7011 | |
| 7012 | message->msg_address = NULL; |
| 7013 | request->rrq_rpt[msg_type].rrq_message = message->msg_next; |
| 7014 | |
| 7015 | receive_response(status, rdb, packet); |
| 7016 | } |
| 7017 | catch (const Exception& ex) |
| 7018 | { |
| 7019 | ex.stuffException(status); |
| 7020 | } |
| 7021 | } |
| 7022 | |
| 7023 |
no test coverage detected