[Lazarus] CGI Response.ContentStream client break

Leonardo M. Ramé l.rame at griensu.com
Thu Jul 3 21:51:34 CEST 2014


Hi, I have a CGI program that serves some files using this code in an
action:

AResponse.ContentStream := TFileStream.Create(lImagePath, fmOpenRead);

The problem I'm facing is that some times the client breaks the
connection to the server, aparently leaving the file open. If the client
tries to download the file again, a code 500 is returned.

Is there a way to detect the connection break and destroy the stream
gracefully?.

Regards,
-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com




More information about the Lazarus mailing list