unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Glenn Morris <rgm@gnu.org>
Cc: 23864@debbugs.gnu.org, Christer Ekholm <che@chrekh.se>
Subject: bug#23864: 25.1.50; Poor network responsivenes using open-network-stream
Date: Sun, 3 Jul 2016 11:01:45 +0200	[thread overview]
Message-ID: <5778D479.6020804@cs.ucla.edu> (raw)
In-Reply-To: <347fd7savc.fsf@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]

On 06/30/2016 03:50 AM, Glenn Morris wrote:
> I see this is in emacs-25, so perhaps should be fixed there. 

I agree; it's a regression and the fix is small and localized. Thanks, 
Christer, for debugging and reporting this.

I installed the attached patch into master; it should have the same 
effect as Christer's patch but avoids some code duplication. I can 
backport it into the emacs-25 branch if there is no objection.

Ouch. Now I see that this patch has the wrong bug number (transposed 
digits) and attribution. Sorry about that. I will fix that for the 
backport, if we decide to install it into emacs-25.

[-- Attachment #2: 0001-Fix-open-network-stream-responsiveness.patch --]
[-- Type: text/x-patch, Size: 1771 bytes --]

From 115b407d0816737357cf1923087a2651fcb99867 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 3 Jul 2016 10:49:21 +0200
Subject: [PATCH] Fix open-network-stream responsiveness

Problem reported by Constantin Kulikov (Bug#23684).
* src/process.c (wait_reading_process_output):
Fix typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu
when wait == INFINITY and got_output_end_time is invalid.
In this case the code should break, not continue.
---
 src/process.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/process.c b/src/process.c
index ed0c529..376e872 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5269,16 +5269,20 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
              haven't lowered our timeout due to timers or SIGIO and
              have waited a long amount of time due to repeated
              timers.  */
+	  struct timespec cmp_time;
+	  bool have_cmp_time = false;
 	  if (wait < TIMEOUT)
 	    break;
-	  struct timespec cmp_time
-	    = (wait == TIMEOUT
-	       ? end_time
-	       : (!process_skipped && got_some_output > 0
-		  && (timeout.tv_sec > 0 || timeout.tv_nsec > 0))
-	       ? got_output_end_time
-	       : invalid_timespec ());
-	  if (timespec_valid_p (cmp_time))
+	  else if (wait == TIMEOUT)
+	    cmp_time = end_time, have_cmp_time = true;
+	  else if (!process_skipped && got_some_output > 0
+		   && (timeout.tv_sec > 0 || timeout.tv_nsec > 0))
+	    {
+	      if (!timespec_valid_p (got_output_end_time))
+		break;
+	      cmp_time = got_output_end_time, have_cmp_time = true;
+	    }
+	  if (have_cmp_time)
 	    {
 	      now = current_timespec ();
 	      if (timespec_cmp (cmp_time, now) <= 0)
-- 
2.5.5


  reply	other threads:[~2016-07-03  9:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28 19:24 bug#23864: 25.1.50; Poor network responsivenes using open-network-stream Christer Ekholm
2016-06-30  1:50 ` Glenn Morris
2016-07-03  9:01   ` Paul Eggert [this message]
2016-07-03 11:21     ` Christer Ekholm
2016-07-03 15:21       ` Eli Zaretskii
2016-07-03 18:54         ` Christer Ekholm
2016-07-03 22:51           ` Paul Eggert
2016-07-04  7:34             ` Christer Ekholm
2016-07-04 14:35             ` Eli Zaretskii
2016-07-05 18:43               ` Paul Eggert
2016-07-05 19:46                 ` Eli Zaretskii
2016-07-05 23:10                   ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5778D479.6020804@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=23864@debbugs.gnu.org \
    --cc=che@chrekh.se \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).