GNU bug report logs - #62990
30.0.50; UDP server closes connection upon receiving an empty packet

Previous Next

Package: emacs;

Reported by: Vasilij Schneidermann <mail <at> vasilij.de>

Date: Fri, 21 Apr 2023 10:38:01 UTC

Severity: normal

Found in version 30.0.50

Full log


Message #47 received at 62990 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Vasilij Schneidermann <mail <at> vasilij.de>
Cc: 62990 <at> debbugs.gnu.org
Subject: Re: bug#62990: 30.0.50; UDP server closes connection upon receiving
 an empty packet
Date: Wed, 26 Apr 2023 16:31:54 +0200
>>>>> On Wed, 26 Apr 2023 13:50:17 +0200, Robert Pluim <rpluim <at> gmail.com> said:

>>>>> On Wed, 26 Apr 2023 12:56:39 +0200, Vasilij Schneidermann <mail <at> vasilij.de> said:
    Vasilij> Thank you. Yes, that is the case, the network process is no longer shut
    Vasilij> down, but the 0-length message isn't picked up. It prints the following:

    Vasilij> Received string (5): "hello"
    Vasilij> Received string (5): "world"

    Vasilij> Rather than the expected:

    Vasilij> Received string (5): "hello"
    Vasilij> Received string (0): ""
    Vasilij> Received string (5): "world"

    Robert> Right. Getting emacs to deliver a zero length string to the UDP
    Robert> process would be quite a change, one I canʼt get to any time soon.

Actually, it turned out to be a small change (on top of my previous
patch)

diff --git a/src/process.c b/src/process.c
index e3233f5ad89..eca1441062d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6305,7 +6305,13 @@ read_and_dispose_of_process_output (struct Lisp_Process *p, char *chars,
 	      coding->carryover_bytes);
       p->decoding_carryover = coding->carryover_bytes;
     }
-  if (SBYTES (text) > 0)
+  if (SBYTES (text) > 0
+#ifdef DATAGRAM_SOCKETS
+      || (SBYTES (text) == 0
+	  && 0 <= p->outfd
+	  && DATAGRAM_CHAN_P (p->outfd))
+#endif
+      )
     /* FIXME: It's wrong to wrap or not based on debug-on-error, and
        sometimes it's simply wrong to wrap (e.g. when called from
        accept-process-output).  */

Robert
-- 




This bug report was last modified 1 year and 159 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.