How to make Delphi ISAPI DLL's work (fix error 500)

 
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
bobokonijn
-


Joined: 18 Nov 2014
Posts: 3

PostPosted: Tue Dec 02, 2014 9:51 am    Post subject: How to make Delphi ISAPI DLL's work (fix error 500) Reply with quote

If you develop ISAPI Dll's with Delphi, you'll find out that Abyss may throw an internal server error 500.

The reason is that Abyss doesn't support asynchronous I/O, and Delphi's unit "Isapithreadpool.pas" enables that feature for all web servers except Netscape Server.


To avoid this problem, you have two options:

1) This unit is optional. Remove all references to Isapithreadpool from your Delphi project. This will involve a speed penalty in Microsoft IIS and reduce scalability.

2) Make a small modification in the unit, so that thread pools are enabled ONLY in Microsoft IIS and disabled in all others.


In order to make the modification, search the source of unit Isapithreadpool.pas and copy it to your project directory. Then modify the procedure "CheckForNetscapeServer" as follows:

function CheckForNetscapeServer: Boolean;
var
LoadingModule: string;
Windir:String;
begin
SetLength(LoadingModule, 4096);
SetLength(LoadingModule, GetModuleFileName(GetModuleHandle(nil),
PChar(LoadingModule), Length(LoadingModule)));

setlength(windir,4096);
SetLength(windir, Getwindowsdirectory(pchar(windir),4096));
Result := AnsiCompareText(windir, copy (loadingmodule, 1, length(windir))) <>0;

{$ifdef debug}
if result
then outputdebugstring('Isapi Asynchronous I/O Disabled')
else outputdebugstring('Isapi Asynchronous I/O Enabled');
{$endif}
end;




This modification enables asynchronous I/O only if the worker process is located somewhere beneath the directory C:\Windows (in other words, if it is a Microsoft product). All third-party products are normally installed elsewhere on the hard drive.


Happy programming,

Arthur Hoornweg
_________________
Kind regards,

Arthur
Back to top View user's profile Send private message
Jerry
-


Joined: 07 Sep 2016
Posts: 4

PostPosted: Fri Mar 03, 2017 7:04 pm    Post subject: Reply with quote

Arthur, I just saw this, for which I apologize. Frankly, because of this server error I had given up on Absys/

Thank you very much for your detailed reply. I will give your advice a shot as soon as I find some free time. I particularly appreciated knowing the reason it doesn't work with Delphi DLLs.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group