| 2874 | |
| 2875 | |
| 2876 | ISC_STATUS rem_port::compile(P_CMPL* compileL, PACKET* sendL) |
| 2877 | { |
| 2878 | /************************************** |
| 2879 | * |
| 2880 | * c o m p i l e |
| 2881 | * |
| 2882 | ************************************** |
| 2883 | * |
| 2884 | * Functional description |
| 2885 | * Compile and request. |
| 2886 | * |
| 2887 | **************************************/ |
| 2888 | LocalStatus ls; |
| 2889 | CheckStatusWrapper status_vector(&ls); |
| 2890 | |
| 2891 | Rdb* rdb = this->port_context; |
| 2892 | if (bad_db(&status_vector, rdb)) |
| 2893 | { |
| 2894 | return this->send_response(sendL, 0, 0, &status_vector, false); |
| 2895 | } |
| 2896 | |
| 2897 | const UCHAR* blr = compileL->p_cmpl_blr.cstr_address; |
| 2898 | const ULONG blr_length = compileL->p_cmpl_blr.cstr_length; |
| 2899 | |
| 2900 | ServRequest iface(rdb->rdb_iface->compileRequest(&status_vector, blr_length, blr)); |
| 2901 | |
| 2902 | if (status_vector.getState() & IStatus::STATE_ERRORS) |
| 2903 | return this->send_response(sendL, 0, 0, &status_vector, false); |
| 2904 | |
| 2905 | // Parse the request to find the messages |
| 2906 | |
| 2907 | RMessage* message = PARSE_messages(blr, blr_length); |
| 2908 | USHORT max_msg = 0; |
| 2909 | |
| 2910 | RMessage* next; |
| 2911 | for (next = message; next; next = next->msg_next) |
| 2912 | max_msg = MAX(max_msg, next->msg_number); |
| 2913 | |
| 2914 | // Allocate block and merge into data structures |
| 2915 | |
| 2916 | Rrq* requestL = FB_NEW Rrq(max_msg + 1); |
| 2917 | #ifdef DEBUG_REMOTE_MEMORY |
| 2918 | printf("compile(server) allocate request %x\n", request); |
| 2919 | #endif |
| 2920 | requestL->rrq_iface = iface; |
| 2921 | requestL->rrq_rdb = rdb; |
| 2922 | requestL->rrq_max_msg = max_msg; |
| 2923 | OBJCT object = 0; |
| 2924 | |
| 2925 | if (requestL->rrq_id = this->get_id(requestL)) |
| 2926 | { |
| 2927 | object = requestL->rrq_id; |
| 2928 | requestL->rrq_next = rdb->rdb_requests; |
| 2929 | rdb->rdb_requests = requestL; |
| 2930 | } |
| 2931 | else |
| 2932 | { |
| 2933 | requestL->rrq_iface->free(&status_vector); |
no test coverage detected