Skip to Content.
Sympa Menu

freetds - Re: [freetds] tds_connect does too much

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] tds_connect does too much
  • Date: Thu, 10 Jul 2008 16:54:35 +0200

>
> tds_connect() connects to the server and logs in. I plan to
> change it to
> only connect. tds_connect() will return immediately from
> tds_open_socket().
>
> The rest of the logic, the part that sends the login packet,
> will be moved
> to a new function. But what to call it? Our namespace is so
> crowded!
> Ideally, it would be called tds_login(), but tds_login is a data
> structure. Next best is tds_send_login(), but that's already
> taken for
> sending 4.2/5.0 login packets.
>

Mmm... tds_send_login is not that fine, perhaps it's better to rename
tds_login structure to
_tds_login (cause we only use TDSLOGIN) and add a tds_login.

> Best is to rename tds_send_login() to tds5_send_login(), and
> call the new
> function tds_send_login().
>
> This will make it easier to distinguish between network-level
> errors --
> DNS lookup errors, server not listening -- from login failures.
>
> It will also make it possible to change tsql to make -U and
> -P optional,
> so the user could be prompted for a username after the connection was
> made. You'll be able to see the difference between network and
> authentication failures:
>
> $ tsql -S servername
> locale is "C"
> locale charset is "646"
> connected, please log in
> username: superman
> password: ********
> 1>
>
> or
>
> $ tsql -S servername
> locale is "C"
> locale charset is "646"
> Msg 20008, Level 9, State -1, Server OpenClient, Line -1
> Unable to open socket
> There was a problem connecting to the server
>
> Eventually I'd like to see functionality like this:
>
> $ tsql
> locale is "C"
> locale charset is "646"
> servername: elixer
> elixer not found in /home/username/.freetds.conf
> elixer not found in /etc/freetds.conf
> /etc/interfaces not found
> elixer.example.com has address 10.1.1.14
> connecting to port 4000 with TDS version 5.0
> Msg 20008, Level 9, State -1, Server OpenClient, Line -1
> Unable to open socket
> There was a problem connecting to the server
>
> But that requires rewriting the configuration file parser....
>
> Comments welcome.
>

I found only a problem... auto as protocol version, now tds_connect connect
and disconnect
as it wants...

freddy77

Attachment: smime.p7s
Description: S/MIME cryptographic signature




Archive powered by MHonArc 2.6.24.

Top of Page