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.devel Subject: Re: master 6a19f2a024: Add new --timeout flag to emacsclient Date: Tue, 06 Sep 2022 17:18:06 +0200 Message-ID: <8735d4cz0x.fsf@gmail.com> References: <166242274473.18552.15183774163383733253@vcs2.savannah.gnu.org> <20220906000545.2DD42C0088A@vcs2.savannah.gnu.org> 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="11609"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 06 17:21:18 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oVaO5-0002tB-Od for ged-emacs-devel@m.gmane-mx.org; Tue, 06 Sep 2022 17:21:17 +0200 Original-Received: from localhost ([::1]:57570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVaO4-00040V-L7 for ged-emacs-devel@m.gmane-mx.org; Tue, 06 Sep 2022 11:21:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVaL4-0001Gj-RT for emacs-devel@gnu.org; Tue, 06 Sep 2022 11:18:11 -0400 Original-Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:39792) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVaL3-0004K4-88 for emacs-devel@gnu.org; Tue, 06 Sep 2022 11:18:10 -0400 Original-Received: by mail-wm1-x32e.google.com with SMTP id i188-20020a1c3bc5000000b003a7b6ae4eb2so9812128wma.4 for ; Tue, 06 Sep 2022 08:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date :gmane-reply-to-list:mail-followup-to:references:in-reply-to:subject :cc:to:from:from:to:cc:subject:date; bh=3aZ+/bkINZbqtEef27Kztk0iZPa3pPSF7aCswfn+2Vk=; b=izlwb0InKfS3ysGFibRcD+xrwmmv0zbbrPglFOwH/BjtOjMJkCYGwo6S9SOh4jPdWx jhEGnBiuH+9M+2hxcgxJNLkj3g29tYDGJHMBWCokKpxiDCQVYRKQFTKCuOet6FRnUPwq 88VDLFtEL0x0w503Sa0GdjXp+ZxTnE8q7/6op8+XWtofPQmNZXEc//OmAEmTjk3etdet U2mFI6/piUUH40DDqw6mo4sVbNZAczr7TDfAjYFj8OTyXvcCjLZIuIKphZUID/e8RvfT DCDl8uwMbxRpK59E5ZKZ+1hbaFw2VSn1vftZdmw4MZxgHATNonfAGiV0Ft8aEIyOjL0v athA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date :gmane-reply-to-list:mail-followup-to:references:in-reply-to:subject :cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=3aZ+/bkINZbqtEef27Kztk0iZPa3pPSF7aCswfn+2Vk=; b=5UG35eHY4CKXMjvPzdFAZbQk3EG7HyxQzHtGX9VWCHNkyWMtFxlwWjHUp+UwT8CtFf 3AksvhEJDBC3SGVdBtpZiat6X3JRvjlXlMZkanKoqYHJKm8Apk5rECDYgt4PqLD16SsH cxO7X7+2eq18ICtqoQWsF0tH+RrIi+PHTkqjQFdMGISMOcZ7rjzhS1TtV+5HjaSC9ovg ABDl69if5SZEmSBirKnRjAzd68fQC8hX2/5M+7KG7v9eEeGL5PKWRYKwm36j8M+yC2eS KACIIWPNhv0ukvIrFkTPY8ccJnpHdXc9iCJK4/80qduneIXK4fFSk0mZuohTYu+wyr2u VFtA== X-Gm-Message-State: ACgBeo1ItA5amSFdYS0MFGn9WmEZbhvird5X527Bnf3S/EkxHNzN6gte o8iR7YQumuLi4CIVy4ELZa4= X-Google-Smtp-Source: AA6agR65+yCvheTaWwp33k7tJ92iR3JR9fVM7SiN0AnN+LXrONHTavkKwyykpyYGw0sT7bYwYQ4JFw== X-Received: by 2002:a05:600c:19cb:b0:3a8:4622:ad3d with SMTP id u11-20020a05600c19cb00b003a84622ad3dmr13883574wmq.37.1662477487802; Tue, 06 Sep 2022 08:18:07 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb50:f116:dbc2:98c7:dbf1]) by smtp.gmail.com with ESMTPSA id c6-20020a05600c0ac600b003a5bd5ea215sm14754530wmr.37.2022.09.06.08.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 08:18:07 -0700 (PDT) In-Reply-To: <20220906000545.2DD42C0088A@vcs2.savannah.gnu.org> (Stefan Kangas's message of "Mon, 5 Sep 2022 20:05:44 -0400 (EDT)") Gmane-Reply-To-List: yes Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=rpluim@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294789 Archived-At: >>>>> On Mon, 5 Sep 2022 20:05:44 -0400 (EDT), Stefan Kangas said: Stefan> do Stefan> { Stefan> act_on_signals (emacs_socket); Stefan> rl =3D recv (emacs_socket, string, BUFSIZ, 0); Stefan> + retry =3D check_socket_timeout (rl); Stefan> + if (retry) Stefan> + { Stefan> + if (timeout > 0 && !saw_response) Stefan> + { Stefan> + /* Don't retry if we were given a --timeout flag. */ Stefan> + fprintf (stderr, "\nServer not responding; timed out after= %lu seconds", Stefan> + timeout); Stefan> + retry =3D false; Stefan> + } Stefan> + else if (!msg_showed) Stefan> + { Stefan> + msg_showed =3D true; Stefan> + fprintf (stderr, "\nServer not responding; use Ctrl+C to b= reak"); Stefan> + } Stefan> + } Stefan> } Stefan> - while (rl < 0 && errno =3D=3D EINTR); Stefan> + while ((rl < 0 && errno =3D=3D EINTR) || retry); =20 Stefan> if (rl <=3D 0) Stefan> break; =20 Stefan> + if (msg_showed) Stefan> + fprintf (stderr, "\nGot response from server"); I=CA=BCm not sure we want to be writing to stderr every time we get a message from the server after we=CA=BCve timed out on the initial recv. Stefan> + saw_response =3D true; Stefan> string[rl] =3D '\0'; =20 Stefan> /* Loop over all NL-terminated messages. */ Robert --=20