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

Function EXE_send

src/jrd/exe.cpp:767–831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765
766
767void EXE_send(thread_db* tdbb, Request* request, USHORT msg, ULONG length, const void* buffer)
768{
769/**************************************
770 *
771 * E X E _ s e n d
772 *
773 **************************************
774 *
775 * Functional description
776 * Send a message from the host program to the engine.
777 * This corresponds to a blr_receive or blr_select statement.
778 *
779 **************************************/
780 SET_TDBB(tdbb);
781 DEV_BLKCHK(request, type_req);
782
783 JRD_reschedule(tdbb);
784
785 if (!(request->req_flags & req_active))
786 ERR_post(Arg::Gds(isc_req_sync));
787
788 const StmtNode* message = NULL;
789 const StmtNode* node;
790
791 if (request->req_operation != Request::req_receive)
792 ERR_post(Arg::Gds(isc_req_sync));
793 node = request->req_message;
794
795 jrd_tra* transaction = request->req_transaction;
796
797 const SelectNode* selectNode;
798
799 if (nodeIs<MessageNode>(node))
800 message = node;
801 else if ((selectNode = nodeAs<SelectNode>(node)))
802 {
803 const NestConst<StmtNode>* ptr = selectNode->statements.begin();
804
805 for (const NestConst<StmtNode>* end = selectNode->statements.end(); ptr != end; ++ptr)
806 {
807 const ReceiveNode* receiveNode = nodeAs<ReceiveNode>(*ptr);
808 message = receiveNode->message;
809
810 if (nodeAs<MessageNode>(message)->messageNumber == msg)
811 {
812 request->req_next = *ptr;
813 break;
814 }
815 }
816 }
817 else
818 BUGCHECK(167); // msg 167 invalid SEND request
819
820 const Format* format = nodeAs<MessageNode>(message)->format;
821
822 if (msg != nodeAs<MessageNode>(message)->messageNumber)
823 ERR_post(Arg::Gds(isc_req_sync));
824

Callers 6

executeMethod · 0.85
executeMethod · 0.85
executeProcedureMethod · 0.85
JRD_sendFunction · 0.85
JRD_start_and_sendFunction · 0.85
internalOpenMethod · 0.85

Calls 8

SET_TDBBFunction · 0.85
JRD_rescheduleFunction · 0.85
GdsClass · 0.85
NumClass · 0.85
execute_looperFunction · 0.85
ERR_postFunction · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected