summaryrefslogtreecommitdiff
path: root/ext/sybase_ct/php_sybase_ct.c
diff options
context:
space:
mode:
authorTimm Friebe <thekid@php.net>2004-08-21 17:54:11 +0000
committerTimm Friebe <thekid@php.net>2004-08-21 17:54:11 +0000
commit7035a224b5feb50065bf854d80e16f7005c04d4c (patch)
treecd818e1b402004f04fdbb752222325e9a3902cd2 /ext/sybase_ct/php_sybase_ct.c
parentdd5538566e83eba0edde9a29eef1e80d5092f4b5 (diff)
downloadphp-git-7035a224b5feb50065bf854d80e16f7005c04d4c.tar.gz
- Fixed packet size setting
# Patch by Alex Kiesel
Diffstat (limited to 'ext/sybase_ct/php_sybase_ct.c')
-rw-r--r--ext/sybase_ct/php_sybase_ct.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c
index e9037c56c3..e49a4a7856 100644
--- a/ext/sybase_ct/php_sybase_ct.c
+++ b/ext/sybase_ct/php_sybase_ct.c
@@ -190,6 +190,7 @@ static void _close_sybase_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
}
}
+ ct_cmd_drop(sybase_ptr->cmd);
ct_con_drop(sybase_ptr->connection);
efree(sybase_ptr);
SybCtG(num_links)--;
@@ -399,14 +400,6 @@ static void php_sybase_init_globals(zend_sybase_globals *sybase_globals)
}
}
- /* 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 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
{
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 @@ static int php_sybase_do_connect_internal(sybase_link *sybase, char *host, char
}
}
}
+
+ 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