Skip to Content.
Sympa Menu

freetds - Re: [freetds] dbsqlexec() never returns

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] dbsqlexec() never returns
  • Date: Thu, 31 May 2007 14:10:55 -0400

Perception Technologies Ltd wrote:
> the Solaris man page for select(3c) states that if a select() call
> times out, then the three fds parameters have their bits cleared. In
> the FreeTDS tds_select() function (in net.c), the select() call is in a
> loop with a 1 second time out, so if the socket is not available for
> writing within the first second, then it will pointlessly wait the
> remaining period of the configuration timeout, and then timeout.

My man page doesn't say that; I'll check Stevens when I get home.

I'll also modify src/dblib/unittests/timeout.c to check for this
condition. The test checks to make sure timeouts return control to the
application. It doesn't check to make sure communication resumes if the
server comes alive after the first 1-second timeout.

I'd be surprised if that doesn't work correctly on your box, though. The
1-second timeout is in effect only if dbsetinterrupt() was called.
Otherwise, the loop executes only once unless EINTR, in which case,
according to my man page (NetBSD 2.0):

"If select() returns with an error, including one due to an
interrupted call, the descriptor sets will be unmodified."

and all should be well.

Regards,

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page