Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12197 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89376 invoked by uid 1010); 17 Aug 2004 22:16:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 89352 invoked from network); 17 Aug 2004 22:16:39 -0000 Received: from unknown (HELO netgecko.info) (217.160.92.122) by pb1.pair.com with SMTP; 17 Aug 2004 22:16:39 -0000 Received: from [192.168.2.110] (dsl-213-023-052-047.arcor-ip.net [213.23.52.47]) by netgecko.info (Postfix) with ESMTP id 8AF99883D3; Wed, 18 Aug 2004 00:20:39 +0200 (CEST) To: internals@lists.php.net Cc: php_sybase_ct@thekid.de Content-Type: multipart/mixed; boundary="=-qdGyaMFExVY4A6N2g2dy" Message-ID: <1092780992.758.26.camel@boost.home.ahk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 18 Aug 2004 00:16:33 +0200 Subject: [patch] Fix setting of packetsize in ext/sybase_ct From: alex.kiesel@document-root.de (Alex Kiesel) --=-qdGyaMFExVY4A6N2g2dy Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi internals, the attached patch fixes the setting of packetsize in sybase_ct extension. Currently the packetsize is set via ct_config() which is not the right function for this - it should be done via ct_con_props() as this is a connection property according to Sybase docs. A small memory leak fix is included as well. Regards, -Alex --=-qdGyaMFExVY4A6N2g2dy Content-Disposition: attachment; filename=php_sybase_c.diff Content-Type: text/x-patch; name=php_sybase_c.diff; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Index: ext/sybase_ct/php_sybase_ct.c =================================================================== RCS file: /repository/php-src/ext/sybase_ct/php_sybase_ct.c,v retrieving revision 1.99 diff -u -r1.99 php_sybase_ct.c --- ext/sybase_ct/php_sybase_ct.c 29 Jul 2004 19:32:46 -0000 1.99 +++ ext/sybase_ct/php_sybase_ct.c 17 Aug 2004 22:09:52 -0000 @@ -190,6 +190,7 @@ } } + ct_cmd_drop(sybase_ptr->cmd); ct_con_drop(sybase_ptr->connection); efree(sybase_ptr); SybCtG(num_links)--; @@ -399,14 +400,6 @@ } } - /* Set the packet size, which is also per context */ - if (cfg_get_long("sybct.packet_size", &opt)==SUCCESS) { - CS_INT cs_packet_size = opt; - if (ct_config(sybase_globals->context, CS_SET, CS_PACKETSIZE, &cs_packet_size, CS_UNUSED, NULL)!=CS_SUCCEED) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update the packet size"); - } - } - sybase_globals->num_persistent=0; sybase_globals->callback_name = NULL; } @@ -473,6 +466,7 @@ { CS_LOCALE *tmp_locale; TSRMLS_FETCH(); + long packetsize; /* set a CS_CONNECTION record */ if (ct_con_alloc(SybCtG(context), &sybase->connection)!=CS_SUCCEED) { @@ -520,6 +514,12 @@ } } } + + if (cfg_get_long("sybct.packet_size", &packetsize) == SUCCESS) { + if (ct_con_props(sybase->connection, CS_SET, CS_PACKETSIZE, (CS_VOID *)&packetsize, CS_UNUSED, NULL) != CS_SUCCEED) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Unable to update connection packetsize."); + } + } /* Set the login timeout. Actually, the login timeout is per context * and not per connection, but we will update the context here to --=-qdGyaMFExVY4A6N2g2dy--