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

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

Re: HTTP redirects make url-retrieve-synchronously asynchronous


From: Stefan Monnier
Subject: Re: HTTP redirects make url-retrieve-synchronously asynchronous
Date: Tue, 10 Jan 2006 14:32:32 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> url-retrieve-synchronously becomes asynchronous when HTTP redirects are
> involved.  When it encounters a redirect, url-http-parse-headers calls
> url-retrieve instead of url-retrieve-synchronously.  Naively switching to
> the latter doesn't solve the problem and I haven't been able to find a fix..

I believe I've fixed the problem with the patch below.


        Stefan


--- url.el      03 jan 2006 11:16:30 -0500      1.19
+++ url.el      10 jan 2006 14:29:52 -0500      
@@ -190,7 +190,10 @@
                     "Spinning in url-retrieve-synchronously: %S (%S)"
                     retrieval-done asynch-buffer)
          (if (and proc (memq (process-status proc)
-                              '(closed exit signal failed)))
+                              '(closed exit signal failed))
+                   ;; Make sure another process hasn't been started, as can
+                   ;; happen with http redirections.
+                  (eq proc (or (get-buffer-process asynch-buffer) proc)))
              ;; FIXME: It's not clear whether url-retrieve's callback is
              ;; guaranteed to be called or not.  It seems that url-http
              ;; decides sometimes consciously not to call it, so it's not




reply via email to

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