From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Seltenreich Newsgroups: gmane.emacs.devel Subject: Race condition in url-http.el Date: Sat, 22 Apr 2006 18:20:21 +0200 Message-ID: <87irp1y43e.fsf@gate450.dyndns.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1145722850 17273 80.91.229.2 (22 Apr 2006 16:20:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 22 Apr 2006 16:20:50 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 22 18:20:49 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FXKql-00086g-A4 for ged-emacs-devel@m.gmane.org; Sat, 22 Apr 2006 18:20:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FXKqk-00083E-Pu for ged-emacs-devel@m.gmane.org; Sat, 22 Apr 2006 12:20:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FXKqT-00081o-1v for emacs-devel@gnu.org; Sat, 22 Apr 2006 12:20:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FXKqR-00081V-3k for emacs-devel@gnu.org; Sat, 22 Apr 2006 12:20:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FXKqQ-00081S-Ul for emacs-devel@gnu.org; Sat, 22 Apr 2006 12:20:26 -0400 Original-Received: from [129.13.185.218] (helo=smtp2.rz.uni-karlsruhe.de) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FXKsF-0002Ob-Ew for emacs-devel@gnu.org; Sat, 22 Apr 2006 12:22:19 -0400 Original-Received: from rzstud1.stud.uni-karlsruhe.de (rzstud1.stud.uni-karlsruhe.de [193.196.41.33]) by smtp2.rz.uni-karlsruhe.de with esmtp (Exim 4.50 #1) id 1FXKqN-0007Nw-6p; Sat, 22 Apr 2006 18:20:23 +0200 Original-Received: from uwi7 by rzstud1.stud.uni-karlsruhe.de with local (Exim 3.36 #1) id 1FXKqU-000454-00 for emacs-devel@gnu.org; Sat, 22 Apr 2006 18:20:30 +0200 Original-To: emacs-devel@gnu.org X-PGP-Key: 0x2C006B340F8C8C1B X-Now-Playing: Cure / Pornography / One Hundred Years X-Adorno-Quote: Nur solches Denken ist hart genug, die Mythen zu zerbrechen, das sich selbst Gewalt antut. X-Hashcash: 1:24:060422:emacs-devel@gnu.org::QbZewPh+uGh8tvGE:06Vz4 User-Agent: Gnus/5.110005 (No Gnus v0.5) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:53238 Archived-At: --=-=-= Hi, url-http.el seems to attempt reusing connections despite the presence of a "Connection: close" header if the server didn't close the connection fast enough. This is easily triggered when url-http is following redirects, in which case it just returns an empty buffer. The attached patch seems to fix it. I'm not sure if it is the right way to fix it, but the sentinel seems to do proper cleanup after the delete-process on the network connection. Thanks, andreas --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=url-http.patch Index: url-http.el =================================================================== RCS file: /sources/emacs/emacs/lisp/url/url-http.el,v retrieving revision 1.28 diff -c -r1.28 url-http.el *** url-http.el 7 Mar 2006 17:21:16 -0000 1.28 --- url-http.el 22 Apr 2006 15:39:45 -0000 *************** *** 386,391 **** --- 386,393 ---- (url-http-parse-response) (mail-narrow-to-head) ;;(narrow-to-region (point-min) url-http-end-of-headers) + (if (string= (downcase (mail-fetch-field "Connection")) "close") + (delete-process url-http-process)) (let ((class nil) (success nil)) (setq class (/ url-http-response-status 100)) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--