Skip to Content.
Sympa Menu

freetds - Re: Patch to fix PHP cancel problem with ASA-6

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Patch to fix PHP cancel problem with ASA-6
  • Date: 09 Sep 2002 16:40:23 +0200


Il lun, 2002-09-09 alle 14:04, Brian Bruns ha scritto:
> len is overriden to be header len -8, so at this point i don't know what
> it is, could be -8 in which case it'll work, but not too obvious on
> reading the code.
>
> Brian
>

Now I understand the real problem...

x is initially 0.
This code is executed only if need <= 0, so we do not enter in read
loop. Then, error is reported if <0 else report 0 (we read an empty
packet).

Perhaps we should test if need < 0, close socket and return error (must
be some garbage...). If packet is empty (need == 0) we can just remove
this code ( if (x<1){ ...} ).

Inside loop we test if len == 0, but if len == 0 need == 0 and we do not
enter in loop...

On beginning of tds_read_packet we try to read header, if we read only a
part of packet we just don't close socket but return error. But we lose
partial information and lost sync, so on next call (if any) it try to
read header joining partial header with data. Perhaps is best to close
socket too...

Looping on goodread for read all packet seem not good... This can only
happen if read timeout but doing a loop until we read all is the same
thing of having an infinite timeout for reading packet.

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page