all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: j_l_domenech@yahoo.com, a.s@realize.ch, 22789@debbugs.gnu.org
Subject: bug#22789: 25.1.50; In last master build https connections stop working
Date: Wed, 02 Mar 2016 18:03:57 +0000	[thread overview]
Message-ID: <87d1rcrc36.fsf@gnus.org> (raw)
In-Reply-To: <83ziui6w1s.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 01 Mar 2016 17:46:07 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

> So what you can do instead of launching a timer is this: as long as
> some process waits for some sync stuff to complete, reduce the timeout
> with which we call 'pselect' to some reasonably small value, like half
> a second or maybe 0.25 sec.  This will ensure the loop doesn't stop as
> long as we wait for at least one such connection.  (This will need a
> simple logic to not exit the loop too early; see the variable
> timeout_reduced_for_timers for a similar logic we employ already for
> timers.)

Aha!  With the following (for debugging purposes only) patch, it looks
like I'm getting progress on my https connections even if I don't have a
blinking cursor.  (I chose 50ms as my timeout, if I counted my zeroes
correctly...)  Were you thinking about something along these lines?  If
so, I can clean the patch up...

diff --git a/src/process.c b/src/process.c
index 85a4885..5376492 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4870,6 +4870,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
   struct timespec got_output_end_time = invalid_timespec ();
   enum { MINIMUM = -1, TIMEOUT, INFINITY } wait;
   int got_some_output = -1;
+  bool retry_for_async;
   ptrdiff_t count = SPECPDL_INDEX ();
 
   /* Close to the current time if known, an invalid timespec otherwise.  */
@@ -4922,6 +4923,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 	Lisp_Object process_list_head, aproc;
 	struct Lisp_Process *p;
 
+	retry_for_async = false;
 	FOR_EACH_PROCESS(process_list_head, aproc)
 	  {
 	    p = XPROCESS (aproc);
@@ -4935,6 +4937,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 		    Lisp_Object ip_addresses = check_for_dns (aproc);
 		    if (!NILP (ip_addresses) && !EQ (ip_addresses, Qt))
 		      connect_network_socket (aproc, ip_addresses);
+		    else
+		      retry_for_async = true;
 		  }
 #endif
 #ifdef HAVE_GNUTLS
@@ -4950,12 +4954,16 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 			gnutls_verify_boot (aproc, Qnil);
 			finish_after_tls_connection (aproc);
 		      }
-		    else if (p->gnutls_handshakes_tried
-			     > GNUTLS_EMACS_HANDSHAKES_LIMIT)
+		    else
 		      {
-			deactivate_process (aproc);
-			pset_status (p, list2 (Qfailed,
-					       build_string ("TLS negotiation failed")));
+			retry_for_async = true;
+			if (p->gnutls_handshakes_tried
+			    > GNUTLS_EMACS_HANDSHAKES_LIMIT)
+			  {
+			    deactivate_process (aproc);
+			    pset_status (p, list2 (Qfailed,
+						   build_string ("TLS negotiation failed")));
+			  }
 		      }
 		  }
 #endif
@@ -5044,6 +5052,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 	  Ctemp = write_mask;
 
 	  timeout = make_timespec (0, 0);
+	  printf("Timeout is %lu\n", timeout.tv_sec);
 	  if ((pselect (max (max_process_desc, max_input_desc) + 1,
 			&Atemp,
 #ifdef NON_BLOCKING_CONNECT
@@ -5222,6 +5231,15 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 	  if (timeout.tv_sec > 0 || timeout.tv_nsec > 0)
 	    now = invalid_timespec ();
 
+	  if (retry_for_async
+	      && (timeout.tv_sec > 0 || timeout.tv_nsec > 50000000))
+	    {
+	      timeout.tv_sec = 0;
+	      timeout.tv_nsec = 50000000;
+	    }
+
+	  printf("Here timeout is %lu/%lu\n", timeout.tv_sec, timeout.tv_nsec);
+
 #if defined (HAVE_NS)
           nfds = ns_select
 #elif defined (HAVE_GLIB)


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2016-03-02 18:03 UTC|newest]

Thread overview: 124+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 10:26 bug#22789: 25.1.50; In last master build https connections stop working José L. Doménech
2016-02-24 14:00 ` Lars Ingebrigtsen
2016-02-24 16:09   ` José L. Doménech
2016-02-24 18:06     ` Eli Zaretskii
2016-02-24 23:48       ` Lars Ingebrigtsen
2016-02-25  0:02         ` Lars Ingebrigtsen
2016-02-25  1:09           ` Lars Ingebrigtsen
2016-02-25 16:41           ` Eli Zaretskii
2016-02-26  2:29             ` Lars Ingebrigtsen
2016-02-26  9:36               ` Eli Zaretskii
2016-02-27  2:30                 ` Lars Ingebrigtsen
2016-02-27  2:43                   ` John Wiegley
2016-02-27  3:50                     ` Lars Ingebrigtsen
2016-02-27  8:14                       ` Eli Zaretskii
2016-02-27  3:49                   ` Lars Ingebrigtsen
2016-02-27  8:10                     ` Eli Zaretskii
2016-02-27  8:13                   ` Eli Zaretskii
2016-02-27 18:05           ` Alain Schneble
2016-02-27 22:38             ` Lars Ingebrigtsen
2016-02-27 23:06               ` Alain Schneble
2016-02-27 23:49                 ` Alain Schneble
2016-02-28  3:31                   ` Lars Ingebrigtsen
2016-02-28  9:58                     ` Alain Schneble
2016-02-28 16:53                     ` Eli Zaretskii
2016-02-29  2:37                       ` Lars Ingebrigtsen
2016-02-28  3:43                   ` Eli Zaretskii
2016-02-28  9:48                     ` Alain Schneble
2016-02-28 17:00                       ` Eli Zaretskii
2016-02-29  2:49                         ` Lars Ingebrigtsen
2016-02-29  3:43                           ` Eli Zaretskii
2016-02-29  4:38                             ` Lars Ingebrigtsen
2016-02-29  9:55                         ` Alain Schneble
2016-02-29 10:03                           ` Lars Ingebrigtsen
2016-02-29 17:57                             ` Alain Schneble
2016-02-29 18:45                               ` Eli Zaretskii
2016-02-29 21:22                                 ` Lars Ingebrigtsen
2016-03-01  3:35                                   ` Eli Zaretskii
2016-02-29 23:13                                 ` Alain Schneble
2016-03-01  0:41                                   ` Lars Ingebrigtsen
2016-03-01  3:41                                   ` Eli Zaretskii
2016-03-01  4:29                                     ` Lars Ingebrigtsen
2016-03-01  4:30                                     ` Lars Ingebrigtsen
2016-03-01  9:00                                       ` Andreas Schwab
2016-03-01 14:12                                         ` Lars Ingebrigtsen
2016-03-01 14:25                                           ` Alain Schneble
2016-03-01 14:43                                             ` Lars Ingebrigtsen
2016-03-01 15:59                                             ` Eli Zaretskii
2016-03-01 16:19                                               ` Alain Schneble
2016-03-01 17:00                                                 ` Eli Zaretskii
2016-03-01 17:09                                                   ` Alain Schneble
2016-03-01 17:22                                                     ` Eli Zaretskii
2016-03-01 17:55                                                       ` Alain Schneble
2016-03-01 18:13                                                         ` Eli Zaretskii
2016-03-01 16:33                                               ` Andreas Schwab
2016-03-01 15:53                                           ` Eli Zaretskii
2016-03-01 15:36                                     ` Alain Schneble
2016-03-01 16:05                                       ` Eli Zaretskii
2016-03-01 16:25                                         ` Alain Schneble
2016-03-04  8:56                                         ` Eli Zaretskii
2016-03-04 16:55                                           ` Alain Schneble
2016-03-04 21:36                                             ` Alain Schneble
2016-03-04 22:33                                               ` Alain Schneble
2016-03-05  8:23                                               ` Eli Zaretskii
2016-03-05 18:27                                                 ` Alain Schneble
2016-03-05 19:21                                                   ` Eli Zaretskii
2016-03-06 22:45                                                     ` Alain Schneble
2016-03-06 23:24                                                       ` Alain Schneble
2016-03-07  8:49                                                         ` Alain Schneble
2016-03-07 16:08                                                           ` Eli Zaretskii
2016-03-07 17:20                                                             ` Alain Schneble
2016-03-07 17:33                                                               ` Eli Zaretskii
2016-03-07 18:03                                                                 ` Alain Schneble
2016-03-07 18:10                                                                   ` Eli Zaretskii
2016-03-07 18:26                                                                     ` Alain Schneble
2016-03-07 16:07                                                         ` Eli Zaretskii
2016-03-07 16:47                                                           ` Alain Schneble
2016-03-07 22:21                                                           ` Alain Schneble
2016-03-08 16:40                                                             ` Eli Zaretskii
2016-03-08 16:43                                                               ` Alain Schneble
2016-03-10 14:45                                                             ` Eli Zaretskii
2016-03-10 14:59                                                               ` Alain Schneble
2016-03-06  9:31                                                   ` Lars Magne Ingebrigtsen
2016-03-06 15:24                                                     ` Eli Zaretskii
2016-03-05  8:46                                               ` Lars Magne Ingebrigtsen
2016-03-05 18:32                                                 ` Alain Schneble
2016-02-29 21:18                               ` Lars Ingebrigtsen
2016-02-29 23:20                                 ` Alain Schneble
2016-03-01  3:43                                   ` Eli Zaretskii
2016-03-01  5:17                                     ` Lars Ingebrigtsen
2016-03-01 15:46                                       ` Eli Zaretskii
2016-03-02 18:03                                         ` Lars Ingebrigtsen [this message]
2016-03-02 19:07                                           ` Alain Schneble
2016-03-02 19:15                                             ` Lars Ingebrigtsen
2016-03-02 19:38                                               ` Alain Schneble
2016-03-02 20:46                                                 ` Alain Schneble
2016-03-02 22:02                                                   ` Alain Schneble
2016-03-02 22:22                                                     ` Lars Ingebrigtsen
2016-03-02 22:38                                                       ` Alain Schneble
2016-03-03  0:07                                                         ` Alain Schneble
2016-03-03  5:32                                                           ` Lars Ingebrigtsen
2016-03-03  9:03                                                             ` Alain Schneble
2016-03-02 19:43                                           ` Eli Zaretskii
2016-03-03  5:23                                             ` Lars Ingebrigtsen
2016-03-04  8:51                                               ` Eli Zaretskii
2016-03-04 11:33                                                 ` Lars Ingebrigtsen
2016-03-04 14:48                                                   ` Eli Zaretskii
2016-03-05 12:26                                                     ` Lars Magne Ingebrigtsen
2016-03-05 13:24                                                       ` Eli Zaretskii
2016-03-06  9:33                                                         ` Lars Magne Ingebrigtsen
2016-03-06 15:26                                                           ` Eli Zaretskii
2016-03-06 18:33                                                             ` Lars Magne Ingebrigtsen
2016-03-06 18:41                                                               ` Eli Zaretskii
2016-03-04 11:37                                                 ` Lars Ingebrigtsen
2016-03-04 11:40                                                   ` Lars Ingebrigtsen
2016-03-04 15:41                                                     ` Eli Zaretskii
2016-03-04 15:43                                                       ` Lars Ingebrigtsen
2016-03-04 16:12                                                         ` Eli Zaretskii
2016-03-04 15:40                                                   ` Eli Zaretskii
2016-03-01 15:43                                     ` Alain Schneble
2016-03-01 16:07                                       ` Eli Zaretskii
2016-03-01 16:26                                         ` Alain Schneble
2016-02-28 16:47             ` Eli Zaretskii
2016-02-25  3:46         ` Eli Zaretskii
2016-02-25  5:00           ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=87d1rcrc36.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=22789@debbugs.gnu.org \
    --cc=a.s@realize.ch \
    --cc=eliz@gnu.org \
    --cc=j_l_domenech@yahoo.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.