[freetds] goodread... not so fine
alex.kiesel at document-root.de
Wed Jan 14 07:37:06 EST 2004
On Wed, 2004-01-14 at 11:04, ZIGLIO, Frediano, VF-IT wrote:
> @ /* When we get a timeout on select(), return 0. Don't
> return -1, because
> @ * that would lead to a disconnect
> @ * OTOH, do not let this pass to prevent an infinite
> loop when there is
> @ * no data on the wire */
> @ if (retcode == 0)
> @ return 0;
> This is quite bad. If we are not able to read data in 1 second we just
> return 0 (while from documentation we should never return 0). Also
> probably caller disconnect detecting a error (see tds_read_packet) so
> this code do not solve the problem... also returning 0 we discard
> already readed data (got bytes) and we lose syncro with server.
Yes, I agree with you. These two lines should be removed again. What I
wanted to achieve here, is to prevent an endless loop when all data from
the server has been read from wire - but tds tries to read more.
These lines don't fix the bug, but workaround it - but at the cost of
creating other bugs... So, it should be corrected.
More information about the FreeTDS