On Wed, Apr 07, 2004 at 06:24:20AM -0700, Arek Jankowski wrote:
> In version 2.6.3 (also 3.0.0) I'm experiencing the
> following issue. When I list files in a directory
> using
>
> cls | less
>
> and there are more than 1 screen of files then lftp
> takes almost 100% of CPU. Same happens for "cls |
Please try this patch.
--
Alexander. | http://www.yars.free.net/~lav/
Index: OutputJob.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/OutputJob.cc,v
retrieving revision 1.10
diff -u -p -r1.10 OutputJob.cc
--- OutputJob.cc 1 Dec 2003 07:46:23 -0000 1.10
+++ OutputJob.cc 8 Apr 2004 10:43:49 -0000
@@ -311,6 +311,10 @@ bool OutputJob::ShowStatusLine(StatusLin
return true;
}
+ /* Don't disable write if there are data to be written in buffer */
+ if(output->GetCopy()->WriteAllowed() && output->GetCopy()->WritePending())
+ return false;
+
/* There hasn't been output in a while. Stop the output again,
* so the FileCopy will clear the StatusLine when there's more data. */
output->GetCopy()->AllowWrite(false);