emacs-devel
[Top][All Lists]
Advanced

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

url-http: Unexpected reuse of connection


From: Shun-ichi GOTO
Subject: url-http: Unexpected reuse of connection
Date: Wed, 15 Nov 2006 12:07:12 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.0.90 (i386-msvc-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.00-dev (KIKU)

I experienced unexpected (invalid) re-use of connection on accessing
via proxy server.

When we use url function with proxy, request is made with
"Connection: close", but url-http-parse-header<f> close connection 
only if

 "Connection:" header is in response
 AND
 its value is "close".

I think it should be corrected to:

 "Connection:" header is NOT in response
 OR
 its value is "close".

In actual case, my proxy server doesn't return "Connection" header.
Therefore, url-http-parse-header<f> leaves the connection.
Then url-http-find-free-connection<f> find and reuse the connection
when its sentinel is not yet run (process status is 'open).
Finaly, 2nd url-retrieve<f> call very after 1st call
sends request into closed (not sentinel'ed) connection, and fail.

# Yes, I think this is rare timing case.

Here is a patch:
Index: url-http.el
===================================================================
--- url-http.el (revision 4177)
+++ url-http.el (working copy)
@@ -391,8 +391,8 @@
   (mail-narrow-to-head)
   ;;(narrow-to-region (point-min) url-http-end-of-headers)
   (let ((connection (mail-fetch-field "Connection")))
-    (if (and connection
-            (string= (downcase connection) "close"))
+    (if (or (null connection)
+           (string= (downcase connection) "close"))
        (delete-process url-http-process)))
   (let ((class nil)
        (success nil))

--- Regards,
 Shun-ichi Goto  <address@hidden>
   R&D Group, TAIYO Corp., Tokyo, JAPAN






reply via email to

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