| 4596 | |
| 4597 | |
| 4598 | void rem_port::info(P_OP op, P_INFO* stuff, PACKET* sendL) |
| 4599 | { |
| 4600 | /************************************** |
| 4601 | * |
| 4602 | * i n f o |
| 4603 | * |
| 4604 | ************************************** |
| 4605 | * |
| 4606 | * Functional description |
| 4607 | * Get info for a blob, database, request, service, |
| 4608 | * statement, or transaction. |
| 4609 | * |
| 4610 | **************************************/ |
| 4611 | LocalStatus ls; |
| 4612 | CheckStatusWrapper status_vector(&ls); |
| 4613 | |
| 4614 | Rdb* rdb = this->port_context; |
| 4615 | if ((op == op_service_info) ? bad_service(&status_vector, rdb) : bad_db(&status_vector, rdb)) |
| 4616 | { |
| 4617 | this->send_response(sendL, 0, 0, &status_vector, false); |
| 4618 | return; |
| 4619 | } |
| 4620 | |
| 4621 | const ULONG buffer_length = stuff->p_info_buffer_length; |
| 4622 | |
| 4623 | // Make sure there is a suitable temporary blob buffer |
| 4624 | Array<UCHAR> buf; |
| 4625 | UCHAR* const buffer = buffer_length ? buf.getBuffer(buffer_length) : NULL; |
| 4626 | |
| 4627 | HalfStaticArray<UCHAR, 1024> info; |
| 4628 | UCHAR* info_buffer = NULL; |
| 4629 | ULONG info_len; |
| 4630 | HalfStaticArray<UCHAR, 1024> temp; |
| 4631 | UCHAR* temp_buffer = NULL; |
| 4632 | |
| 4633 | if (op == op_info_database) |
| 4634 | { |
| 4635 | temp_buffer = buffer_length ? temp.getBuffer(buffer_length) : NULL; |
| 4636 | } |
| 4637 | else |
| 4638 | { |
| 4639 | // stuff isc_info_length in front of info items buffer |
| 4640 | |
| 4641 | CSTRING_CONST* info_string = (op == op_service_info) ? |
| 4642 | &stuff->p_info_recv_items : &stuff->p_info_items; |
| 4643 | |
| 4644 | info_len = 1 + info_string->cstr_length; |
| 4645 | info_buffer = info.getBuffer(info_len); |
| 4646 | |
| 4647 | *info_buffer = isc_info_length; |
| 4648 | memmove(info_buffer + 1, info_string->cstr_address, info_len - 1); |
| 4649 | } |
| 4650 | |
| 4651 | Rbl* blob; |
| 4652 | Rtr* transaction; |
| 4653 | Rsr* statement; |
| 4654 | Svc* service; |
| 4655 |
no test coverage detected