From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Madhu Newsgroups: gmane.emacs.bugs Subject: bug#49570: 28.0.50; url-http proxy connection-wait Date: Thu, 15 Jul 2021 15:25:06 +0530 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12663"; mail-complaints-to="usenet@ciao.gmane.io" To: 49570@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 15 12:18:22 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 1m3yRi-00038Z-Nc for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Jul 2021 12:18:22 +0200 Original-Received: from localhost ([::1]:42344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3yRh-0003Gl-L5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Jul 2021 06:18:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3yRO-0002wt-Ut for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35349) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3yRO-0004Nc-N1 for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m3yRO-0000lX-GA for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Madhu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Jul 2021 10:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49570 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.16263442342878 (code B ref -1); Thu, 15 Jul 2021 10:18:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Jul 2021 10:17:14 +0000 Original-Received: from localhost ([127.0.0.1]:46895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3yQc-0000kM-CR for submit@debbugs.gnu.org; Thu, 15 Jul 2021 06:17:14 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:56256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3yQa-0000kE-Ey for submit@debbugs.gnu.org; Thu, 15 Jul 2021 06:17:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3yQa-0001tb-93 for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:17:12 -0400 Original-Received: from [117.254.35.72] (port=27322 helo=localhost.localdomain) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3yQU-00035i-Na for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:17:11 -0400 Original-Received: (qmail 32021 invoked by uid 500); 15 Jul 2021 09:55:06 -0000 X-Host-Lookup-Failed: Reverse DNS lookup failed for 117.254.35.72 (failed) Received-SPF: softfail client-ip=117.254.35.72; envelope-from=enometh@meer.net; helo=localhost.localdomain X-Spam_score_int: 33 X-Spam_score: 3.3 X-Spam_bar: +++ X-Spam_report: (3.3 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_ZBI=0.001, RCVD_IN_PBL=3.335, RCVD_IN_XBL=0.375, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action 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:210023 Archived-At: --=-=-= Content-Type: text/plain 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/")) # 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?] --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-protect-url-retrieve-synchronously-from-broken-proxi.patch Content-Description: proxy connections non-blocking 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 --=-=-=--