| 7022 | |
| 7023 | |
| 7024 | IService* RProvider::attachSvc(CheckStatusWrapper* status, const char* service, |
| 7025 | unsigned int spbLength, const unsigned char* spb, bool loopback) |
| 7026 | { |
| 7027 | /************************************** |
| 7028 | * |
| 7029 | * g d s _ s e r v i c e _ a t t a c h |
| 7030 | * |
| 7031 | ************************************** |
| 7032 | * |
| 7033 | * Functional description |
| 7034 | * Connect to a Firebird service. |
| 7035 | * |
| 7036 | **************************************/ |
| 7037 | try |
| 7038 | { |
| 7039 | reset(status); |
| 7040 | |
| 7041 | PathName node_name, expanded_name(service); |
| 7042 | |
| 7043 | ClumpletWriter newSpb(ClumpletReader::spbList, MAX_DPB_SIZE, spb, spbLength); |
| 7044 | const bool user_verification = get_new_dpb(newSpb, spbParam, loopback); |
| 7045 | |
| 7046 | ClntAuthBlock cBlock(NULL, &newSpb, &spbParam); |
| 7047 | unsigned flags = 0; |
| 7048 | |
| 7049 | if (user_verification) |
| 7050 | flags |= ANALYZE_USER_VFY; |
| 7051 | |
| 7052 | if (loopback) |
| 7053 | flags |= ANALYZE_LOOPBACK; |
| 7054 | |
| 7055 | flags |= ANALYZE_EMP_NAME; |
| 7056 | |
| 7057 | PathName refDbName; |
| 7058 | if (newSpb.find(isc_spb_expected_db)) |
| 7059 | newSpb.getPath(refDbName); |
| 7060 | |
| 7061 | rem_port* port = analyze(cBlock, expanded_name, flags, newSpb, spbParam, node_name, &refDbName, cryptCallback); |
| 7062 | |
| 7063 | RefMutexGuard portGuard(*port->port_sync, FB_FUNCTION); |
| 7064 | Rdb* rdb = port->port_context; |
| 7065 | |
| 7066 | // The client may have set a parameter for dummy_packet_interval. Add that to the |
| 7067 | // the SPB so the server can pay attention to it. Note: allocation code must |
| 7068 | // ensure sufficient space has been added. |
| 7069 | |
| 7070 | add_other_params(port, newSpb, spbParam); |
| 7071 | |
| 7072 | IntlSpb intl; |
| 7073 | if (!init(status, cBlock, port, op_service_attach, expanded_name, newSpb, intl, cryptCallback)) |
| 7074 | return NULL; |
| 7075 | |
| 7076 | IService* s = FB_NEW Service(rdb); |
| 7077 | s->addRef(); |
| 7078 | return s; |
| 7079 | } |
| 7080 | catch (const Exception& ex) |
| 7081 | { |
nothing calls this directly
no test coverage detected