| 9106 | |
| 9107 | |
| 9108 | static void receive_after_start(Rrq* request, USHORT msg_type) |
| 9109 | { |
| 9110 | /***************************************** |
| 9111 | * |
| 9112 | * r e c e i v e _ a f t e r _ s t a r t |
| 9113 | * |
| 9114 | ***************************************** |
| 9115 | * |
| 9116 | * Functional Description |
| 9117 | * Some opcodes, such as "start_and_send" automatically start the |
| 9118 | * cursor being started, under protcol 8 we then receive the first |
| 9119 | * batch of records without having to ask for them. |
| 9120 | * |
| 9121 | * Note: if a network error occurs during this receive, we do not |
| 9122 | * recognize it in the "gds_start" API call that initiated this |
| 9123 | * action. It will be stored with the queue of records for the |
| 9124 | * cursor that is being fetched. This is not ideal - but compabile |
| 9125 | * with how the code worked prior to pipelining work done |
| 9126 | * 1996-Jul-15 David Schnepper |
| 9127 | * |
| 9128 | *****************************************/ |
| 9129 | |
| 9130 | // Check to see if any data is waiting to happen |
| 9131 | |
| 9132 | Rdb* rdb = request->rrq_rdb; |
| 9133 | PACKET* packet = &rdb->rdb_packet; |
| 9134 | Rrq::rrq_repeat* tail = &request->rrq_rpt[msg_type]; |
| 9135 | // CVC: I commented this line because it's overwritten immediately in the loop. |
| 9136 | // RMessage* message = tail->rrq_message; |
| 9137 | const rem_fmt* format = tail->rrq_format; |
| 9138 | |
| 9139 | // Swallow up data. If a buffer isn't available, allocate another |
| 9140 | |
| 9141 | while (true) |
| 9142 | { |
| 9143 | RMessage* message = tail->rrq_xdr; |
| 9144 | if (message->msg_address) |
| 9145 | { |
| 9146 | RMessage* new_msg = FB_NEW RMessage(format->fmt_length); |
| 9147 | tail->rrq_xdr = new_msg; |
| 9148 | new_msg->msg_next = message; |
| 9149 | new_msg->msg_number = message->msg_number; |
| 9150 | |
| 9151 | while (message->msg_next != new_msg->msg_next) |
| 9152 | message = message->msg_next; |
| 9153 | message->msg_next = new_msg; |
| 9154 | } |
| 9155 | |
| 9156 | // Note: not receive_packet |
| 9157 | try |
| 9158 | { |
| 9159 | receive_packet_noqueue(rdb->rdb_port, packet); |
| 9160 | } |
| 9161 | catch (const Exception& ex) |
| 9162 | { |
| 9163 | request->saveStatus(ex); |
| 9164 | return; |
| 9165 | } |
no test coverage detected