Skip to Content.
Sympa Menu

freetds - Re: [freetds] How to cancel ct_results ?

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] How to cancel ct_results ?
  • Date: Wed, 16 Sep 2009 21:46:53 -0400

jarek AT poczta.srv.pl wrote:
> Cytowanie "James K. Lowden" <jklowden AT freetds.org>:
> > Timeout logic is tricky, and no one has done much
> > with the ct-lib code since I re-wrote the libtds layer to correctly
> > handle timeouts (for the first time) in db-lib. What ct-lib needs is
> > someone with interest and knowledge to apply himself to the problem.
>
> After some debugging, I've found that the problem comes from
> gnutls_record_recv.
> There are few solutions:
> 1. Change the socket to non-blocking, but this probably need some
> changes also in other places where this socket is used.
> 2. Add select with timeout before socket read/write.
> 3. Send some signal or close socket from parallel thread after timeout
> (I'm not sure if it will help).

Hi Jarek,

To support db-lib in particular you need a non-blocking socket. That's
what the normal (non-TLS) logic uses. Look at tds_goodread() and
tds_select(). There's logic for timeouts and for calling a user-defined
function while waiting.

It seems to me that goodread() is no help: gnutls_record_recv() should be
called inside tds_goodread() instead, perhaps by altering the READSOCKET
macro. It might be that easy.

Regards,

--jkl






Archive powered by MHonArc 2.6.24.

Top of Page