comparison src/process.c @ 53520:2a54a8df1973

(read_process_output): Only activate adaptive buffering if we read less than 256 bytes at a time.
author Kim F. Storm <storm@cua.dk>
date Tue, 06 Jan 2004 23:34:45 +0000
parents 1a5fe79d27f3
children 46f44b9f4e04 82554ed1aed8
comparison
equal deleted inserted replaced
53519:ad9b61a60774 53520:2a54a8df1973
4769 nbytes = emacs_read (channel, chars + carryover, readmax - carryover); 4769 nbytes = emacs_read (channel, chars + carryover, readmax - carryover);
4770 #ifdef ADAPTIVE_READ_BUFFERING 4770 #ifdef ADAPTIVE_READ_BUFFERING
4771 if (!NILP (p->adaptive_read_buffering)) 4771 if (!NILP (p->adaptive_read_buffering))
4772 { 4772 {
4773 int delay = XINT (p->read_output_delay); 4773 int delay = XINT (p->read_output_delay);
4774 if (nbytes < readmax - carryover) 4774 if (nbytes < 256)
4775 { 4775 {
4776 if (delay < READ_OUTPUT_DELAY_MAX_MAX) 4776 if (delay < READ_OUTPUT_DELAY_MAX_MAX)
4777 { 4777 {
4778 if (delay == 0) 4778 if (delay == 0)
4779 process_output_delay_count++; 4779 process_output_delay_count++;
4780 delay += READ_OUTPUT_DELAY_INCREMENT * 2; 4780 delay += READ_OUTPUT_DELAY_INCREMENT * 2;
4781 } 4781 }
4782 } 4782 }
4783 else if (delay > 0) 4783 else if (delay > 0 && (nbytes == readmax - carryover))
4784 { 4784 {
4785 delay -= READ_OUTPUT_DELAY_INCREMENT; 4785 delay -= READ_OUTPUT_DELAY_INCREMENT;
4786 if (delay == 0) 4786 if (delay == 0)
4787 process_output_delay_count--; 4787 process_output_delay_count--;
4788 } 4788 }