freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "James K. Lowden" <jklowden AT freetds.org>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] tds_connect does too much
- Date: Thu, 10 Jul 2008 11:33:29 -0400
ZIGLIO, Frediano, VF-IT wrote:
>
> 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.
Good observation. s/tds_login/tds_login_t/g perhaps?
> auto as protocol version, now tds_connect connect and disconnect
> as it wants...
Does the server disconnect if the login fails? If not, we can keep
re-trying login packets on the same connection.
Otherwise, I imagine this (simplified):
if ((conn = tds_connect()) == NULL)
return tdserror();
else
tds_login();
and in tds_login():
if (tdsver == 0) {
for( i=0; i < maxver; i++ ) {
tdsver = versions[i];
int fOK = tds_login(tdsver);
if( fOK )
return fOK;
if ((conn = tds_connect()) == NULL)
return tdserror();
}
}
if (i == maxver)
return tdserror();
/* call tdsX_send/do_login function ... */
There are other ways, too, of course.
Regards,
--jkl
-
[freetds] tds_connect does too much,
James K. Lowden, 07/09/2008
-
Re: [freetds] tds_connect does too much,
ZIGLIO, Frediano, VF-IT, 07/10/2008
-
Re: [freetds] tds_connect does too much,
James K. Lowden, 07/10/2008
-
Re: [freetds] tds_connect does too much,
ZIGLIO, Frediano, VF-IT, 07/11/2008
- Re: [freetds] tds_connect does too much, James K. Lowden, 07/11/2008
-
Re: [freetds] tds_connect does too much,
ZIGLIO, Frediano, VF-IT, 07/11/2008
-
Re: [freetds] tds_connect does too much,
James K. Lowden, 07/10/2008
-
Re: [freetds] tds_connect does too much,
ZIGLIO, Frediano, VF-IT, 07/10/2008
Archive powered by MHonArc 2.6.24.