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

Function REMOTE_find_request

src/remote/remote.cpp:254–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252
253
254Rrq* REMOTE_find_request(Rrq* request, USHORT level)
255{
256/**************************************
257 *
258 * R E M O T E _ f i n d _ r e q u e s t
259 *
260 **************************************
261 *
262 * Functional description
263 * Find sub-request if level is non-zero.
264 *
265 **************************************/
266
267 // See if we already know about the request level
268
269 for (;;)
270 {
271 if (request->rrq_level == level)
272 return request;
273 if (!request->rrq_levels)
274 break;
275 request = request->rrq_levels;
276 }
277
278 // This is a new level -- make up a new request block.
279
280 request->rrq_levels = request->clone();
281 // FREE: REMOTE_remove_request()
282#ifdef DEBUG_REMOTE_MEMORY
283 printf("REMOTE_find_request allocate request %x\n", request->rrq_levels);
284#endif
285 request = request->rrq_levels;
286 request->rrq_level = level;
287 request->rrq_levels = NULL;
288
289 // Allocate message block for known messages
290
291 Rrq::rrq_repeat* tail = request->rrq_rpt.begin();
292 const Rrq::rrq_repeat* const end = tail + request->rrq_max_msg;
293 for (; tail <= end; tail++)
294 {
295 const rem_fmt* format = tail->rrq_format;
296 if (!format)
297 continue;
298 RMessage* msg = FB_NEW RMessage(format->fmt_length);
299 tail->rrq_xdr = msg;
300#ifdef DEBUG_REMOTE_MEMORY
301 printf("REMOTE_find_request allocate message %x\n", msg);
302#endif
303 msg->msg_next = msg;
304 msg->msg_number = tail->rrq_message->msg_number;
305 tail->rrq_message = msg;
306 }
307
308 return request;
309}
310
311

Callers 12

xdr_requestFunction · 0.85
receiveMethod · 0.85
getInfoMethod · 0.85
sendMethod · 0.85
startAndSendMethod · 0.85
startMethod · 0.85
unwindMethod · 0.85
receive_after_startMethod · 0.85
receive_msgMethod · 0.85
send_msgMethod · 0.85
startMethod · 0.85
start_and_sendMethod · 0.85

Calls 3

RMessageClass · 0.70
cloneMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected