branch: elpa-admin
commit ccdc859c4af10ceb8e4b9c869d03899e3e25b51f
Author: Stefan Monnier <[email protected]>
Commit: Stefan Monnier <[email protected]>
elpaa--wsl: Filter out more bogus requests and fix pp bug
* elpa-admin.el (elpaa--wsl-read): Ignore all 4xx error codes.
(elpaa--wsl-collect): Fix call to `pp-28`.
---
elpa-admin.el | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/elpa-admin.el b/elpa-admin.el
index ac29394782..1010c72192 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -2149,7 +2149,8 @@ arbitrary code."
(message "Unrecognized timestamp: %s" timestr)
timestr))
(time (elpaa--string-to-seconds timestr)))
- (when (not (member status '("404" "400" "408")))
+ ;; Ignore unsuccessful requests, usually fishing expeditions.
+ (when (and (stringp status) (string-match "\\`2" status))
(if (not (string-match elpaa--wsl-request-re request))
(message "Unrecognized request (status=%s): %s" status request)
(let* ((file (match-string 1 request))
@@ -2244,11 +2245,10 @@ arbitrary code."
(elpaa--wsl-one-file logfile table)))))
(when changed
(with-temp-buffer
- (funcall (if (fboundp 'pp-28) #'pp-28 #'pp)
- `(:web-server-log-stats ,newseen ,table
+ (let ((data `(:web-server-log-stats ,newseen ,table
;; Rebuild the scoreboard "by week".
- ,(elpaa--wsl-scores table))
- (current-buffer))
+ ,(elpaa--wsl-scores table))))
+ (if (fboundp 'pp-28) (pp-28 data) (pp data (current-buffer))))
(princ "\n" (current-buffer))
(write-region nil nil elpaa--wsl-stats-file)))))