Skip to Content.
Sympa Menu

freetds - Re: [freetds] Patch to use configured connection timeout

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Jan Blom <jan.blom AT peopleinteractive.se>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Patch to use configured connection timeout
  • Date: Tue, 19 Apr 2016 11:29:05 +0000

Here is the patch against master.

Best regards,
Jan Blom

-----Original Message-----
From: FreeTDS [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of
Frediano Ziglio
Sent: den 19 april 2016 12:35
To: FreeTDS Development Group
Subject: Re: [freetds] Patch to use configured connection timeout

Patch is good but for compatibility I prefer to apply only to 1.0

Frediano


2016-04-18 21:36 GMT+01:00 Jan Blom <jan.blom AT peopleinteractive.se>:
> Hello,
>
> Using FreeTDS 0.95 in combination with unixODBC I notice that the
> connection timeout value configured in freetds.conf is never used when
> calling SQLDriverConnect. The attached patch makes us use the value from
> freetds.conf if we don't call SQLSetConnectAttr with
> SQL_ATTR_CONNECTION_TIMEOUT.
>
> The change is rather trivial. Let me know if you want me to produce a patch
> against head. Looking at the 1.0RC1 code it seems the issue is still
> present.
>
>
> Best regards,
> Jan Blom
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
--- freetds-master/src/odbc/odbc.c 2016-04-19 12:24:17.000000000 +0200
+++ freetds-1.0rc1_patched/src/odbc/odbc.c 2016-04-19 13:21:36.890390325
+0200
@@ -372,7 +372,11 @@

tds_fix_login(login);

- login->connect_timeout = dbc->attr.connection_timeout;
+ /* use connection timeout if set */
+ if (dbc->attr.connection_timeout != 0) {
+ login->connect_timeout = dbc->attr.connection_timeout;
+ }
+
if (dbc->attr.mars_enabled != SQL_MARS_ENABLED_NO)
login->mars = 1;
if (dbc->attr.bulk_enabled != SQL_BCP_OFF)



Archive powered by MHonArc 2.6.24.

Top of Page