emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Asynchronous DNS


From: Alain Schneble
Subject: Re: Asynchronous DNS
Date: Sat, 20 Feb 2016 20:57:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)

Alain Schneble <address@hidden> writes:

> But what seems strange to me right now is this code in check_for_dns:
>
>   /* The DNS lookup failed. */
>   else if (!EQ (p->status, Qconnect))
>     {
>       ...
>
> Actually, I tried it out and DNS lookups seem to timeout quite fast on
> my machine if there is no network connection.  But they do not enter the
> if-branch above.  That seems like an error.  Am I day-dreaming or
> shouldn't it be rewritten to look like this?
>
>   /* The DNS lookup failed. */
>   else if (EQ (p->status, Qconnect))
>     {
>       ...

And here is the patch.  It indeed seems to resolve the issue.  And
another one as well.  Before, if DNS lookup of at least one process
failed and Emacs was requested to terminate (C-x C-c,
save-buffers-kill-terminal), it hung.  Because there was still one or
several processes in "connect" state.  It was stuck in
wait_for_socket_fds.  Maybe there are other cases where it still does
not behave properly, also after having applied this patch.  I'll try to
understand the other branches, where the process state won't be touched
even if DNS request failed...

>From 05ba5057d1ce2394fdaf8d246523166360d3fe89 Mon Sep 17 00:00:00 2001
From: Alain Schneble <address@hidden>
Date: Sat, 20 Feb 2016 20:37:45 +0100
Subject: [PATCH] Deactivate process if async DNS request failed (bugfix)

* src/process.c (check_for_dns): If the async DNS request failed and the
associated process is still in "connect" state, deactivate the process
and set status to "failed".
---
 src/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/process.c b/src/process.c
index a59e418..1f83327 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4706,7 +4706,7 @@ check_for_dns (Lisp_Object proc)
       ip_addresses = Fnreverse (ip_addresses);
     }
   /* The DNS lookup failed. */
-  else if (!EQ (p->status, Qconnect))
+  else if (EQ (p->status, Qconnect))
     {
       deactivate_process (proc);
       pset_status (p, (list2
-- 
2.6.2.windows.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]