From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#62990: 30.0.50; UDP server closes connection upon receiving an empty packet Date: Wed, 26 Apr 2023 16:31:54 +0200 Message-ID: <877ctysoit.fsf@gmail.com> References: <87wn21br45.fsf@gmail.com> <87ttx49yg0.fsf@gmail.com> <87jzxysw06.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36880"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62990@debbugs.gnu.org To: Vasilij Schneidermann Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 26 16:33:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1prgCs-0009He-S2 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Apr 2023 16:33:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prgCe-0003tb-2Z; Wed, 26 Apr 2023 10:33:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prgCc-0003s3-Iy for bug-gnu-emacs@gnu.org; Wed, 26 Apr 2023 10:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1prgCc-0001G5-Ad for bug-gnu-emacs@gnu.org; Wed, 26 Apr 2023 10:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prgCc-0005W7-3O for bug-gnu-emacs@gnu.org; Wed, 26 Apr 2023 10:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Apr 2023 14:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62990 X-GNU-PR-Package: emacs Original-Received: via spool by 62990-submit@debbugs.gnu.org id=B62990.168251952421127 (code B ref 62990); Wed, 26 Apr 2023 14:33:02 +0000 Original-Received: (at 62990) by debbugs.gnu.org; 26 Apr 2023 14:32:04 +0000 Original-Received: from localhost ([127.0.0.1]:56757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prgBf-0005Uh-Sl for submit@debbugs.gnu.org; Wed, 26 Apr 2023 10:32:04 -0400 Original-Received: from mail-wm1-f48.google.com ([209.85.128.48]:61455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prgBd-0005UD-S4 for 62990@debbugs.gnu.org; Wed, 26 Apr 2023 10:32:02 -0400 Original-Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-3f19ab994ccso49881655e9.2 for <62990@debbugs.gnu.org>; Wed, 26 Apr 2023 07:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682519516; x=1685111516; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=vnK/SQhANKndFlUcYbR0hF8iVMTmuDEOvt9GxJcZpxE=; b=Q3LzCi0oAnLisvu0SWXaNHMrkXdQ6f14RDrU6W8KJ1q5C2APOEwgT/xvYWBNRE3Kfs H84jIyk8MKOu56r1koOyI1zKP4+W1MsKFpkheAGcBV/8jxEJZZmRIa1zMDBi8xbjLTGK sY6tLQy7dNaC2QIcFs7TrJ12xtifWURaLIJ1uAuWB8bGhDAmBVSCHr84tKDdSNz9pYlk f7WCsd0WHi0tcJBwwIff+5GccvX4G6dbze/uw9v7GnKavkEMB2FBGUCuTmyParhyh940 8Zfvk/5k1wSHMHIQROHvCSIGjY5vNfXl2v//if6ml/0z9k0OCYLUTPoECXdz3KnA6cVc eA2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682519516; x=1685111516; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vnK/SQhANKndFlUcYbR0hF8iVMTmuDEOvt9GxJcZpxE=; b=DrbOTDSCLZznTM9xORY11ka3Zlgt8EfMsmp6EXl9yTuepgLbfDAs470ElKs59g4/Lk eOXvhv0cv0CX0ubaMN9SfNAGx0F8go2XqFU8fYVhAbiN3bTOxO0hQVRdLt3WcG1b13Ik 6NIgs2Eg6uZVYKjlFk7fHuDOj+s8okx5NFgFBMwavKwB+4oTqrKLsr3yr1FdAceYKgXq LEbimAlLDxjlhbvf8c+nltYLdnS99jaMGxitTqRFV6SIyEaimQPeJSLt1O4E/MNDHPMT xxx983llVQc6anO4G1kvv2Q9hSOMgLQZ0wwv4oLKnYklMTcZAztSvCEo+SwLPTRNWzWJ 9GaQ== X-Gm-Message-State: AAQBX9eyzMR4QAc/8ce8542Uu23s64UaVYqNC2KgtIhspAUuby2AfxQg DlptZMsZq1g46dv3IC7GhoY/PnnRGys= X-Google-Smtp-Source: AKy350YUFWRuRfpb0gEpPuU6JH2KrWwADBweiOgbOipifOm3zHMtpoWRgsxs0ZbA1Pvu5yHWYo6d5g== X-Received: by 2002:a1c:f703:0:b0:3f1:71b2:9445 with SMTP id v3-20020a1cf703000000b003f171b29445mr14633487wmh.15.1682519515832; Wed, 26 Apr 2023 07:31:55 -0700 (PDT) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id h3-20020a5d5043000000b002c70ce264bfsm15938704wrt.76.2023.04.26.07.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 07:31:55 -0700 (PDT) In-Reply-To: <87jzxysw06.fsf@gmail.com> (Robert Pluim's message of "Wed, 26 Apr 2023 13:50:17 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260683 Archived-At: >>>>> On Wed, 26 Apr 2023 13:50:17 +0200, Robert Pluim s= aid: >>>>> On Wed, 26 Apr 2023 12:56:39 +0200, Vasilij Schneidermann said: Vasilij> Thank you. Yes, that is the case, the network process is no lo= nger 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=CA=BCt get to any ti= me 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_Proc= ess *p, char *chars, coding->carryover_bytes); p->decoding_carryover =3D coding->carryover_bytes; } - if (SBYTES (text) > 0) + if (SBYTES (text) > 0 +#ifdef DATAGRAM_SOCKETS + || (SBYTES (text) =3D=3D 0 + && 0 <=3D 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 --=20