Skip to Content.
Sympa Menu

freetds - Re: WARNING: Changing tds_connect() API

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Castellano, Nicholas" <Nicholas_Castellano AT acml.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: WARNING: Changing tds_connect() API
  • Date: Thu, 12 Sep 2002 15:54:49 -0400


OK, I'll add and use tds_close_socket().

I'm still hesitant about moving tds_free_socket() outside. There are 8
calls right now, but moving it outside will create one for every caller to
tds_connect(), scattered all over the tree (and outside it in user code).
It seems less clean to me, but if you feel really strongly about this then
I'll go ahead with it.

Cheers,
--nick

-----Original Message-----
From: bounce-freetds-145195 AT franklin.oit.unc.edu
[mailto:bounce-freetds-145195 AT franklin.oit.unc.edu]
Sent: Thursday, September 12, 2002 3:43 PM
To: TDS Development Group
Subject: [freetds] Re: WARNING: Changing tds_connect() API


> OK, I was forgetting the bit in dbdead() where it checks tds->s. So I
> reworked my changes along the lines you suggested, and I will upload a
> new patch for review.

Sounds good.

> I didn't bother to make a tds_close_socket() function, since it isn't
> likely to be needed anywhere else.

Might be nice for clarity. IIRC, somebody has a disconnect/reconnect patch
floating around somewhere that this might be useful for. If we provide a
clean mechanism now, hopefully it will get used in the future.

> I also didn't move the tds_free_socket() calls out of tds_connect().
> I don't want to make the caller do any more work than is necessary, so
> it seems fine to leave that as is.

There are 8 calls to tds_free_socket() inside tds_connect, it might be
simpler to move them outside. Not to mention that given:

tds = tds_alloc_socket(context, 512);
/* ...blah blah... */
tds_connect(tds, login);

My socket is magically deallocated when I call tds_connect? Looking at that
code, I'd intuitively think I'm responsible for free'ing.

I'm realizing now that I made the wrong decision when we added the 'parent'
argument to tds_connect() the first time around to allow messages to be
generated on unconnected sockets, and should have done this then. You'll
note some commented out calls to tds_set_parent(). C'est la vie!

> Cheers,
> --nick

Cheers,

Brian

---
You are currently subscribed to freetds as: [Nicholas_Castellano AT acml.com]
To unsubscribe, forward this message to
$subst('Email.Unsub')


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that for certain accounts we do not accept
orders and/or instructions by e-mail, and for those accounts we will not be
responsible for carrying out such orders and/or instructions. Kindly refrain
from sending orders or instructions by e-mail unless you have confirmed that
we accept such communications for your account. Please also note that to
satisfy regulatory requirements we review the outgoing and incoming e-mail
correspondence of staff members serving certain functions.






Archive powered by MHonArc 2.6.24.

Top of Page