X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fclientpool%2FSquidPurgeClient.php;h=be802f9bece5d07ca50b143bbbce4a10dddb6707;hb=64a38b3b854607498ea49342b68e9c44a0ea1390;hp=f454bd4c7c9292fdd50fd56834082ffea6a056a8;hpb=6e9b4f0e9ce4ccd6089c18b205065ef7fa077484;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/clientpool/SquidPurgeClient.php b/includes/clientpool/SquidPurgeClient.php index f454bd4c7c..be802f9bec 100644 --- a/includes/clientpool/SquidPurgeClient.php +++ b/includes/clientpool/SquidPurgeClient.php @@ -304,40 +304,40 @@ class SquidPurgeClient { */ protected function processReadBuffer() { switch ( $this->readState ) { - case 'idle': - return 'done'; - case 'status': - case 'header': - $lines = explode( "\r\n", $this->readBuffer, 2 ); - if ( count( $lines ) < 2 ) { + case 'idle': return 'done'; - } - if ( $this->readState == 'status' ) { - $this->processStatusLine( $lines[0] ); - } else { // header - $this->processHeaderLine( $lines[0] ); - } - $this->readBuffer = $lines[1]; - return 'continue'; - case 'body': - if ( $this->bodyRemaining !== null ) { - if ( $this->bodyRemaining > strlen( $this->readBuffer ) ) { - $this->bodyRemaining -= strlen( $this->readBuffer ); - $this->readBuffer = ''; + case 'status': + case 'header': + $lines = explode( "\r\n", $this->readBuffer, 2 ); + if ( count( $lines ) < 2 ) { return 'done'; + } + if ( $this->readState == 'status' ) { + $this->processStatusLine( $lines[0] ); + } else { // header + $this->processHeaderLine( $lines[0] ); + } + $this->readBuffer = $lines[1]; + return 'continue'; + case 'body': + if ( $this->bodyRemaining !== null ) { + if ( $this->bodyRemaining > strlen( $this->readBuffer ) ) { + $this->bodyRemaining -= strlen( $this->readBuffer ); + $this->readBuffer = ''; + return 'done'; + } else { + $this->readBuffer = substr( $this->readBuffer, $this->bodyRemaining ); + $this->bodyRemaining = 0; + $this->nextRequest(); + return 'continue'; + } } else { - $this->readBuffer = substr( $this->readBuffer, $this->bodyRemaining ); - $this->bodyRemaining = 0; - $this->nextRequest(); - return 'continue'; + // No content length, read all data to EOF + $this->readBuffer = ''; + return 'done'; } - } else { - // No content length, read all data to EOF - $this->readBuffer = ''; - return 'done'; - } - default: - throw new MWException( __METHOD__ . ': unexpected state' ); + default: + throw new MWException( __METHOD__ . ': unexpected state' ); } }