From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fixes to allow erc-dcc-get-filter to work properly Date: Sat, 09 Feb 2019 11:49:58 +0200 Message-ID: <83lg2pnveh.fsf@gnu.org> References: <837eear9qj.fsf@gnu.org> <4BFA0AFA-B49E-4CEC-BF76-97567DE9CF31.notmuch@neverland> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="7294"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Victor Orlikowski Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 09 10:50:47 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsPHa-0001nR-Va for ged-emacs-devel@m.gmane.org; Sat, 09 Feb 2019 10:50:47 +0100 Original-Received: from localhost ([127.0.0.1]:43296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsPHZ-0000ln-VY for ged-emacs-devel@m.gmane.org; Sat, 09 Feb 2019 04:50:46 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsPHR-0000lV-6y for emacs-devel@gnu.org; Sat, 09 Feb 2019 04:50:37 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsPHE-00051e-Jf; Sat, 09 Feb 2019 04:50:27 -0500 Original-Received: from [176.228.60.248] (port=4648 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gsPH9-0002nj-CE; Sat, 09 Feb 2019 04:50:23 -0500 In-reply-to: <4BFA0AFA-B49E-4CEC-BF76-97567DE9CF31.notmuch@neverland> (message from Victor Orlikowski on Fri, 8 Feb 2019 22:00:31 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233163 Archived-At: > From: Victor Orlikowski > CC: "emacs-devel@gnu.org" > Date: Fri, 8 Feb 2019 22:00:31 +0000 > > The error checking I added came as a result of debugging the > problem, and *may* not be strictly necessary (the nil check for str, > the nil check for erc-dcc-byte-count). > > I run ERC with erc-dcc-verbose set to t. > I was getting the following error message, repeating several times: > > error in process filter: erc-dcc-get-filter: Wrong type argument: stringp, nil > > when trying to receive a file from a colleague using the DCC mechanism. I > run ERC to communicate with colleagues via XMPP, using bitlbee as a > gateway. > > After putting in the error checks mentioned above, I managed to get > a different error (again repeating several times) from > erc-dcc-get-filter: > > error in process filter: erc-display-message: Wrong type argument: stringp, nil > > When I set erc-dcc-verbose to nil, the above errors went away. > > I set erc-dcc-verbose to t once more, and added code to the function > to print each of: > > buffer-file-name > received-bytes > > I discovered that buffer-file-name was nil - which was what > had been causing these errors to occur. Could it be that the problem is elsewhere? erc-dcc-get-filter is a filter function of a process, which is set up like this: (let* ((buffer (generate-new-buffer (file-name-nondirectory file))) proc) (with-current-buffer buffer [...] (setq erc-dcc-file-name file) [...] (setq proc (funcall erc-dcc-connect-function "dcc-get" buffer (plist-get entry :ip) (string-to-number (plist-get entry :port)) entry)) (set-process-buffer proc buffer) (set-process-coding-system proc 'binary 'binary) (set-buffer-file-coding-system 'binary t) (set-process-filter proc 'erc-dcc-get-filter) As you see, the process whose filter is erc-dcc-get-filter is set up so that the name of its process-buffer is derived from erc-dcc-file-name, but I don't see the buffer-file-name of that buffer being set anywhere. If I'm right, then your change should use buffer-name (the function) instead of buffer-file-name. Can you verify that buffer-name returns the name of erc-dcc-file-name, and that using that return value resolves the problems you saw?