Re: [PHP4BETA] Sybase-CT Compilation

From: Date: Thu, 03 Jun 1999 11:00:56 +0000
Subject: Re: [PHP4BETA] Sybase-CT Compilation
References: 1 2 3 4 5  Groups: php.version4 
Request: Send a blank email to php-version4+get-1262@lists.php.net to get a copy of this message
On Thu, Jun 03, 1999 at 12:47:58PM +0200, Willo vd Merwe wrote: > Hi Sascha, > > > I tried to express that the code uses "dummy", but replacing the arguments > > used on line 620 for php3_sybct_do_connect with > > INTERNAL_FUNCTION_PARAM_PASSTHRU would use return_value (hence dummy != > > return_value). > Hmm... Seems I'm the dummy here :) Totally misunderstood... > > > It appears to me that the function simply calls the connection function to > > create a link. If the code works, it is alright. > Yes, that's what I thought, and I got the > INTERNAL_FUNCTION_PARAM_PASSTHRU from looking at some other functions. > It compiles without any hassles, but hen I try to make a connection, the > script stops execution without any warnings or errors - even the apache > error_log is empty! > > Any ideas? Try the attached patch. The dummy hashtable was used for presenting no arguments to the sybct_do_connect function (if I read the code correct). Since ht is only an integer in PHP4, we simple can define it to 0 to achieve the same result. -- Regards, Sascha Schumann Consultant

Index: sybase-ct.c =================================================================== RCS file: /repository/php4/ext/sybase/sybase-ct.c,v retrieving revision 1.4 diff -u -r1.4 sybase-ct.c --- sybase-ct.c 1999/05/21 10:06:19 1.4 +++ sybase-ct.c 1999/06/03 10:00:14 @@ -616,11 +616,10 @@ static int php3_sybct_get_default_link(INTERNAL_FUNCTION_PARAMETERS) { if (php3_sybct_module.default_link==-1) { /* no link opened yet, implicitly open one */ - HashTable dummy; - _php3_hash_init(&dummy,0,NULL,NULL,0); - php3_sybct_do_connect(&dummy,return_value,list,plist,0); - _php3_hash_destroy(&dummy); +#define ht 0 + php3_sybct_do_connect(INTERNAL_FUNCTION_PARAM_PASSHTRU,0); +#undef ht } return php3_sybct_module.default_link; }
« previous php.version4 (#1262) next »