Compare commits

..

3 Commits

Author SHA1 Message Date
Daniele Alessandri f76d616d57 Bump VERSION. 2011-02-12 21:49:30 +01:00
Daniele Alessandri c41bb2c314 Fix bug reading zero-length values from a bulk response. 2011-02-12 21:48:18 +01:00
Daniele Alessandri d4fb7d9143 Update VERSION. 2011-02-12 21:30:52 +01:00
5 changed files with 17 additions and 3 deletions
+5
View File
@@ -1,3 +1,8 @@
v0.6.5 (2011-02-12)
* FIX: due to an untested internal change introduced in v0.6.4, a wrong
handling of bulk reads of zero-length values was producing protocol
desynchronization errors (ISSUE #20).
v0.6.4 (2011-02-12)
* Various performance improvements (15% ~ 25%) especially when dealing with
long multibulk replies or when using clustered connections.
+1 -1
View File
@@ -1 +1 @@
0.6.4
0.6.5
+1 -1
View File
@@ -578,7 +578,7 @@ class ResponseBulkHandler implements IResponseHandler {
));
}
if ($length >= 0) {
return $length > 0 ? substr($connection->readBytes($length + 2), 0, -2) : '';
return substr($connection->readBytes($length + 2), 0, -2);
}
if ($length == -1) {
return null;
+6
View File
@@ -381,6 +381,12 @@ class PredisClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
});
}
function testResponseReader_EmptyBulkResponse() {
$this->assertTrue($this->redis->set('foo', ''));
$this->assertEquals('', $this->redis->get('foo'));
$this->assertEquals('', $this->redis->get('foo'));
}
/* Client + CommandPipeline */
+4 -1
View File
@@ -89,8 +89,11 @@ class RedisCommandTestSuite extends PHPUnit_Framework_TestCase {
function testGet() {
$this->redis->set('foo', 'bar');
$this->assertEquals('bar', $this->redis->get('foo'));
$this->assertTrue($this->redis->set('foo', ''));
$this->assertEquals('', $this->redis->get('foo'));
$this->assertNull($this->redis->get('fooDoesNotExist'));
// should throw an exception when trying to do a GET on non-string types