chandrasis / php-handlersocket

Automatically exported from code.google.com/p/php-handlersocket
0 stars 0 forks source link

segmentation fault on wrong parameters count and no timeout parameter for handlersocket library #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
<?php
$host = '192.168.1.250';
$port = 9998;
$port_wr = 9999;
$timeout = 5;
$dbname = 'hstestdb';
$table = 'hstesttbl';
$hs = new HandlerSocket($host);
if (!($hs->openIndex(1, $dbname, $table, HandlerSocket::PRIMARY, 'k,v')))
{
    echo __LINE__, ':', $hs->getError(), ':', PHP_EOL;
    die();
}

What is the expected output? What do you see instead?
14::
I see segmentation fault

What version of the product are you using? On what operating system?
trunk 
Repository Root: http://php-handlersocket.googlecode.com/svn
Repository UUID: 4c154c70-137a-cad6-8d9a-0cdd73844609
Revision: 28

with PHP 5.3.5-1ubuntu7.2 with Suhosin-Patch (cli) (built: May  2 2011 23:00:17)

Please provide any additional information below.
The attached patch contains fix for segmentation fault and implements optional 
timeout parameter.

within additional patch for handlersocket client library 
https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL/pull/61
It allows to set connect/read/write timeout in seconds.

Original issue reported on code.google.com by ihan...@gmail.com on 3 Aug 2011 at 12:21

Attachments: