* Smarter handling of DispatchOptions options

git-svn-id: trunk@42278 -
This commit is contained in:
michael 2019-06-24 07:22:02 +00:00
parent abf6c99304
commit 73b365cd30

View File

@ -493,9 +493,16 @@ end;
procedure TSQLDBRestDispatcher.SetDispatchOptions(AValue: TRestDispatcherOptions);
Var
DeleteConnection : Boolean;
begin
DeleteConnection:=(rdoConnectionInURL in FDispatchOptions) and Not (rdoConnectionInURL in aValue);
if (rdoConnectionResource in aValue) then
Include(aValue,rdoConnectionInURL);
if DeleteConnection then // if user disables rdoConnectionInURL, we disable rdoConnectionResource.
exclude(aValue,rdoConnectionResource)
else // else we include rdoConnectionInURL...
Include(aValue,rdoConnectionInURL);
if FDispatchOptions=AValue then Exit;
FDispatchOptions:=AValue;
end;