Skip to Content.
Sympa Menu

freetds - RE: [ freetds-Patches-575613 ] Do not use global msg/err handlers

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "Freetds (E-mail)" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: [ freetds-Patches-575613 ] Do not use global msg/err handlers
  • Date: Mon, 1 Jul 2002 10:43:47 +0200


>
> >Status: Closed
> >Resolution: Rejected
> Priority: 5
> Submitted By: Frediano Ziglio (freddy77)
> Assigned to: Nobody/Anonymous (nobody)
> Summary: Do not use global msg/err handlers
>
> Initial Comment:
> Why?
>
> Is some environment (think as apache with perl/db,
> php/odbc and php/sybase) g_tds_err_handler and
> g_tds_msg_handler (global pointer to function to catch
> messages and errors from tds) can be shared between
> some library (odbc, ctlib, dblib) causing some problem
> (error sended to wrong library). This can depend also
> by the system and how shared oject is loaded.
>
> How?
> I removed global variable and add member to TDSLOGIN
> (to catch also login problems) and TDSSOCKET and change
> all dependency.
>
> freddy77
>
>
>
> ----------------------------------------------------------------------
>
> >Comment By: Brian Bruns (brianb)
> Date: 2002-06-30 13:19
>
> Message:
> Logged In: YES
> user_id=11673
>
> TDSLOGIN is the wrong place to put this. I would strongly
> recommend placing it in the TDS_CONTEXT structure (which is
> currently only used in dblib which has a implicit context)
> and allocating that within cs_ctx_alloc() for ctlib and
> SQLAllocEnv() for ODBC. Let's discuss implementation on list.
>
Ok, let's talking about. Your guess is true, I finally add stuff in TDSLOGIN
very fastly, perhaps isn't the good place.

TDSSOCKET seem the good place to replace global variable.
I used TDSLOGIN because timeout setting are placed also in TDSLOGIN. You
suggest to use TDSCONTEXT but tds sources have no refereer to TDSCONTEXT,
only to TDSSOCKET.

Configuration must be available at connect (or before) so perhaps instead of
passing a TDSLOCINFO to tds_connect we should pass another param
(TDSCONTEXT? ).

freddy77

=================================
"STRICTLY PERSONAL AND CONFIDENTIAL

This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies.
The contents of this message that do not relate to the official business of
our company shall be understood as neither given nor endorsed by it."

=================================




Archive powered by MHonArc 2.6.24.

Top of Page