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

Function xdr_request

src/remote/protocol.cpp:1743–1797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1741
1742
1743static bool_t xdr_request(RemoteXdr* xdrs,
1744 USHORT request_id,
1745 USHORT message_number, USHORT incarnation)
1746{
1747/**************************************
1748 *
1749 * x d r _ r e q u e s t
1750 *
1751 **************************************
1752 *
1753 * Functional description
1754 * Map a formatted message.
1755 *
1756 **************************************/
1757 if (xdrs->x_op == XDR_FREE)
1758 return TRUE;
1759
1760 rem_port* port = xdrs->x_public;
1761
1762 if (request_id >= port->port_objects.getCount())
1763 return FALSE;
1764
1765 Rrq* request;
1766
1767 try
1768 {
1769 request = port->port_objects[request_id];
1770 }
1771 catch (const status_exception&)
1772 {
1773 return FALSE;
1774 }
1775
1776 if (incarnation && !(request = REMOTE_find_request(request, incarnation)))
1777 return FALSE;
1778
1779 if (message_number > request->rrq_max_msg)
1780 return FALSE;
1781
1782 Rrq::rrq_repeat* tail = &request->rrq_rpt[message_number];
1783
1784 RMessage* message = tail->rrq_xdr;
1785 if (!message)
1786 return FALSE;
1787
1788 tail->rrq_xdr = message->msg_next;
1789 const rem_fmt* format = tail->rrq_format;
1790
1791 // Find the address of the record
1792
1793 if (!message->msg_address)
1794 message->msg_address = message->msg_buffer;
1795
1796 return xdr_message(xdrs, message, format);
1797}
1798
1799
1800// Maybe it's better to take sdl_length into account?

Callers 1

xdr_protocolFunction · 0.85

Calls 3

REMOTE_find_requestFunction · 0.85
xdr_messageFunction · 0.85
getCountMethod · 0.45

Tested by

no test coverage detected