* gnus-art.el (gnus-use-idna)
[gnus] / lisp / mm-url.el
index 23909d3..a143089 100644 (file)
@@ -1,7 +1,6 @@
 ;;; mm-url.el --- a wrapper of url functions/commands for Gnus
 
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005,
-;;   2006 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 
@@ -9,7 +8,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published
-;; by the Free Software Foundation; either version 2, or (at your
+;; by the Free Software Foundation; either version 3, or (at your
 ;; option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful, but
@@ -57,7 +56,7 @@
   '((wget "wget" "--user-agent=mm-url" "-q" "-O" "-")
     (w3m  "w3m" "-dump_source")
     (lynx "lynx" "-source")
-    (curl "curl" "--silent" "--user-agent mm-url" "--location")))
+    (curl "curl" "--silent" "--user-agent" "mm-url" "--location")))
 
 (defcustom mm-url-program
   (cond
@@ -294,6 +293,13 @@ If `mm-url-use-external' is non-nil, use `mm-url-program'."
        (list url (buffer-size)))
     (mm-url-load-url)
     (let ((name buffer-file-name)
+         (url-request-extra-headers
+          ;; ISTM setting a Connection header was a workaround for
+          ;; older versions of url included with w3, but it does more
+          ;; harm than good with the one shipped with Emacs. --ansel
+          (if (not (and (boundp 'url-version)
+                        (equal url-version "Emacs")))
+              (list (cons "Connection" "Close"))))
          (url-package-name (or mm-url-package-name
                                url-package-name))
          (url-package-version (or mm-url-package-version