Skip to Content.
Sympa Menu

freetds - Re: [PATCH] goodread() fix *re-submitted*

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: James Cameron <cameron AT fax.sno.cpqcorp.net>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: [PATCH] goodread() fix *re-submitted*
  • Date: Fri, 15 Mar 2002 09:12:00 +1100


Steve Willer wrote:
> Could someone please put the proper fix into src/tds/read.c, around line
> 91? Here it is, below:
>
> while (got < buflen) {
> int thisgot;
> thisgot = READ(tds->s, buf + got, buflen - got);
> if (thisgot <= 0) break;
> got += thisgot;
> }

I started in on this and hesitated ... is it correct for it to return
what it has even if the connection has closed or failed? Code above
this point returns -1.

Here is my merge ...

===================================================================
RCS file: /cvsroot/freetds/freetds/src/tds/read.c,v
retrieving revision 1.5
diff -u -r1.5 read.c
--- read.c 31 Jan 2002 02:21:44 -0000 1.5
+++ read.c 14 Mar 2002 22:08:27 -0000
@@ -89,12 +89,13 @@
}
}
} /* while buflen... */
- } else {
+ } else { /* if (tds->timeout) */
/* got = READ(tds->s, buf, buflen); */
while (got < buflen) {
- got += READ(tds->s, buf + got, buflen - got);
+ len = READ(tds->s, buf + got, buflen - got);
+ if (len <= 0) break;
+ got += len;
}
-
}

return (got);

--
James Cameron (james.cameron AT compaq.com)

http://quozl.linux.org.au/ (or) http://quozl.netrek.org/




Archive powered by MHonArc 2.6.24.

Top of Page