Patch for sybase_connect (segfault) problem on win32
| From: | Tor-Egil Nygaard | Date: | Thu, 01 Feb 2001 18:05:37 +0000 |
| Subject: | Patch for sybase_connect (segfault) problem on win32 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-45543@lists.php.net to get a copy of this message | ||
It seems like the declaration of the "_client_message_handler" (line 197)
and the
"_server_message_handler" (line 220) in "ext/sybase_ct/sybase_ct.c" are
wrong.
According to the sybase sample code, found in "/sybase..../sample/exutils.h"
they
are supposed to be declared not only as CS_RETCOD, but also as CS_PUBLIC.
This has also been mention by fabien@usa.net in bug report
http://bugs.php.net/?id=8836
Which would make the statement on line 197 look like
extern CS_RETCODE CS_PUBLIC _client_message_handler(CS_CONTEXT *context,
CS_CONNECTION *connection, CS_CLIENTMSG *errmsg)
instead of
static CS_RETCODE _client_message_handler(CS_CONTEXT *context,
CS_CONNECTION *connection, CS_CLIENTMSG *errmsg)
and the statement on line 220 should look like
extern CS_RETCODE CS_PUBLIC _server_message_handler(CS_CONTEXT *context,
CS_CONNECTION *connection, CS_SERVERMSG *srvmsg)
instead of
static CS_RETCODE _server_message_handler(CS_CONTEXT *context,
CS_CONNECTION *connection, CS_SERVERMSG *srvmsg)
I have tested this change on Windows NT/2000 and SuSE Linux without
experiencing any problems.
Without the change php gives a memory fault on Windows NT/2000 after
sybase_(p)connect if you are
using llibct.dll version 11.x.x. If you are using libct.dll version 10.04 it
works ok, but this is a version sybase
is about to stop supporting.
Could someone please put this into the cvs so it will be for PHP version
4.0.5.
TIA
Regards
Tor-Egil Nygaard