Subject: Re: 25.1.50; eww: Symbol’s value as variable is void: url-http-response-status

From: Tao Fang <[email-masked]>
Date: Sun, 17 Apr 2016 01:19:01 +0800

Hi, Michael

After some digging, I found a code bug in commit
3c623c26ae7d695746e05d8a2e16a67a6256b024 introduced by me and maybe
relavant to your report.

lisp/url/url-http.el:

  1319	(defun url-https-proxy-after-change-function (st nd length)
......
  1327	      (url-http-parse-response)
  1328	      (cond
......
  1360	       (t
  1361	        (url-http-activate-callback)
  1362	        (message "error response: %d" url-http-response-status))))))
......

When using url-http in eww and the above "cond" last clause succeed
(i.e. at first connecting to proxy response not HTTP 200), "url-http-activate-callback" will call
function "eww-render" which calls (kill-buffer), so the code next line
visit symbol url-http-response-status will cause the error: "Symbol’s
value as variable is void: url-http-response-status".

This can be fixed simplely transpose that two code lines:
>From 323cf52e870f6f6a5965d22891ea27f87b971011 Mon Sep 17 00:00:00 2001
From: Tao Fang <[email-masked]>
Date: Sun, 17 Apr 2016 00:21:09 +0800
Subject: [PATCH] fix: (void-variable url-http-response-status)

---
 lisp/url/url-http.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 1fe9ac2..5cf641d 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -1358,8 +1358,8 @@ The return value of this function is the retrieval buffer."
                (error "error: %s" e)))
           (error "error: gnutls support needed!")))
        (t
-        (url-http-activate-callback)
-        (message "error response: %d" url-http-response-status))))))
+        (message "error response: %d" url-http-response-status)
+        (url-http-activate-callback))))))
 
 (defun url-http-async-sentinel (proc why)
   ;; We are performing an asynchronous connection, and a status change
-- 
2.8.1

Can you help to apply the patch and test on that in your environment?

And I'm not sure about this, because only using https proxy will enter
this function(if I do it right?), I still need to find out about it.

Thanks for your help!

-- 
Emacs/Gnus