Skip to content

Commit 7d13e17

Browse files
committed
Return proper message and state from JRequest::getInfo()
1 parent a1ff809 commit 7d13e17

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/jrd/jrd.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4104,6 +4104,26 @@ void JRequest::getInfo(CheckStatusWrapper* user_status, int level, unsigned int
41044104

41054105
try
41064106
{
4107+
for (unsigned i = 0; i < itemsLength; ++i)
4108+
{
4109+
if (items[i] == isc_info_message_number || items[i] == isc_info_message_size)
4110+
{
4111+
// For proper return these items require request operation req_send or req_receive
4112+
// Run request from stale status until we get one of these (or end of program)
4113+
// It is up to caller to make sure that there is no heavy operations between req_next
4114+
// and the next SuspendNode/ReceiveNode/SelectMessageNode
4115+
while ((request->req_flags & req_active)
4116+
&& request->req_operation != Request::req_receive
4117+
&& request->req_operation != Request::req_send)
4118+
{
4119+
request->req_flags &= ~req_stall;
4120+
request->req_operation = Request::req_sync;
4121+
EXE_looper(tdbb, request, request->req_next);
4122+
}
4123+
break;
4124+
}
4125+
}
4126+
41074127
INF_request_info(request, itemsLength, items, bufferLength, buffer);
41084128
}
41094129
catch (const Exception& ex)

0 commit comments

Comments
 (0)