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

Function get_next_msg_no

src/remote/server/server.cpp:4408–4456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4406
4407
4408static bool get_next_msg_no(Rrq* request, USHORT incarnation, USHORT * msg_number)
4409{
4410/**************************************
4411 *
4412 * g e t _ n e x t _ m s g _ n o
4413 *
4414 **************************************
4415 *
4416 * Functional description
4417 * Return the number of the next message
4418 * in the request.
4419 *
4420 **************************************/
4421 LocalStatus ls;
4422 CheckStatusWrapper status_vector(&ls);
4423 UCHAR info_buffer[128];
4424
4425 request->rrq_iface->getInfo(&status_vector, incarnation,
4426 sizeof(request_info), request_info, sizeof(info_buffer), info_buffer);
4427
4428 if (status_vector.getState() & IStatus::STATE_ERRORS)
4429 return false;
4430
4431 bool result = false;
4432 for (const UCHAR* info = info_buffer; *info != isc_info_end;)
4433 {
4434 const USHORT l = (USHORT) gds__vax_integer(info + 1, 2);
4435 const USHORT n = (USHORT) gds__vax_integer(info + 3, l);
4436
4437 switch (*info)
4438 {
4439 case isc_info_state:
4440 if (n != isc_info_req_send)
4441 return false;
4442 break;
4443
4444 case isc_info_message_number:
4445 *msg_number = n;
4446 result = true;
4447 break;
4448
4449 default:
4450 return false;
4451 }
4452 info += 3 + l;
4453 }
4454
4455 return result;
4456}
4457
4458
4459ISC_STATUS rem_port::get_segment(P_SGMT* segment, PACKET* sendL)

Callers 2

check_requestFunction · 0.85
receive_after_startMethod · 0.85

Calls 2

getInfoMethod · 0.45
getStateMethod · 0.45

Tested by

no test coverage detected