From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Victor Orlikowski Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fixes to allow erc-dcc-get-filter to work properly Date: Fri, 8 Feb 2019 22:00:31 +0000 Message-ID: <4BFA0AFA-B49E-4CEC-BF76-97567DE9CF31.notmuch@neverland> References: <837eear9qj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="24524"; mail-complaints-to="usenet@blaine.gmane.org" Cc: "emacs-devel@gnu.org" To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 08 23:01:17 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 1gsECx-0006CY-JF for ged-emacs-devel@m.gmane.org; Fri, 08 Feb 2019 23:01:15 +0100 Original-Received: from localhost ([127.0.0.1]:35848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsECw-0006v3-Ip for ged-emacs-devel@m.gmane.org; Fri, 08 Feb 2019 17:01:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsECK-0006uZ-V0 for emacs-devel@gnu.org; Fri, 08 Feb 2019 17:00:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gsECJ-0007xi-SN for emacs-devel@gnu.org; Fri, 08 Feb 2019 17:00:36 -0500 Original-Received: from smtp-gw-11.oit.duke.edu ([152.3.189.237]:37258 helo=mail-gw-11.oit.duke.edu) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gsECJ-0007wl-Nl; Fri, 08 Feb 2019 17:00:35 -0500 Authentication-Results: mail-gw.oit.duke.edu; spf=none smtp.mailfrom=vjo@duke.edu; dmarc=none Original-Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-co1nam05lp2057.outbound.protection.outlook.com [104.47.48.57]) by mail-gw-11.oit.duke.edu (8.16.0.27/8.16.0.27) with ESMTPS id x18M0WVt018228 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 8 Feb 2019 17:00:33 -0500 Original-Received: from CO2PR05MB2488.namprd05.prod.outlook.com (10.166.95.146) by CO2PR05MB2774.namprd05.prod.outlook.com (10.166.200.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.12; Fri, 8 Feb 2019 22:00:32 +0000 Original-Received: from CO2PR05MB2488.namprd05.prod.outlook.com ([fe80::b10c:f1aa:5c08:17f7]) by CO2PR05MB2488.namprd05.prod.outlook.com ([fe80::b10c:f1aa:5c08:17f7%2]) with mapi id 15.20.1622.013; Fri, 8 Feb 2019 22:00:32 +0000 Thread-Topic: [PATCH] Fixes to allow erc-dcc-get-filter to work properly Thread-Index: AQHUu+iAz1YjTNoSkkK0QXoy4+2WEKXVkMKPgADq1AA= In-Reply-To: <837eear9qj.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US x-originating-ip: [152.3.34.3] x-clientproxiedby: BN4PR12CA0016.namprd12.prod.outlook.com (2603:10b6:403:2::26) To CO2PR05MB2488.namprd05.prod.outlook.com (2603:10b6:102:10::18) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CO2PR05MB2774; 20:jnKyoLukZoDcJNwwd0SUkgFU3/lcvVFz5iCdBsj+ATBBFT705+8STI7O9D0oC9q+big7dWjBcOZlDGcXU+GFHHw9W4YuMokm2SFHhWClX6oUmGMHTPb5IJ8wBqkX0APGVGCR6gOEU/nsP+YDGcAWnjaaOFtM5YogMluodtfNnF4= x-ms-office365-filtering-correlation-id: c52a0d4e-44e7-4b2d-bde5-08d68e10d80f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020); SRVR:CO2PR05MB2774; x-ms-traffictypediagnostic: CO2PR05MB2774: x-microsoft-antispam-prvs: x-forefront-prvs: 094213BFEA x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(979002)(7916004)(366004)(136003)(376002)(346002)(39860400002)(396003)(189003)(199004)(256004)(305945005)(66066001)(8676002)(7736002)(71200400001)(450100002)(81166006)(8936002)(81156014)(446003)(33896004)(52116002)(486006)(476003)(25786009)(99286004)(86362001)(6246003)(11346002)(33716001)(6506007)(386003)(76176011)(4326008)(71190400001)(3846002)(6116002)(105586002)(68736007)(2906002)(26005)(75432002)(88552002)(106356001)(186003)(14454004)(786003)(316002)(229853002)(6486002)(6436002)(478600001)(9686003)(6916009)(6512007)(102836004)(97736004)(53936002)(21314003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR05MB2774; H:CO2PR05MB2488.namprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: duke.edu does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Iz04qlw8Q8YRXNWa1qyABhsqUkzJb7pU2HycjKBSqGvktS76vyXjtBMnTcYAeWxsuIAjWtBoGsV7Qde+6jEXn5RGPzafmnrNc0r32777GzPTnTRO/QTm6c+ctpb8zAIBe2JCJ+j7icMIJEdd0+Uq1nlCbv5dOwcNoQCtryZkPZZivcoPcdH41U0JW1owm+b0oM3V9UF2sQzpIl54eBVYIP814xcFVBpBrp2FEHUX9165NgAmV6I6SXe/ReLS5CTpyJ2baVtmum52DuYGZRhH83RuwxX2YBmXjSX0XS1Ww2xmP4eF7thtRBfrwY8tqsgTZH33ecMt3ABq2hIG9C15cWXRqInJ201jZdSPXIv7vbW0yfYSiOqeBPOnFNefgnksjptJEoSBMC4GhTp+VEzsOjzwVCZQ4ApTRoa+LezIphA= X-OriginatorOrg: duke.edu X-MS-Exchange-CrossTenant-Network-Message-Id: c52a0d4e-44e7-4b2d-bde5-08d68e10d80f X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Feb 2019 22:00:31.3393 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: cb72c54e-4a31-4d9e-b14a-1ea36dfac94c X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR05MB2774 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-02-08_11:, , signatures=0 X-Proofpoint-Spam-Reason: safe X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 152.3.189.237 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:233149 Archived-At: On Fri, Feb 08, 2019, at 09:59 AM, Eli Zaretskii wrote: > Thanks. Can you please elaborate on the problem, perhaps showing an > example of the behavior before and after your patch? I don't think I > understand the issue with buffer-file-name (but then I don't use ERC). Certainly. 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. I noted, earlier in the function: (when (> (point-max) erc-dcc-receive-cache) (erc-dcc-append-contents (current-buffer) erc-dcc-file-name)) and chose to replace "buffer-file-name" with "erc-dcc-file-name" - which got behavior I expected to see. To clarify further - the behavior I expected to see was, with erc-dcc-verbose set to t, that output similar to the following should be generated in the server buffer: *** DCC: file IDidntBringEnoughToShare.png offered by RobCarter (xxx@xxxx.x= xx) (size 491883) [17= :03] *** DCC: IDidntBringEnoughToShare.png: 3624 bytes received *** DCC: IDidntBringEnoughToShare.png: 4096 bytes received *** DCC: IDidntBringEnoughToShare.png: 8192 bytes received *** DCC: IDidntBringEnoughToShare.png: 12288 bytes received *** DCC: IDidntBringEnoughToShare.png: 16384 bytes received *** DCC: IDidntBringEnoughToShare.png: 20480 bytes received *** DCC: IDidntBringEnoughToShare.png: 24576 bytes received *** DCC: IDidntBringEnoughToShare.png: 28672 bytes received *** DCC: IDidntBringEnoughToShare.png: 32768 bytes received *** DCC: IDidntBringEnoughToShare.png: 36864 bytes received *** DCC: IDidntBringEnoughToShare.png: 40960 bytes received *** DCC: IDidntBringEnoughToShare.png: 45056 bytes received ... additional lines elided ... *** DCC: IDidntBringEnoughToShare.png: 479232 bytes received *** DCC: IDidntBringEnoughToShare.png: 483328 bytes received *** DCC: IDidntBringEnoughToShare.png: 487424 bytes received *** DCC: IDidntBringEnoughToShare.png: 491520 bytes received *** DCC: IDidntBringEnoughToShare.png: 491883 bytes received *** DCC: file ~/IDidntBringEnoughToShare.png transfer complete (491883 byte= s in 8 seconds) The errors I had been previously receiving (prior to patching the function) occurred every erc-dcc-receive-cache bytes. I am presently overriding this function in my ercrc.el via: (eval-after-load "erc-dcc" '(defun erc-dcc-get-filter (proc str) (rest of function elided))) Does that clarify the issue sufficiently? Thanks, Victor --=20 Victor J. Orlikowski <> vjo@(ee.|cs.)?duke.edu