UdrEngine.cpp (Firebird-3.0.2.32703-0.tar.bz2) | : | UdrEngine.cpp (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 551 | skipping to change at line 551 | |||
UdrPluginImpl* ret; | UdrPluginImpl* ret; | |||
if (modules->get(*moduleName, ret)) | if (modules->get(*moduleName, ret)) | |||
return ret; | return ret; | |||
for (ObjectsArray<PathName>::iterator i = paths->begin(); i != paths->end (); ++i) | for (ObjectsArray<PathName>::iterator i = paths->begin(); i != paths->end (); ++i) | |||
{ | { | |||
PathName path; | PathName path; | |||
PathUtils::concatPath(path, *i, *moduleName); | PathUtils::concatPath(path, *i, *moduleName); | |||
ModuleLoader::Module* module = ModuleLoader::fixAndLoadModule(pat | static ISC_STATUS_ARRAY statusArray = { | |||
h); | isc_arg_gds, isc_random, | |||
isc_arg_string, (ISC_STATUS) "UDR module not loaded", | ||||
isc_arg_end | ||||
}; | ||||
const unsigned ARG_END = 4; | ||||
ModuleLoader::Module* module = ModuleLoader::fixAndLoadModule(&st | ||||
atusArray[ARG_END], path); | ||||
if (!module) | ||||
throw FbException(status, statusArray); | ||||
if (module) | FB_BOOLEAN* (*entryPoint)(IStatus*, FB_BOOLEAN*, IUdrPlugin*); | |||
{ | ||||
FB_BOOLEAN* (*entryPoint)(IStatus*, FB_BOOLEAN*, IUdrPlug | ||||
in*); | ||||
if (!module->findSymbol(STRINGIZE(FB_UDR_PLUGIN_ENTRY_POI | ||||
NT), entryPoint)) | ||||
{ | ||||
static const ISC_STATUS statusVector[] = { | ||||
isc_arg_gds, isc_random, | ||||
isc_arg_string, (ISC_STATUS) "UDR plugin | ||||
entry point not found", | ||||
isc_arg_end | ||||
}; | ||||
throw FbException(status, statusVector); | ||||
} | ||||
UdrPluginImpl* udrPlugin = FB_NEW UdrPluginImpl(*moduleNa | ||||
me, module); | ||||
udrPlugin->theirUnloadFlag = entryPoint(status, &udrPlugi | ||||
n->myUnloadFlag, udrPlugin); | ||||
if (status->getState() & IStatus::STATE_ERRORS) | ||||
{ | ||||
delete udrPlugin; | ||||
ThrowStatusWrapper::checkException(status); | ||||
} | ||||
modules->put(*moduleName, udrPlugin); | ||||
return udrPlugin; | if (!module->findSymbol(STRINGIZE(FB_UDR_PLUGIN_ENTRY_POINT), ent | |||
} | ryPoint)) | |||
else | ||||
{ | { | |||
static const ISC_STATUS statusVector[] = { | static const ISC_STATUS statusVector[] = { | |||
isc_arg_gds, isc_random, | isc_arg_gds, isc_random, | |||
isc_arg_string, (ISC_STATUS) "Module not found", | isc_arg_string, (ISC_STATUS) "UDR plugin entry po | |||
//// TODO: isc_arg_gds, isc_random, isc_arg_strin | int not found", | |||
g, (ISC_STATUS) moduleName->c_str(), | ||||
isc_arg_end | isc_arg_end | |||
}; | }; | |||
throw FbException(status, statusVector); | throw FbException(status, statusVector); | |||
} | } | |||
UdrPluginImpl* udrPlugin = FB_NEW UdrPluginImpl(*moduleName, modu | ||||
le); | ||||
udrPlugin->theirUnloadFlag = entryPoint(status, &udrPlugin->myUnl | ||||
oadFlag, udrPlugin); | ||||
if (status->getState() & IStatus::STATE_ERRORS) | ||||
{ | ||||
delete udrPlugin; | ||||
ThrowStatusWrapper::checkException(status); | ||||
} | ||||
modules->put(*moduleName, udrPlugin); | ||||
return udrPlugin; | ||||
} | } | |||
static const ISC_STATUS statusVector[] = { | static const ISC_STATUS statusVector[] = { | |||
isc_arg_gds, isc_random, | isc_arg_gds, isc_random, | |||
isc_arg_string, (ISC_STATUS) "No UDR module path was configured", | isc_arg_string, (ISC_STATUS) "No UDR module path was configured", | |||
isc_arg_end | isc_arg_end | |||
}; | }; | |||
throw FbException(status, statusVector); | throw FbException(status, statusVector); | |||
} | } | |||
End of changes. 5 change blocks. | ||||
38 lines changed or deleted | 31 lines changed or added |