HTTP headers with keep-alive do look sometimes like this :
Keep-Alive: 300
Connection: keep-alive
How about adding a KeepAliveTime in httpsend.pas :
// (1) right after this code :
property KeepAlive: Boolean read FKeepAlive Write FKeepAlive;
// add :
{:if KeepAlive is @true, KeepAliveTime is the duration of the KeepAlive.}
property KeepAliveTime: Cardinal read FKeepAliveTime Write FKeepAliveTime;
// (2) in the constructor THTTPSend.Create;
// right after this code :
FKeepAlive := True;
// add :
FKeepAliveTime := 300;
// change this code :
if not FKeepAlive then
FHeaders.Insert(0, 'Connection: close');
// to this new code :
if FKeepAlive then
begin
FHeaders.Insert(0, 'Keep-Alive: '+IntToStr(KeepAliveTime));
FHeaders.Insert(0, 'Connection: keep-alive');
end
else
FHeaders.Insert(0, 'Connection: close');