From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72652: 31.0.50; url-retrieve on non-existent domain gives no indication of error Date: Fri, 16 Aug 2024 10:43:30 +0300 Message-ID: <86wmkg6hgd.fsf@gnu.org> References: <504501.1723782848@archlinux> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20466"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72652@debbugs.gnu.org To: Greg Minshall Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 16 09:46:53 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1serfg-0005C1-HU for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Aug 2024 09:46:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1serfH-0005HK-MA; Fri, 16 Aug 2024 03:46:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1serfF-00059B-NZ for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2024 03:46:25 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1serfF-00070t-Dr for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2024 03:46:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=jCBaOWXKKps0GnDR9cx+N3jD8/Tlzp9VdosHD6ika5k=; b=MVhU02Q1sYexuYzyRHcUeQ8PKniQCDhC7N64Q6cZdtYpkIBx3TCAHxrQ2h5M7sK0xskYb5ZnUtyrNgR/dD9PR0mvkz0d6yo758H7pMRWGPOK1medDQgG5fmkZWNI54dQqdC5Qyf0ZNCJNRThJ9/CR2JhAbKHjnFooSWsFYLAU62mGcZ15vt11LGb0spIUDnrtpMZSvViyLLCfTbYEUoa/AMbB0o4ePU0iwZLr8njLO+feqAZh6GFXB16Ihao997POBdZBjKznqNA0HfmiZDA3w5A5qEw7NsMAtnggHSFfXSSc21rp3z9hNZAb1xzHAuaN7HATrJuOgtj3iNXszPeJw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1serfp-0002KJ-MU for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2024 03:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Aug 2024 07:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72652 X-GNU-PR-Package: emacs Original-Received: via spool by 72652-submit@debbugs.gnu.org id=B72652.17237943888880 (code B ref 72652); Fri, 16 Aug 2024 07:47:01 +0000 Original-Received: (at 72652) by debbugs.gnu.org; 16 Aug 2024 07:46:28 +0000 Original-Received: from localhost ([127.0.0.1]:50416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1serfI-0002J9-64 for submit@debbugs.gnu.org; Fri, 16 Aug 2024 03:46:28 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1serfG-0002Iq-5z for 72652@debbugs.gnu.org; Fri, 16 Aug 2024 03:46:26 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sercR-0006cO-UC; Fri, 16 Aug 2024 03:43:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=jCBaOWXKKps0GnDR9cx+N3jD8/Tlzp9VdosHD6ika5k=; b=BDd1JQzqahZr Yams0u/z6Dj1SuflgCD8rV+Zd/qSUmGhRs1O2EmiB8N6QtUuqxEKrZmnrUBYszwfLsmo1n8iMZDds ixM3GO4IDhZkBPGF7RVq7JxCZEeKGB8cGZ6Cl1fBCc2nYqCMKo3wKKOZGhv+oTmzUPX03sjw4VyNt WwV6umvjf06r2QQKxyAowdfN9OjItp7CgqgTzcI7h4FbP8/krt6KAKsgdo0YSniDkoXIFLB4OzopZ 5AIwmU75FEBfpiObdlwyVMnsDDVkYnU+/k96G4ug2juHc+psioPvaKJN8FtsB5xxtz1IBPgdvY6u5 5+XFyAlprkXCQT/CvNRLiA==; In-Reply-To: <504501.1723782848@archlinux> (message from Greg Minshall on Fri, 16 Aug 2024 07:34:08 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290195 Archived-At: > From: Greg Minshall > Date: Fri, 16 Aug 2024 07:34:08 +0300 > > if url-retrieve is called with a url for a non-existent domain, it > neither returns an error (it returns a buffer, as it is documented to > do), nor does it seem to invoke the callback routine passed to it to > report any error (or success, or anything else, for that matter). > > the following code uses example.com. calling > - `(mytry 0)` should work, downloading "index.html" > - `(mytry 1)` should give a 404 -- no such file "index99.html" > - `(mytry 2)` doesn't give anything (but, the code ends after 5 seconds) > as there is no such host "x.example.com". > > with 0 or 1, the callback routine is invoked, but with 2, it isn't. > (after 5 seconds the code finishes, displays whatever might be in the > buffer url-retrieve uses to return the results.) On MS-Windows (mytry 2) signals an error: Debugger entered--Lisp error: (error "x.example.com/443 No such host is known. ") make-network-process(:name "x.example.com" :buffer # :host "x.example.com" :service 443 :nowait (:nowait t) :noquery nil :tls-parameters (gnutls-x509pki :priority "NORMAL:%DUMBFW" :hostname "x.example.com" :loglevel 0 :min-prime-bits nil :trustfiles nil :crlfiles nil :keylist nil :verify-flags nil :verify-error nil :pass nil :flags nil :callbacks nil) :coding nil) open-network-stream("x.example.com" # "x.example.com" 443 :nowait (:nowait t) :tls-parameters (gnutls-x509pki :priority "NORMAL:%DUMBFW" :hostname "x.example.com" :loglevel 0 :min-prime-bits nil :trustfiles nil :crlfiles nil :keylist nil :verify-flags nil :verify-error nil :pass nil :flags nil :callbacks nil) :coding nil) open-gnutls-stream("x.example.com" # "x.example.com" 443 (:type tls :nowait (:nowait t))) network-stream-open-tls("x.example.com" # "x.example.com" 443 (:type tls :nowait (:nowait t))) open-network-stream("x.example.com" # "x.example.com" 443 :type tls :nowait (:nowait t)) url-open-stream("x.example.com" # "x.example.com" 443 tls) url-http-find-free-connection("x.example.com" 443 tls) url-http(#s(url :type "https" :user nil :password nil :host "x.example.com" :portspec nil :filename "/index.html" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous t) #f(lambda (&rest results) [t] (mysage "called back")) (nil) nil tls) url-https(#s(url :type "https" :user nil :password nil :host "x.example.com" :portspec nil :filename "/index.html" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous t) #f(lambda (&rest results) [t] (mysage "called back")) (nil)) url-retrieve-internal("https://x.example.com/index.html" #f(lambda (&rest results) [t] (mysage "called back")) (nil) nil nil) url-retrieve("https://x.example.com/index.html" #f(lambda (&rest results) [t] (mysage "called back")) nil) (let* ((urls '("https://example.com/index.html" "https://example.com/index99.html" "https://x.example.com/index.html")) (buffer (url-retrieve (nth n urls) #'(lambda (&rest results) (mysage "called back")) nil))) (mysage "url-retrieve returns %s" buffer) (sleep-for 5) (save-current-buffer (set-buffer buffer) (mysage "buffer %s contents: %s" buffer (buffer-substring (point-min) (point-max))))) mytry(2) eval((mytry 2) t) #f(compiled-function () #)() #f(compiled-function () #)() handler-bind-1(#f(compiled-function () #) (error) eval-expression--debug) eval-expression((mytry 2) nil nil 127) funcall-interactively(eval-expression (mytry 2) nil nil 127) call-interactively(eval-expression nil nil) command-execute(eval-expression) On GNU/Linux, I get this in the echo-area after about 2 sec: Contacting host: x.example.com:443 url-retrieve returns *http x.example.com:443* buffer *http x.example.com:443* contents: "buffer *http x.example.com:443* contents: " IOW, I get an empty buffer. Why is that behavior a problem?