Skip to Content.
Sympa Menu

freetds - RE: [freetds] something broken in ct-library

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "'freetds AT lists.ibiblio.org'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] something broken in ct-library
  • Date: Wed, 15 Jan 2003 14:11:27 +0100

>
> Freddy,
>
> The snapshot From jan 9th (a.m) seems to work fine.
> I'll have a look at changes committed since then.
>
> Bill
>

Perhaps problem is this:

Sun Jan 12 11:03:41 CEST 2003 Frediano Ziglio <freddy77 AT angelfire.com>
* src/ctlib/unittests/connect_fail.c(added):
* src/ctlib/ct.c src/ctlib/unittests/.cvsignore:
* src/ctlib/unittests/Makefile.am:
- fix core in ctlib closing a failed connection

But modified another things...

ct.c diff (from 9/1 to current CVS):
@@ -330,24 +330,30 @@
} else if (snamelen == CS_NULLTERM) {
server = (char *) servername;
} else {
server = (char *) malloc(snamelen + 1);
needfree++;
strncpy(server, servername, snamelen);
server[snamelen] = '\0';
}
tds_set_server(con->tds_login, server);
ctx = con->ctx;
- con->tds_socket = tds_alloc_socket(ctx->tds_ctx, 512);
+ if (!(con->tds_socket = tds_alloc_socket(ctx->tds_ctx, 512)))
+ return CS_FAIL;
tds_set_parent(con->tds_socket, (void *) con);
- connect_info = tds_read_config_info(NULL, con->tds_login,
ctx->tds_ctx->
locale);
- if (!connect_info || tds_connect(con->tds_socket, connect_info) ==
TDS_F
AIL) {
+ if (!(connect_info = tds_read_config_info(NULL, con->tds_login,
ctx->tds
_ctx->locale))) {
+ tds_free_socket(con->tds_socket);
+ con->tds_socket = NULL;
+ return CS_FAIL;
+ }
+ if (tds_connect(con->tds_socket, connect_info) == TDS_FAIL) {
+ con->tds_socket = NULL;
tds_free_connect(connect_info);
if (needfree)
free(server);
tdsdump_log(TDS_DBG_FUNC, "%L leaving ct_connect() returning
%d\
n", CS_FAIL);
return CS_FAIL;
}
tds_free_connect(connect_info);

if (needfree)
free(server);
@@ -780,20 +786,21 @@
free(cmd);
}
return CS_SUCCEED;
}

CS_RETCODE
ct_close(CS_CONNECTION * con, CS_INT option)
{
tdsdump_log(TDS_DBG_FUNC, "%L inside ct_close()\n");
tds_free_socket(con->tds_socket);
+ con->tds_socket = NULL;
return CS_SUCCEED;
}


CS_RETCODE
ct_con_drop(CS_CONNECTION * con)
{
tdsdump_log(TDS_DBG_FUNC, "%L inside ct_con_drop()\n");
if (con) {
if (con->userdata)

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