Permalink
Browse files

BUGFIX: Partial fix to sphinx API to prevent "failed to send client p…

…rotocol version" error. Created a patch, which just involves commenting out an feof() call which is giving unpredictable results, and causing a spurious error.
  • Loading branch information...
1 parent c0388d9 commit 4840a545f5945d2449095caef479bb4cc5cd444f @mrmorphic mrmorphic committed Nov 16, 2009
Showing with 14 additions and 1 deletion.
  1. +1 −1 thirdparty/sphinxapi.php
  2. +13 −0 thirdparty/sphinxapi.php.failed_protocol_fix.patch
View
@@ -497,7 +497,7 @@ function SetConnectTimeout ( $timeout )
function _Send ( $handle, $data, $length )
{
- if ( feof($handle) || fwrite ( $handle, $data, $length ) !== $length )
+ if ( /* feof($handle) || */ fwrite ( $handle, $data, $length ) !== $length )
{
$this->_error = 'connection unexpectedly closed (timed out?)';
$this->_connerror = true;
@@ -0,0 +1,13 @@
+Index: sphinx/thirdparty/sphinxapi.php
+===================================================================
+--- sphinx/thirdparty/sphinxapi.php (revision 91804)
++++ sphinx/thirdparty/sphinxapi.php (working copy)
+@@ -497,7 +497,7 @@
+
+ function _Send ( $handle, $data, $length )
+ {
+- if ( feof($handle) || fwrite ( $handle, $data, $length ) !== $length )
++ if ( /* feof($handle) || */ fwrite ( $handle, $data, $length ) !== $length )
+ {
+ $this->_error = 'connection unexpectedly closed (timed out?)';
+ $this->_connerror = true;

0 comments on commit 4840a54

Please sign in to comment.