GNU bug report logs - #72312
server--process-filter-1 returns from the wrong block

Previous Next

Package: emacs;

Reported by: Thuna <thuna.cing <at> gmail.com>

Date: Fri, 26 Jul 2024 20:28:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Jeremy Bryant <jb <at> jeremybryant.net>
To: Thuna <thuna.cing <at> gmail.com>
Cc: 72312 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#72312: server--process-filter-1 returns from the wrong block
Date: Fri, 26 Jul 2024 22:32:53 +0100
Thuna <thuna.cing <at> gmail.com> writes:

> In `server--process-filter-1' in lisp/server.el I assume the
> `return-from' on line 28 was meant to be from `server--process-filter-1'
> and not `server--process-filter'.

Assuming you mean this last line,

      ;; We return immediately.
      (cl-return-from server--process-filter)))

adding Stefan M, who made a commit in
May and may know more.

commit 0d7d835902dfaeaae03850fb37e369833bb5664d
Author: Stefan Monnier <monnier <at> iro.umontreal.ca>
Date:   Thu May 30 18:28:02 2024 -0400

    server.el: Avoid nested runs of process filters (bug#71223)







(cl-defun server--process-filter-1 (proc string)
  (server-log (concat "Received " string) proc)
  ;; First things first: let's check the authentication
  (unless (process-get proc :authenticated)
    (if (and (string-match "-auth \\([!-~]+\\)\n?" string)
	     (equal (match-string 1 string) (process-get proc :auth-key)))
	(progn
	  (setq string (substring string (match-end 0)))
	  (process-put proc :authenticated t)
	  (server-log "Authentication successful" proc))
      (server-log "Authentication failed" proc)
      ;; Display the error as a message and give the user time to see
      ;; it, in case the error written by emacsclient to stderr is not
      ;; visible for some reason.
      (server--message-sit-for 2 "Authentication failed")
      (server-send-string
       proc (concat "-error " (server-quote-arg "Authentication failed")))
      (unless (eq system-type 'windows-nt)
        (let ((terminal (process-get proc 'terminal)))
          ;; Only delete the terminal if it is non-nil.
          (when (and terminal (eq (terminal-live-p terminal) t))
	    (delete-terminal terminal))))
      ;; Before calling `delete-process', give emacsclient time to
      ;; receive the error string and shut down on its own.
      ;; FIXME: Why do we wait 1s here but 5s in the other one?
      (run-with-timer 1 nil #'delete-process proc)
      ;; We return immediately.
      (cl-return-from server--process-filter)))




This bug report was last modified 357 days ago.

Previous Next


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