Skip to Content.
Sympa Menu

freetds - Re: [PATCH] Solaris/Intel client, Sybase server: Unknown marker: 105!!

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Steve Willer <willer AT novator.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Cc: CRAIGJ AT epub.med.iacnet.com
  • Subject: Re: [PATCH] Solaris/Intel client, Sybase server: Unknown marker: 105!!
  • Date: Wed, 22 Aug 2001 19:10:23 -0400 (EDT)



On Wed, 22 Aug 2001, Craig Jackson wrote:

> > while (got < buflen) {
> > got += READ(tds->s, buf + got, buflen - got);
> > }
>
> This look like it could go into an infinite loop if READ returned 0 (EOF).
> Is this checked for in the definition of READ?

Good point. No, READ is just a macro wrapping around a simple read() call
in Unix and recv() in Windows I think.

I guess you need it a bit different:

while (got < buflen) {
int thisgot;
thisgot = READ(tds->s, buf + got, buflen - got);
if (!thisgot) break;
got += thisgot;
}

hope I got the C right; I'm more of a Perl hacker nowadays.





Archive powered by MHonArc 2.6.24.

Top of Page