You are not logged in.
Pages: 1
to provide full rest http server all works fine until you do it in a dll.
it will cause app to hang(NO RESPONSE) problems.
after days of debug , i found that :
problem 1:
when use any of HTTP_API_MODES (httpsys) to create the server ,if you have no Admin rights , it will dead at line 856 FreeAndNil(fHttpServer);
what we expected is to fallback to normal socket-based server, but the failed fHttpServer seems can not be destroyed .
THttpServerGeneric.Destroy call ShutdownThread,but it can not break the loop.
problem 2:
useHttpSocket mode always cause THttpServerSocketGeneric.WaitStarted raise 'WaitStarted timeout after' exception.
Offline
newly found: that's because thread in dll not work the same as in exe , thread execute process only start work 'AFTER' DLL_Process_Attach.
so ,we should NOT wait somethine depend on execute process result ,
like THttpServerSocketGeneric(fHttpServer).WaitStarted({sec=}30, TLS),
it's GetExecuteState depends on thread execute setting fExecuteState state.
delete waitstarted then we works fine in dll.
is there another way to workaround this ? delete waitstarted process seems not good idea.
(all *httpserver have the same issue)
Offline
Thanks a lot for the feedback and investigation.
You can register the http.sys URI with Admin rights, then execute the program (and its dll) with normal user rights.
Couldn't you just run the http server class instances after DLL_PROCESS_ATTACH ?
Offline
Pages: 1