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: James K. Lowden <jklowden AT speakeasy.org>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Cc: lbayuk AT mindspring.com
  • Subject: Re: Patch to fix PHP cancel problem with ASA-6
  • Date: Sun, 8 Sep 2002 22:57:49 -0400


On Sun, 8 Sep 2002 21:39:23 -0400 (EDT), "lbayuk AT mindspring.com"
<lbayuk AT mindspring.com> wrote:

> Here is a patch to src/tds/read.c which fixes the error handling problem
> I've been having with FreeTDS, PHP-4.2.3, and Sybase ASA-6, after PHP
> sends a Cancel. (This requires the previous fix already applied by Brian
> to tds_get_byte()).

Brian,

I've built and tagged R0_60, release candidate 1. You and Frediano made
changes recently to this very section of code, and I know it's important.


I won't apply the patch, because I don't understand the implications well
enough. But I will include it in an rc2 on your say-so.

--jkl

>
> I realize that messing with a critical function like tds_read_packet()
> close to a release is unwise, but I've placed the patch inside an
> existing error handling block to minimize potential harm. And I really,
> really need this, or FreeTDS+PHP+ASA is not usable.
>
> The patch does this: If reading the body of the packet didn't work
> (x<1), but the header said there weren't any bytes in the body anyway,
> then return 0 instead of the error code -1. This lets tds_get_byte()
> read through the body-less packet ASA sends after Cancel, read the Done
> packet it was meant to see, and stay in sync with the server. I think
> this was the intended behavior with recent patches to cancel processing,
> however they didn't work because tds_read_packet still returned -1 when
> it got a packet with only a header.
>
> --- src/tds/read.c.bak 2002-09-08 20:16:58.000000000 -0400
> +++ src/tds/read.c 2002-09-08 20:59:22.000000000 -0400
> @@ -386,7 +386,7 @@
> tds->in_len=0;
> tds->in_pos=0;
> tds->last_packet=1;
> - return(-1);
> + return(len ? -1 : 0);
> }
>
> /* Set the last packet flag */
>
> ---
> You are currently subscribed to freetds as: [jklowden AT speakeasy.org]
> To unsubscribe, forward this message to
> $subst('Email.Unsub')




Archive powered by MHonArc 2.6.24.

Top of Page