From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20159: 24.4; url-retrieve invokes same callback twice with kill-buffer Date: Sat, 21 Mar 2015 23:00:51 +0200 Message-ID: <83y4mqrrp8.fsf@gnu.org> References: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1426971740 28786 80.91.229.3 (21 Mar 2015 21:02:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Mar 2015 21:02:20 +0000 (UTC) Cc: 20159@debbugs.gnu.org To: Christopher Wellons Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 21 22:02:10 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YZQX3-0001iA-W6 for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Mar 2015 22:02:10 +0100 Original-Received: from localhost ([::1]:48969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZQX3-0003kq-Bd for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Mar 2015 17:02:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZQWz-0003ka-Hi for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 17:02:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZQWw-0001MO-CT for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 17:02:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZQWw-0001MK-9J for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 17:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YZQWv-0000DX-RO for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2015 17:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Mar 2015 21:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20159 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20159-submit@debbugs.gnu.org id=B20159.1426971675775 (code B ref 20159); Sat, 21 Mar 2015 21:02:01 +0000 Original-Received: (at 20159) by debbugs.gnu.org; 21 Mar 2015 21:01:15 +0000 Original-Received: from localhost ([127.0.0.1]:60091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZQWA-0000CR-L2 for submit@debbugs.gnu.org; Sat, 21 Mar 2015 17:01:14 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:34803) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YZQW8-0000CE-Gk for 20159@debbugs.gnu.org; Sat, 21 Mar 2015 17:01:13 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NLK00100Y7QLX00@a-mtaout22.012.net.il> for 20159@debbugs.gnu.org; Sat, 21 Mar 2015 23:01:06 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLK001TXYDT8980@a-mtaout22.012.net.il>; Sat, 21 Mar 2015 23:01:06 +0200 (IST) In-reply-to: <87k2ya3wpz.fsf@wellocc1-ld2.jhuapl.edu> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100759 Archived-At: > From: Christopher Wellons > Date: Sat, 21 Mar 2015 16:46:16 -0400 > > > ;;; -*- lexical-binding: t; -*- > (let ((calls 0)) > (url-retrieve "http://localhost:1/" > (lambda (_) > (assert (= 1 (cl-incf calls))) > (kill-buffer)))) > > When I eval the above expression, the assertion fails asynchronously. > > error in process sentinel: Assertion failed: (= 1 (cl-incf calls)) > > I expect the callback given to `url-retrieve' to never be invoked more > than once each time it's passed to `url-retrieve'. Ideally I expect it > to be called exactly once for each call to `url-retrieve', always > delivering errors asynchronously. > > I also tested this on a Windows build of Emacs. The callback is invoked > zero times because the connection error is delivered synchronously at > the call to `url-retrieve' (which I now realize explains why connection > queuing doesn't work right on Windows). So even if the double-invoke > problem is fixed for Linux, the behavior still differs across platforms. I don't understand what you mean by "error is delivered synchronously at the call", and by "connection queuing doesn't work right". Please consider elaborating on those 2 points. Thanks.