Skip to content

Keep-Alive fixes

Various Keep-Alive fixes:

1.) ssockets: implement TSocketHandler.CanRead: I reused the code from TSocketServer.RunIdleLoop.

2.) fix compilation: I compiled on win-i386 and there is no InterlockedIncrement64 available. It is available only in the 64bit compiler.

Since the _RequestCount is used only for the ID, it should be OK to start from 0 again when the limit is reached (?) - I don't know if range checking applies to InterlockedIncrement but if yes, it should be disabled for the InterlockedIncrement uses.

3.) TFPCustomHttpServer: make HandleUnexpectedError a normal method - is there a reason to have a class pmethod for it? Why not to do it the normal way like with HandleRequestError?

4.) fphttpserver: rename KeepAliveEnabled to KeepConnections: I know I introduced the KeepAlive properties - but at that time I didn't realize that the client already has the KeepConnection property. Therefore I renamed the public properties in the server to KeepConnection*. I kept only the KeepAlive property in the connection object that holds the value if the KeepAlive is set for the current connection.

Merge request reports