X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=banana%2Fnntpcore.inc.php;h=3029c081b04c3cc8a2ed5daa79412696ced0b062;hb=0fa5e39a1910258f64f32bfcc50a82d3b77ea736;hp=4b8e9c026f745a1c2aa5359cb762f887892f9e7b;hpb=951accf559f3dc5b3a2bbae9676d760c7a9f9ec9;p=banana.git diff --git a/banana/nntpcore.inc.php b/banana/nntpcore.inc.php index 4b8e9c0..3029c08 100644 --- a/banana/nntpcore.inc.php +++ b/banana/nntpcore.inc.php @@ -100,9 +100,10 @@ class BananaNNTPCore /** get a line from server * @return STRING */ - private function getLine() + private function &getLine() { - return rtrim(@fgets($this->ns, 1200), "\r\n"); + $data = rtrim(@fgets($this->ns, 1200), "\r\n"); + return $data; } /** fetch data (and on delimitor) @@ -111,11 +112,13 @@ class BananaNNTPCore private function &fetchResult() { $array = Array(); - while (($result = $this->getLine()) != '.') { - $array[] = $result; + while (($result =& $this->getLine()) != '.') { + $array[] =& $result; } if ($this->debug && $this->bt) { - $this->bt[count($this->bt) - 1]['response'] = count($array); + $trace =& $this->bt[count($this->bt) - 1]; + $trace['response'] = count($array); + $trace['time'] = microtime(true) - $trace['start']; } return $array; } @@ -131,7 +134,7 @@ class BananaNNTPCore } if ($this->debug) { $db_line = preg_replace('/PASS .*/', 'PASS *******', $line); - $this->bt[] = array('action' => $db_line, 'time' => microtime(true)); + $this->bt[] = array('action' => $db_line, 'start' => microtime(true)); } return @fputs($this->ns, $line, strlen($line)); } @@ -172,7 +175,7 @@ class BananaNNTPCore $this->lastresulttext = substr($result, 4); if ($this->debug && $this->bt) { $trace =& $this->bt[count($this->bt) - 1]; - $trace['time'] = microtime(true) - $trace['time']; + $trace['time'] = microtime(true) - $trace['start']; $trace['code'] = $this->lastresultcode; $trace['message'] = $this->lastresulttext; $trace['response'] = 0;