diff --git a/lib/Phirehose.php b/lib/Phirehose.php index f26b16b..4b37a17 100644 --- a/lib/Phirehose.php +++ b/lib/Phirehose.php @@ -464,6 +464,10 @@ public function consume($reconnect = TRUE) //Process each full tweet inside $this->buff while(1){ $eol = strpos($this->buff,"\r\n"); //Find next line ending + if($eol===0) { // if 0, then buffer starts with "\r\n", so trim it and loop again + $this->buff = substr($this->buff,$eol+2); // remove the "\r\n" from line start + continue; // loop again + } if($eol===false)break; //Time to get more data $enqueueStart = microtime(TRUE); $this->enqueueStatus(substr($this->buff,0,$eol));