| 5028 | // Declared in serve_proto.h |
| 5029 | |
| 5030 | static bool process_packet(rem_port* port, PACKET* sendL, PACKET* receive, rem_port** result) |
| 5031 | { |
| 5032 | /************************************** |
| 5033 | * |
| 5034 | * p r o c e s s _ p a c k e t |
| 5035 | * |
| 5036 | ************************************** |
| 5037 | * |
| 5038 | * Functional description |
| 5039 | * Given an packet received from client, process it a packet ready to be |
| 5040 | * sent. |
| 5041 | * |
| 5042 | **************************************/ |
| 5043 | RefMutexGuard portGuard(*port->port_sync, FB_FUNCTION); |
| 5044 | DecrementRequestsQueued dec(port); |
| 5045 | |
| 5046 | try |
| 5047 | { |
| 5048 | const P_OP op = receive->p_operation; |
| 5049 | switch (op) |
| 5050 | { |
| 5051 | case op_connect: |
| 5052 | if (!accept_connection(port, &receive->p_cnct, sendL)) |
| 5053 | { |
| 5054 | //const string& s = port->port_user_name; |
| 5055 | /*** |
| 5056 | if (s.hasData()) |
| 5057 | { looks like logging rejects is not good idea any more? |
| 5058 | gds__log("SERVER/process_packet: connection rejected for %s", s.c_str()); |
| 5059 | } |
| 5060 | ***/ |
| 5061 | |
| 5062 | if (port->port_server->srvr_flags & SRVR_multi_client) |
| 5063 | port->port_state = rem_port::BROKEN; |
| 5064 | else |
| 5065 | { |
| 5066 | // gds__log("SERVER/process_packet: connect reject, server exiting"); |
| 5067 | port->disconnect(sendL, receive); |
| 5068 | return false; |
| 5069 | } |
| 5070 | } |
| 5071 | break; |
| 5072 | |
| 5073 | case op_compile: |
| 5074 | port->compile(&receive->p_cmpl, sendL); |
| 5075 | break; |
| 5076 | |
| 5077 | case op_attach: |
| 5078 | case op_create: |
| 5079 | attach_database(port, op, &receive->p_atch, sendL); |
| 5080 | break; |
| 5081 | |
| 5082 | case op_service_attach: |
| 5083 | attach_service(port, &receive->p_atch, sendL); |
| 5084 | break; |
| 5085 | |
| 5086 | case op_trusted_auth: // PROTOCOL < 13 |
| 5087 | case op_cont_auth: // PROTOCOL >= 13 |
no test coverage detected