freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
[freetds] port setting in the global section of the config file does not work
- From: christos AT zoulas.com (Christos Zoulas)
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: [freetds] port setting in the global section of the config file does not work
- Date: Thu, 17 Jun 2004 15:13:06 -0400
Hello,
Here's a bug fix for the configuration parsing code. In the following
scenario:
1. host not specified in the configuration file
2. port specified in the global section of the configuration file
The code just went and trashed the connection port with 4000 or 1433.
The following fix changes that. I.e. if there is a global setting for
the port number, we use this instead of the 4000/1433. This can get
overriden by the environment setting.
christos
Index: config.c
===================================================================
RCS file: /src/twosigma/cvsroot/pub/devel/freetds/src/tds/config.c,v
retrieving revision 1.9
diff -u -u -r1.9 config.c
--- config.c 17 Jun 2004 18:55:49 -0000 1.9
+++ config.c 17 Jun 2004 19:09:11 -0000
@@ -950,11 +950,23 @@
* Make a guess about the port number
*/
+ if (connection->port == 0) {
+ /*
+ * Not set in the [global] section of the
+ * configure file, take a guess.
+ */
#ifdef TDS50
- ip_port = 4000;
+ ip_port = 4000;
#else
- ip_port = 1433;
+ ip_port = 1433;
#endif
+ } else {
+ /*
+ * Preserve setting from the [global] section
+ * of the configure file.
+ */
+ ip_port = connection->port;
+ }
if ((env_port = getenv("TDSPORT")) != NULL) {
ip_port = tds_lookup_port(env_port);
tdsdump_log(TDS_DBG_INFO1, "%L Setting 'ip_port' to
%s from $TDSPORT.\n", env_port);
-
RE: [freetds] [ freetds-Patches-974778 ] bcp upgrade anddbbind/dbnullbind,
Lowden, James K, 06/17/2004
-
[freetds] port setting in the global section of the config file does not work,
Christos Zoulas, 06/17/2004
- Re: [freetds] port setting in the global section of the config file does not work, Christos Zoulas, 06/17/2004
-
Re: [freetds] port setting in the global section of the config file does not work,
James K. Lowden, 06/19/2004
- Re: [freetds] port setting in the global section of the config file does not work, Christos Zoulas, 06/19/2004
-
[freetds] port setting in the global section of the config file does not work,
Christos Zoulas, 06/17/2004
Archive powered by MHonArc 2.6.24.