Skip to Content.
Sympa Menu

freetds - error handling mire

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: error handling mire
  • Date: Sat, 24 Aug 2002 20:14:46 -0400


All,

src/tds/convert.c::tds_convert looks like this:

tds_convert(TDSCONTEXT *tds_ctx, ...

but the conversion functions need to call tds_client_msg(), which looks
like this:

tds_client_msg(TDSCONTEXT *tds_ctx, TDSSOCKET *tds ...

and they can't, because they lack a TDSSOCKET*.

As I understand it, TDSSOCKET::tds_ctx should point to a TDSCONTEXT, so if
you pass a TDSSOCKET, you don't have to pass its TDSCONTEXT.

I know, dbconvert() may be called with a NULL DBPROCESS*, and hence won't
have a socket or a context, and a context is really handy to
tds_client_msg(), because among other things it has a pointer to the
user-defined error message handler. What dbconvert will have to do is
make stuff up. It will have to construct a faux TDSSOCKET, gather the
default TDSCONTEXT from global template created in dbinit(), and call
tds_convert() with that.

Other libs will have to do similarly.

I'm going to modify all the "subconverters" (e.g., tds_convert_char) to
take as a first parameter a TDSSOCKET*. I will drop their srctype first
parameters, because they're not used.

--jkl






Archive powered by MHonArc 2.6.24.

Top of Page