* spam-report.el (spam-report-url-ping-plain): Include a
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 20 Oct 2003 21:05:28 +0000 (21:05 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 20 Oct 2003 21:05:28 +0000 (21:05 +0000)
User-Agent.

* gnus-msg.el (gnus-extended-version): Use it.

* gnus-util.el (gnus-emacs-version): Separated out into own
function.

lisp/ChangeLog
lisp/gnus-msg.el
lisp/gnus-util.el
lisp/spam-report.el

index 04a6a81..c98061d 100644 (file)
@@ -1,3 +1,13 @@
+2003-10-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * spam-report.el (spam-report-url-ping-plain): Include a
+       User-Agent. 
+
+       * gnus-msg.el (gnus-extended-version): Use it.
+
+       * gnus-util.el (gnus-emacs-version): Separated out into own
+       function. 
+
 2003-10-19  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * message.el (message-mode-field-menu): Added
@@ -7,6 +17,8 @@
 
 2003-10-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-sum.el (gnus-nov-parse-line): Remove condition-cases.
+
        * mml.el (mml-insert-mime): Quote mml.
 
 2003-10-19  Katsumi Yamaoka  <yamaoka@jpl.org>
index 9744339..bc8c447 100644 (file)
@@ -1051,39 +1051,7 @@ See the variable `gnus-user-agent'."
          (concat "Gnus/"
                  (prin1-to-string (gnus-continuum-version gnus-version) t)
                  " (" gnus-version ")"))
-        (system-v
-         (cond
-          ((eq gnus-user-agent 'emacs-gnus-config)
-           system-configuration)
-          ((eq gnus-user-agent 'emacs-gnus-type)
-           (symbol-name system-type))
-          (t nil)))
-        (emacs-v
-         (cond
-          ((eq gnus-user-agent 'gnus)
-           nil)
-          ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
-           (concat "Emacs/" (match-string 1 emacs-version)
-                   (if system-v
-                       (concat " (" system-v ")")
-                     "")))
-          ((string-match
-            "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)[^(]*\\(\\((beta.*)\\|'\\)\\)?"
-            emacs-version)
-           (concat
-            (match-string 1 emacs-version)
-            (format "/%d.%d" emacs-major-version emacs-minor-version)
-            (if (match-beginning 3)
-                (match-string 3 emacs-version)
-              "")
-            (if (boundp 'xemacs-codename)
-                (concat
-                 " (" xemacs-codename
-                 (if system-v
-                     (concat ", " system-v ")")
-                   ")"))
-              "")))
-          (t emacs-version))))
+        (emacs-v (gnus-emacs-version)))
     (if (stringp gnus-user-agent)
        gnus-user-agent
       (concat gnus-v
index 45e830a..c8fad2e 100644 (file)
@@ -1432,6 +1432,40 @@ predicate on the elements."
          (push (pop list1) res)))
       (nconc (nreverse res) list1 list2))))
 
+(defun gnus-emacs-version ()
+  (let ((system-v
+        (cond
+         ((eq gnus-user-agent 'emacs-gnus-config)
+          system-configuration)
+         ((eq gnus-user-agent 'emacs-gnus-type)
+          (symbol-name system-type))
+         (t nil))))
+    (cond
+     ((eq gnus-user-agent 'gnus)
+      nil)
+     ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
+      (concat "Emacs/" (match-string 1 emacs-version)
+             (if system-v
+                 (concat " (" system-v ")")
+               "")))
+     ((string-match
+       "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)[^(]*\\(\\((beta.*)\\|'\\)\\)?"
+       emacs-version)
+      (concat
+       (match-string 1 emacs-version)
+       (format "/%d.%d" emacs-major-version emacs-minor-version)
+       (if (match-beginning 3)
+          (match-string 3 emacs-version)
+        "")
+       (if (boundp 'xemacs-codename)
+          (concat
+           " (" xemacs-codename
+           (if system-v
+               (concat ", " system-v ")")
+             ")"))
+        "")))
+     (t emacs-version))))
+
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here
index 0f546aa..cde38f8 100644 (file)
@@ -108,9 +108,10 @@ the function specified by `spam-report-url-ping-function'."
                 80))
          (error "Could not open connection to %s" host))
       (set-marker (process-mark tcp-connection) (point-min))
-      (process-send-string tcp-connection
-                          (format "GET %s HTTP/1.1\nHost: %s\n\n"
-                                  report host)))))
+      (process-send-string
+       tcp-connection
+       (format "GET %s HTTP/1.1\nUser-Agent: %s (spam-report.el)\nHost: %s\n\n"
+              report (gnus-emacs-version) host)))))
 
 (defun spam-report-url-ping-mm-url (host report)
   "Ping a host through HTTP, addressing a specific GET resource. Use