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: Brian Bruns <camber AT ais.org>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: Patch to fix PHP cancel problem with ASA-6
  • Date: Mon, 9 Sep 2002 11:43:09 -0400 (EDT)



The patch is (I believe) functional but it's purpose isn't that obvious if
you don't already know what's going on. I'd prefer to see an explicit
check after the 8 byte header has been read (with copious commenting). I'm
heading out to a funeral right now, so later tonight (EST) is the earliest
I can do this unless you want to take a crack at it before then.

We can revisit some of this in 0.61, but for now let's get the minimal
working change commited.

Brian

On 9 Sep 2002, Frediano Ziglio wrote:

> 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
>
>
>
> ---
> You are currently subscribed to freetds as: [camber AT ais.org]
> To unsubscribe, forward this message to $subst('Email.Unsub')
>
>





Archive powered by MHonArc 2.6.24.

Top of Page