(read_process_output): Only activate adaptive

buffering if we read less than 256 bytes at a time.
This commit is contained in:
Kim F. Storm 2004-01-06 23:34:45 +00:00
parent 0898832984
commit 05b72afdef

View file

@ -4771,7 +4771,7 @@ read_process_output (proc, channel)
if (!NILP (p->adaptive_read_buffering)) if (!NILP (p->adaptive_read_buffering))
{ {
int delay = XINT (p->read_output_delay); int delay = XINT (p->read_output_delay);
if (nbytes < readmax - carryover) if (nbytes < 256)
{ {
if (delay < READ_OUTPUT_DELAY_MAX_MAX) if (delay < READ_OUTPUT_DELAY_MAX_MAX)
{ {
@ -4780,7 +4780,7 @@ read_process_output (proc, channel)
delay += READ_OUTPUT_DELAY_INCREMENT * 2; delay += READ_OUTPUT_DELAY_INCREMENT * 2;
} }
} }
else if (delay > 0) else if (delay > 0 && (nbytes == readmax - carryover))
{ {
delay -= READ_OUTPUT_DELAY_INCREMENT; delay -= READ_OUTPUT_DELAY_INCREMENT;
if (delay == 0) if (delay == 0)