From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rui Yang Newsgroups: gmane.emacs.bugs Subject: bug#51966: url-retrieve freeze when connecting to identity.xero.com Date: Fri, 19 Nov 2021 18:27:51 +1100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000201a5a05d11f37a9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12398"; mail-complaints-to="usenet@ciao.gmane.io" To: 51966@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 19 10:20:53 2021 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 1mo04i-00030j-TC for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Nov 2021 10:20:53 +0100 Original-Received: from localhost ([::1]:38670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mo04h-0002Jk-2E for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Nov 2021 04:20:51 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mo010-000544-Hx for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 04:17:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mo010-0002bd-1C for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 04:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mo00z-00082K-Tn for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 04:17:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Rui Yang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Nov 2021 09:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51966 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163731341930861 (code B ref -1); Fri, 19 Nov 2021 09:17:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Nov 2021 09:16:59 +0000 Original-Received: from localhost ([127.0.0.1]:37996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mo00v-00081f-Gb for submit@debbugs.gnu.org; Fri, 19 Nov 2021 04:16:58 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:46464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnyJs-0002uu-TF for submit@debbugs.gnu.org; Fri, 19 Nov 2021 02:28:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnyJa-0006oW-Mx for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 02:28:15 -0500 Original-Received: from [2607:f8b0:4864:20::d2e] (port=40647 helo=mail-io1-xd2e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mnyJY-0000ch-JH for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 02:28:06 -0500 Original-Received: by mail-io1-xd2e.google.com with SMTP id p23so11655523iod.7 for ; Thu, 18 Nov 2021 23:28:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=KgzPfnvJRz49scbjnMIiA4IsINnztkYNMjY+JRlicIc=; b=SMiui+Y8O2QJE2BrySiW2dt4dXXwABkbM6ivxF9wMwNgfga2MqpNuLVKAyYfQSY7SL z5my0LDoMv/wxZyTlnIwMiAjjSKtYSRVxzYtSg00dk6y2k2c27jqbH1XaynPhFG+WEcC JlPKbgtq9u3EbRcFeMcOxyuVn639c93wyoo/nqoy4ux3nRwI3XwlqbDD+eQnBDkFYDrG OgLrP+XXGkvibLmXD3a7ydnUrIadd8SfTAcJmNG6zicBIcj1RRxE/t9tS4mhBc1nz5ei GRH1J4L9szIoG8v9zWXuTrLirP8SCVvZonzZ1vI/AmLHusxjG0tA0OQInNtX3pFTG4vm mefQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=KgzPfnvJRz49scbjnMIiA4IsINnztkYNMjY+JRlicIc=; b=6J0TS3Cx5jYp8lvyS/Utb1tHlXuaA3ouzMiYNcBF/gpGSUcG5sxrKxf92uAv7iGGK2 YzpFEictiT61EjpYkxw9I1BNRFmBBMTNv83m75JWaHwBk6c4vfsLRB6Zh0iAkYSzVtug zyMEy+swa1NobryD61ZGSwqm0lE7wMgzKd2LwGJ4jfuHuNcUZhk2vgzeW/QNx5W8pq+P SGgTYrdV04JWTGcwvspVozkgupPyOi29KfDw5R61116E7svH1KqC2IaMkk05XvxV1hLZ iS/MyICFI8VtbJ0WsUSUQh/d2lB4lg6nWkYNB0xZOEnA/OZ9LWnC5ZlrjkYsf3UthrEj 2AhA== X-Gm-Message-State: AOAM530rU/laO6rDGxSONM78/zilGY+wBnWYzvdJqFGc0qs1asorrdkD NxcrH+zPI9OKhIQMDCa/KBH7qJGykHubeGwpW4jMOx5vE1gfcQ== X-Google-Smtp-Source: ABdhPJyAwACJQbW9UBc17bO5TeB6PPtksvC9LOMPmbkk7w+m5hUgpbnV3Rs/10YKCuu71MGIKoDks2LnUPQSsc6CqWc= X-Received: by 2002:a05:6602:1484:: with SMTP id a4mr3759903iow.35.1637306882594; Thu, 18 Nov 2021 23:28:02 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d2e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::d2e; envelope-from=ryang.sei@gmail.com; helo=mail-io1-xd2e.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 19 Nov 2021 04:16:56 -0500 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" Xref: news.gmane.io gmane.emacs.bugs:220399 Archived-At: --000000000000201a5a05d11f37a9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable --text follows this line-- Emacs -Q ;; the following script hopefully will demonstrate the issue ;; after evaluating the code below, url-retrieve seems started a new ;; process to do the https call, that call should give a bad request with ;; json response {"error":"invalid_client"} ;; but it took a lot of time for the call back to be called ;; I suspect sth special about Xero domain=E2=80=99s certificate which caus= ed ;; this issue. https://www.google.com.au is fine ;; tried starting with emacs option, --no-init (setq url-debug t) (defun http-handle-response (status method &optional url bufname raw stay-in-window) "Switch to the buffer returned by `url-retreive'. The buffer contains the raw HTTP response sent by the server." (message (format "%s" raw))) (display-buffer (let* ((url "https://identity.xero.com/connect/post") (method "POST")) (url-retrieve url 'http-handle-response (append (list method url (format "*HTTP %s %s*" method url)) '()))) t) ;; the following curl command will return response very quickly curl -X POST https://identity.xero.com/connect/token -H 'Authorization: Basic abc' -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'abc=3Ddef' Response: {"error":"invalid_client"} In GNU Emacs 27.2 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95)) of 2021-03-28 built on builder10-14.porkrind.org Windowing system distributor 'Apple', version 10.3.2022 System Description: macOS 11.4 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --with-ns '--enable-locallisppath=3D/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules' Configured features: NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS JSON PDUMPER GMP Important settings: value of $LANG: en_AU.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date subr-x cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 45081 6477) (symbols 48 5924 1) (strings 32 15291 1697) (string-bytes 1 507781) (vectors 16 10217) (vector-slots 8 127225 14272) (floats 8 19 50) (intervals 56 185 0) (buffers 1000 12)) --000000000000201a5a05d11f37a9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
--text follows this line--

Emacs -Q
;; the follo= wing script hopefully will demonstrate the issue
;; after evaluating the= code below, url-retrieve seems started a new
;; process to do the http= s call, that call should give a bad request with
;; json response {&quo= t;error":"invalid_client"}
;; but it took a lot of time f= or the call back to be called
;; I suspect sth special about Xero domain= =E2=80=99s certificate which caused
;; this issue. https://www.google.com.au is fine
;; tried starting= with emacs option, --no-init
(setq url-debug t)

(defun http-hand= le-response (status method &optional url bufname raw stay-in-window)=C2=A0 "Switch to the buffer returned by `url-retreive'.
The b= uffer contains the raw HTTP response sent by the server."
=C2=A0 (m= essage (format "%s" raw)))

(display-buffer
=C2=A0(let* = ((url "https://iden= tity.xero.com/connect/post")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (metho= d "POST"))
=C2=A0 =C2=A0(url-retrieve url 'http-handle-res= ponse (append (list method url (format "*HTTP %s %s*" method url)= ) '())))
=C2=A0t)

;; the following curl command will return r= esponse very quickly
curl -X POST https://identity.xero.com/connect/token -H 'Authoriza= tion: Basic =C2=A0abc' -H 'Content-Type: application/x-www-form-url= encoded' --data-urlencode 'abc=3Ddef'

Response: {"e= rror":"invalid_client"}



In GNU Emacs 27.2 (bu= ild 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build = 18G95))
=C2=A0of 2021-03-28 built on builder10-14.porkrind.org
Windowing system distributor = 9;Apple', version 10.3.2022
System Description: =C2=A0macOS 11.4
=
Recent messages:
For information about GNU Emacs and the GNU system,= type C-h C-a.

Configured using:
=C2=A0'configure --with-ns &= #39;--enable-locallisppath=3D/Library/Application
=C2=A0Support/Emacs/${= version}/site-lisp:/Library/Application
=C2=A0Support/Emacs/site-lisp= 9; --with-modules'

Configured features:
NOTIFY KQUEUE ACL GNU= TLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES
THREADS JSON PDUMPER GMP=

Important settings:
=C2=A0 value of $LANG: en_AU.UTF-8
=C2=A0= locale-coding-system: utf-8-unix

Major mode: Fundamental

Min= or modes in effect:
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: = t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0= tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-mod= e: t
=C2=A0 global-font-lock-mode: t
=C2=A0 blink-cursor-mode: t
= =C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0= auto-compression-mode: t
=C2=A0 buffer-read-only: t
=C2=A0 line-numb= er-mode: t
=C2=A0 transient-mark-mode: t

Load-path shadows:
No= ne found.

Features:
(shadow sort mail-extr emacsbug message rmc p= uny dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec passwor= d-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs text-p= roperty-search seq
byte-opt gv bytecomp byte-compile cconv mm-decode mm-= bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader send= mail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date = subr-x
cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-= hooks
lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util<= br>term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulate= d-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode regis= ter page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mo= use jit-lock font-lock syntax facemenu font-core
term/tty-colors frame m= inibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibet= an thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek roman= ian slovak czech european ethiopic indian
cyrillic chinese composite cha= rscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev ob= array cl-preloaded nadvice loaddefs
button faces cus-face macroexp files= text-properties overlay sha1 md5
base64 format env code-pages mule cust= om widget hashtable-print-readable
backquote threads kqueue cocoa ns mul= ti-tty make-network-process emacs)

Memory information:
((conses 1= 6 45081 6477)
=C2=A0(symbols 48 5924 1)
=C2=A0(strings 32 15291 1697)=
=C2=A0(string-bytes 1 507781)
=C2=A0(vectors 16 10217)
=C2=A0(vec= tor-slots 8 127225 14272)
=C2=A0(floats 8 19 50)
=C2=A0(intervals 56 = 185 0)
=C2=A0(buffers 1000 12))
--000000000000201a5a05d11f37a9--