[phpcvsview-cvs-updates] phpcvsview phpcvs.php,1.12,1.13
Status: Pre-Alpha
Brought to you by:
bcheesem
From: Brian C. <bch...@us...> - 2004-10-02 08:43:45
|
Update of /cvsroot/p/ph/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15534 Modified Files: phpcvs.php Log Message: Fixed the scenario where the last line of a text file doesn't have a CR/LF causing a timeout on the TCP socket. Index: phpcvs.php =================================================================== RCS file: /cvsroot/p/ph/phpcvsview/phpcvsview/phpcvs.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** phpcvs.php 2 Oct 2004 04:52:10 -0000 1.12 --- phpcvs.php 2 Oct 2004 08:42:26 -0000 1.13 *************** *** 71,74 **** --- 71,75 ---- var $ANNOTATION = array(); // An array of the lines in the file which has been annotated. var $FILECONTENTS = ""; // A string to store the lines of the file contents in. + var $INITIALISED = false; // A boolean to indicate whether we have already sent the Root/ValidRequests/ValidResponses. /** *************** *** 675,686 **** // is the content of the file. if ($this->FINAL_RESPONSE) { $ReadLine = $this->SOCKET->readLine(); - $ReadLine = $this->SOCKET->readLine(); - $Counter = 0; - while($ReadLine != "ok"){ - $this->FILECONTENTS .= $ReadLine."\n"; - $ReadLine = $this->SOCKET->readLine(); - } // while - return true; } --- 676,682 ---- // is the content of the file. if ($this->FINAL_RESPONSE) { + $ContentLength = $this->SOCKET->readLine(); + $this->FILECONTENTS = $this->SOCKET->read($ContentLength); $ReadLine = $this->SOCKET->readLine(); return true; } *************** *** 703,709 **** function RLog($Folder) { ! $this->sendCVSROOT(); ! $this->sendValidResponses(); ! $this->sendValidRequests(); if (!$this->sendUseUnchanged()) { --- 699,708 ---- function RLog($Folder) { ! if (!($this->INITIALISED)) { ! $this->sendCVSROOT(); ! $this->sendValidResponses(); ! $this->sendValidRequests(); ! $this->INITIALISED = true; ! } if (!$this->sendUseUnchanged()) { *************** *** 711,715 **** } ! if (!$this->sendArgument($Folder)) { return false; } --- 710,722 ---- } ! if (strncmp($Folder, "/", 1) == 0) { ! $Directory = substr($Folder, 1); ! } ! else ! { ! $Directory = $Folder; ! } ! ! if (!$this->sendArgument($Directory)) { return false; } *************** *** 900,906 **** function Annotate($Name, $Revision = "") { ! $this->sendCVSROOT(); ! $this->sendValidResponses(); ! $this->sendValidRequests(); if (!$this->sendUseUnchanged()) { --- 907,916 ---- function Annotate($Name, $Revision = "") { ! if (!($this->INITIALISED)) { ! $this->sendCVSROOT(); ! $this->sendValidResponses(); ! $this->sendValidRequests(); ! $this->INITIALISED = true; ! } if (!$this->sendUseUnchanged()) { *************** *** 984,990 **** function ExportFile($FileName, $DateTime) { ! $this->sendCVSROOT(); ! $this->sendValidResponses(); ! $this->sendValidRequests(); if (strncmp($FileName, "/", 1) == 0) { --- 994,1003 ---- function ExportFile($FileName, $DateTime) { ! if (!($this->INITIALISED)) { ! $this->sendCVSROOT(); ! $this->sendValidResponses(); ! $this->sendValidRequests(); ! $this->INITIALISED = true; ! } if (strncmp($FileName, "/", 1) == 0) { |