unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Seltenreich <seltenreich@gmx.de>
Subject: Race condition in url-http.el
Date: Sat, 22 Apr 2006 18:20:21 +0200	[thread overview]
Message-ID: <87irp1y43e.fsf@gate450.dyndns.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: url-http.patch --]
[-- Type: text/x-patch, Size: 654 bytes --]

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))

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

             reply	other threads:[~2006-04-22 16:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-22 16:20 Andreas Seltenreich [this message]
2006-04-22 16:45 ` Race condition in url-http.el Andreas Seltenreich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87irp1y43e.fsf@gate450.dyndns.org \
    --to=seltenreich@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).