unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49570: 28.0.50; url-http proxy connection-wait
@ 2021-07-15  9:55 Madhu
  2021-07-15 14:47 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 18+ messages in thread
From: Madhu @ 2021-07-15  9:55 UTC (permalink / raw)
  To: 49570

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


When accessing https://melpa.org (an nginx webserver) through a
http-proxy (by setting url-proxy-services, say to privoxy), url-http
hangs when parsing headers. apparently the connection is dropped with
emacs master. I'm on this commit on master

GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw3d scroll bars) of 2021-06-15
 794ec934a76d0647a72b7be32e20dc5b95e5ec11

#ELISP> (setq url-proxy-services '(("http" . "localhost:8118") ("https" . "localhost:8118")))
ELISP> (url-retrieve-synchronously (url-generic-parse-url "https://melpa.org/"))
#<buffer  *http melpa.org:443*>

And the buffer looks like

#+BEGIN_EXAMPLE

Process melpa.org connection broken by remote peer
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 15 Jul 2021 09:41:12 GMT
Content-Type: text/html; charset=utf-8
Last-Modified: Wed, 10 Feb 2021 23:56:44 GMT
Connection: close
Vary: Accept-Encoding
ETag: W/"602472bc-d92"
Strict-Transport-Security: max-age=15768000
Content-Encoding: gzip
#+END_EXAMPLE

The connection is broken and the "\nProcess HOST connection broken by
remote peer\n" line in the buffer means the spins without parsing the
header.


Now proxied requests are asynchronous.

If I (setf (url-asynchronous url) t) in lisp/url/url.el:
(url-retrieve-internal), as per the appended patch, then eventually
make-network-process gets called with a :nowait t, and the connection
pulls through.

But I'm not sure if this is the right thing or if the problem is
elsewhere as this problem doesn't happen on older emacs - say from
2020-10-15.

Do others see this problem?

[BTW I haven't seen paul eggert on the lists lately, any word if he is
still too busy for emacs?]



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: proxy connections non-blocking --]
[-- Type: text/x-diff, Size: 551 bytes --]

diff --git a/lisp/url/url.el b/lisp/url/url.el
index 00c5740cf8..e40a4ecc29 100644
--- a/lisp/url/url.el
+++ b/lisp/url/url.el
@@ -211,8 +211,9 @@ url-retrieve-internal
 	(buffer nil)
 	(asynch (url-scheme-get-property (url-type url) 'asynchronous-p)))
     (if url-using-proxy
-	(setq asynch t
-	      loader #'url-proxy))
+	(progn (setq asynch t
+	             loader #'url-proxy)
+               (setf (url-asynchronous url) t)))
     (if asynch
 	(let ((url-current-object url))
 	  (setq buffer (funcall loader url callback cbargs)))
-- 
2.31.0


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

end of thread, other threads:[~2021-07-22  9:40 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15  9:55 bug#49570: 28.0.50; url-http proxy connection-wait Madhu
2021-07-15 14:47 ` Lars Ingebrigtsen
2021-07-19 15:42   ` Lars Ingebrigtsen
2021-07-20  6:50     ` Madhu
2021-07-20 14:08       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-20 14:20         ` Lars Ingebrigtsen
2021-07-20 15:13           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-20 15:24             ` Lars Ingebrigtsen
2021-07-20 15:42             ` Eli Zaretskii
2021-07-20 16:22               ` Gregory Heytings
2021-07-21 11:01                 ` Gregory Heytings
2021-07-21 12:46                   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-21 13:06                     ` Eli Zaretskii
2021-07-22  7:30                       ` Gregory Heytings
2021-07-22  8:52                         ` Eli Zaretskii
2021-07-22  9:10                           ` Gregory Heytings
2021-07-22  9:40                             ` Eli Zaretskii
2021-07-21 13:11                     ` Gregory Heytings

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).