unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51966: url-retrieve freeze when connecting to identity.xero.com
@ 2021-11-19  7:27 Rui Yang
  2021-11-20  9:49 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Rui Yang @ 2021-11-19  7:27 UTC (permalink / raw)
  To: 51966

[-- Attachment #1: Type: text/plain, Size: 4115 bytes --]

--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’s 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-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=def'

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=/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))

[-- Attachment #2: Type: text/html, Size: 4736 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51966: url-retrieve freeze when connecting to identity.xero.com
  2021-11-19  7:27 bug#51966: url-retrieve freeze when connecting to identity.xero.com Rui Yang
@ 2021-11-20  9:49 ` Lars Ingebrigtsen
  2021-11-21 11:45   ` Rui Yang
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-20  9:49 UTC (permalink / raw)
  To: Rui Yang; +Cc: 51966

Rui Yang <ryang.sei@gmail.com> writes:

> 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’s certificate which caused
> ;; this issue. https://www.google.com.au is fine
> ;; tried starting with emacs option, --no-init

I'm unable to reproduce the issue with either Emacs 27.2 or the current
trunk -- with your test case I just get this page:

HTTP/1.1 301 Moved Permanently
Server: AkamaiGHost
Content-Length: 0
Location: https://login.xero.com/identity/user/login

Is there something else needed to reproduce the problem?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51966: url-retrieve freeze when connecting to identity.xero.com
  2021-11-20  9:49 ` Lars Ingebrigtsen
@ 2021-11-21 11:45   ` Rui Yang
       [not found]     ` <CAHmBojJuwgmJ0MUgaEYh7=U078KThAGqCvEgTCB-vmpdQqfsmw@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Rui Yang @ 2021-11-21 11:45 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 51966


[-- Attachment #1.1: Type: text/plain, Size: 2987 bytes --]

Hi Lars,

Thanks for looking into this.
I did the following, pls help to see if it helps.

1. Emacs from Homebrew Install Emacs using Homebrew in MacOS Big Sur.
- Install using
brew install emacs
- Got an Emacs in Terminal withou GUI
- Pasted the following

> (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/token")
>         (method "POST"))
>    (url-retrieve url 'http-handle-response (append (list method url
> (format "*HTTP %s %s*" method url)) '())))
>  t)
>
- Got response very quickly in the buffer displayed (expected behaviour)

> (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/token")
>         (method "POST"))
>    (url-retrieve url 'http-handle-response (append (list method url
> (format "*HTTP %s %s*" method url)) '())))
>  t)
>

2. Install Emacs from
https://emacsformacosx.com/emacs-builds/Emacs-27.2-3-universal.dmg
- start Emacs from command line with:

> /Applications/Emacs.app/Contents/MacOS/Emacs --no-init
>
- execute the above script
- I got the following:
[image: image.png]
You could see that the *http... buffer is always empty and stay like that
for some time (maybe 30s), and eventually, the mini buffer showed a nil.
[image: image.png]

Could this be an issue only for the binary from emacsformacosx?

Regards,
Rui


On Sat, Nov 20, 2021 at 8:49 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Rui Yang <ryang.sei@gmail.com> writes:
>
> > 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’s certificate which caused
> > ;; this issue. https://www.google.com.au is fine
> > ;; tried starting with emacs option, --no-init
>
> I'm unable to reproduce the issue with either Emacs 27.2 or the current
> trunk -- with your test case I just get this page:
>
> HTTP/1.1 301 Moved Permanently
> Server: AkamaiGHost
> Content-Length: 0
> Location: https://login.xero.com/identity/user/login
>
> Is there something else needed to reproduce the problem?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>

[-- Attachment #1.2: Type: text/html, Size: 4775 bytes --]

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 348140 bytes --]

[-- Attachment #3: image.png --]
[-- Type: image/png, Size: 330005 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51966: url-retrieve freeze when connecting to identity.xero.com
       [not found]         ` <CAHmBojJKY=RasnTOZUPZitJQrNqch6tNMN6tPsM63s4VY-P_dQ@mail.gmail.com>
@ 2021-11-29 14:02           ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-29 14:02 UTC (permalink / raw)
  To: Rui Yang; +Cc: 51966

Rui Yang <ryang.sei@gmail.com> writes:

> Please close the ticket and thanks again for your time in looking into this
> matter.

OK; closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-29 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-19  7:27 bug#51966: url-retrieve freeze when connecting to identity.xero.com Rui Yang
2021-11-20  9:49 ` Lars Ingebrigtsen
2021-11-21 11:45   ` Rui Yang
     [not found]     ` <CAHmBojJuwgmJ0MUgaEYh7=U078KThAGqCvEgTCB-vmpdQqfsmw@mail.gmail.com>
     [not found]       ` <CAHmBojLBXue96jPG6+PKrN9dJ2-cCBwENu9=q0nN9xNFjDRWfw@mail.gmail.com>
     [not found]         ` <CAHmBojJKY=RasnTOZUPZitJQrNqch6tNMN6tPsM63s4VY-P_dQ@mail.gmail.com>
2021-11-29 14:02           ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).