| 9722 | |
| 9723 | |
| 9724 | static void send_blob(CheckStatusWrapper* status, |
| 9725 | Rbl* blob, |
| 9726 | USHORT buffer_length, |
| 9727 | const UCHAR* buffer) |
| 9728 | { |
| 9729 | /************************************** |
| 9730 | * |
| 9731 | * s e n d _ b l o b |
| 9732 | * |
| 9733 | ************************************** |
| 9734 | * |
| 9735 | * Functional description |
| 9736 | * Actually send blob data (which might be buffered) |
| 9737 | * |
| 9738 | **************************************/ |
| 9739 | fb_assert(!blob->isCached()); |
| 9740 | |
| 9741 | Rdb* rdb = blob->rbl_rdb; |
| 9742 | PACKET* packet = &rdb->rdb_packet; |
| 9743 | packet->p_operation = op_put_segment; |
| 9744 | |
| 9745 | // If we aren't passed a buffer address, this is a batch send. Pick up the |
| 9746 | // address and length from the blob buffer and blast away |
| 9747 | |
| 9748 | if (!buffer) |
| 9749 | { |
| 9750 | buffer = blob->rbl_buffer; |
| 9751 | buffer_length = blob->rbl_ptr - buffer; |
| 9752 | blob->rbl_ptr = blob->rbl_buffer; |
| 9753 | packet->p_operation = op_batch_segments; |
| 9754 | } |
| 9755 | |
| 9756 | P_SGMT* segment = &packet->p_sgmt; |
| 9757 | CSTRING_CONST temp = segment->p_sgmt_segment; |
| 9758 | segment->p_sgmt_blob = blob->rbl_id; |
| 9759 | segment->p_sgmt_segment.cstr_length = buffer_length; |
| 9760 | segment->p_sgmt_segment.cstr_address = buffer; |
| 9761 | segment->p_sgmt_length = buffer_length; |
| 9762 | |
| 9763 | send_packet(rdb->rdb_port, packet); |
| 9764 | |
| 9765 | // restore the string; "buffer" is not referenced anymore, hence no |
| 9766 | // possibility to overwrite it accidentally. |
| 9767 | segment->p_sgmt_segment = temp; |
| 9768 | |
| 9769 | // Set up for the response packet. |
| 9770 | |
| 9771 | receive_response(status, rdb, packet); |
| 9772 | } |
| 9773 | |
| 9774 | |
| 9775 | static void send_packet(rem_port* port, PACKET* packet) |
no test coverage detected