| 2018 | |
| 2019 | |
| 2020 | static rem_port* receive( rem_port* main_port, PACKET * packet) |
| 2021 | { |
| 2022 | /************************************** |
| 2023 | * |
| 2024 | * r e c e i v e |
| 2025 | * |
| 2026 | ************************************** |
| 2027 | * |
| 2028 | * Functional description |
| 2029 | * Receive a message from a port or clients of a port. If the process |
| 2030 | * is a server and a connection request comes in, generate a new port |
| 2031 | * block for the client. |
| 2032 | * |
| 2033 | **************************************/ |
| 2034 | |
| 2035 | // loop as long as we are receiving dummy packets, just |
| 2036 | // throwing them away--note that if we are a server we won't |
| 2037 | // be receiving them, but it is better to check for them at |
| 2038 | // this level rather than try to catch them in all places where |
| 2039 | // this routine is called |
| 2040 | |
| 2041 | do { |
| 2042 | if (!xdr_protocol(main_port->port_receive, packet)) |
| 2043 | { |
| 2044 | packet->p_operation = main_port->port_partial_data ? op_partial : op_exit; |
| 2045 | if (packet->p_operation == op_exit) |
| 2046 | main_port->port_state = rem_port::BROKEN; |
| 2047 | |
| 2048 | main_port->port_partial_data = false; |
| 2049 | break; |
| 2050 | } |
| 2051 | #ifdef DEBUG |
| 2052 | { |
| 2053 | static ULONG op_rec_count = 0; |
| 2054 | op_rec_count++; |
| 2055 | if (INET_trace & TRACE_operations) |
| 2056 | { |
| 2057 | fprintf(stdout, "%04u: OP Recd %5u opcode %d\n", |
| 2058 | inet_debug_timer(), |
| 2059 | op_rec_count, packet->p_operation); |
| 2060 | fflush(stdout); |
| 2061 | } |
| 2062 | } |
| 2063 | #endif |
| 2064 | } while (packet->p_operation == op_dummy); |
| 2065 | |
| 2066 | return main_port; |
| 2067 | } |
| 2068 | |
| 2069 | static bool select_multi(rem_port* main_port, UCHAR* buffer, SSHORT bufsize, SSHORT* length, |
| 2070 | RemPortPtr& port) |
no test coverage detected