Re: TIdHTTPResponseInfo.SetResponseNo: What are the reasons the CloseConnection block is commented out in case of error ?

Giganews Newsgroups
Subject: Re: TIdHTTPResponseInfo.SetResponseNo: What are the reasons the CloseConnection block is commented out in case of error ?
Posted by:  Remy Lebeau \(Indy Team\) (no.spam@no.spam.com)
Date: Tue, 12 Jan 2010

"jgv" <jacques.garciavazqu…@telenet.be> wrote in message
news:4C2F1DFBCB9FE340jacques.garciavazqu…@telenet.be...

> From my experience, it seems that CloseConnection should be set
> to True in case of HTTP errors.

Why?

> Does there is a good reason why the code is commented out in
> TIdHTTPResponseInfo.SetResponseNo ?

Because there is no real need to force the connection closed on a non-socket
related error.  It allows the client a chance to fix the error and
re-request without the overhead of re-connecting.

--
Remy Lebeau (Indy Team)

Replies

In response to

TIdHTTPResponseInfo.SetResponseNo: What are the reasons the CloseConnection block is commented out in case of error ? posted by jgv on Tue, 12 Jan 2010