emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in url/url-http.el


From: Ari Roponen
Subject: Bug in url/url-http.el
Date: Wed, 1 Mar 2006 15:46:09 +0200 (EET)

Hi,

when I execute this with C-x C-e:

  (url-retrieve-synchronously "http://www.gnu.org/";)

I get the following error message:

  Debugger entered--Lisp error: (error "Process www.gnu.org not running")
    process-send-string(#<process www.gnu.org> "GET / HTTP/1.1\n...")
    url-http(["http" nil nil "www.gnu.org" 80 "/" nil nil t] ... nil)
    url-retrieve("http://www.gnu.org/"; ...)
    url-retrieve-synchronously("http://www.gnu.org/";)
    eval((url-retrieve-synchronously "http://www.gnu.org/";))
    eval-last-sexp-1(nil)
    eval-last-sexp(nil)
    call-interactively(eval-last-sexp)


After some debugging I found the reason for this. In file
`url-http.el', function `url-http-find-free-connection'
contains this at the end:

  ...
  (let ((buf (generate-new-buffer " *url-http-temp*")))
    ;; `url-open-stream' needs a buffer in which to do things
    ;; like authentication.  But we use another buffer afterwards.
    (unwind-protect (url-open-stream host buf host port)
      (kill-buffer buf)))

When `kill-buffer' is called, it also kills the new process returned by
`url-open-stream'.

The following patch (or something similar) should solve this.

-
Ari Roponen


--- url-http.el.orig    2006-03-01 15:24:33.000000000 +0200
+++ url-http.el 2006-03-01 15:26:27.000000000 +0200
@@ -118,10 +118,12 @@
     (url-http-mark-connection-as-busy
      host port
      (or found
-         (let ((buf (generate-new-buffer " *url-http-temp*")))
+         (let ((buf (generate-new-buffer " *url-http-temp*")) stream)
            ;; `url-open-stream' needs a buffer in which to do things
            ;; like authentication.  But we use another buffer afterwards.
-           (unwind-protect (url-open-stream host buf host port)
+           (unwind-protect
+              (prog1 (setq stream (url-open-stream host buf host port))
+                (set-process-buffer stream nil))
              (kill-buffer buf)))))))

 ;; Building an HTTP request




reply via email to

[Prev in Thread] Current Thread [Next in Thread]