erbot-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Erbot-cvs] erbot erbc.el erbot.el ChangeLog


From: D. Goel
Subject: [Erbot-cvs] erbot erbc.el erbot.el ChangeLog
Date: Thu, 20 Apr 2006 14:37:03 +0000

CVSROOT:        /cvsroot/erbot
Module name:    erbot
Branch:         
Changes by:     D. Goel <address@hidden>        06/04/20 14:37:03

Modified files:
        .              : erbc.el erbot.el ChangeLog 

Log message:
        Minor new variables to disable url fetching.  Else, bot can slow down.
        Disable by default, and when paranoid.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/erbot/erbot/erbc.el.diff?tr1=1.122&tr2=1.123&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/erbot/erbot/erbot.el.diff?tr1=1.50&tr2=1.51&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/erbot/erbot/ChangeLog.diff?tr1=1.42&tr2=1.43&r1=text&r2=text

Patches:
Index: erbot/ChangeLog
diff -u erbot/ChangeLog:1.42 erbot/ChangeLog:1.43
--- erbot/ChangeLog:1.42        Wed Apr 19 20:04:53 2006
+++ erbot/ChangeLog     Thu Apr 20 14:37:03 2006
@@ -1,3 +1,10 @@
+2006-04-20  D Goel  <address@hidden>
+
+       * erbc.el (erbn-url-functions-p): new variable.  Disallow url's
+       unless enabled here.  Else potential freeze.
+       (erbn-internal-web-page-time): rename from the one below.
+       (fs-internal-web-page-time): rename to the one above
+
 2006-04-19  D Goel  <address@hidden>
 
        * erbtranslate.el: fix minor doc typo
Index: erbot/erbc.el
diff -u erbot/erbc.el:1.122 erbot/erbc.el:1.123
--- erbot/erbc.el:1.122 Tue Mar 21 16:08:20 2006
+++ erbot/erbc.el       Thu Apr 20 14:37:03 2006
@@ -1,5 +1,5 @@
 ;;; erbc.el --- Erbot user-interface commands -- see also erbc5.el
-;; Time-stamp: <2006-03-21 11:06:42 deego>
+;; Time-stamp: <2006-04-20 10:33:03 deego>
 ;; Copyright (C) 2002 D. Goel
 ;; Emacs Lisp Archive entry
 ;; Filename: erbc.el
@@ -4422,22 +4422,37 @@
 
 (defalias 'fsi-shell-test 'erbn-shell-test)
 
-(defcustom fs-internal-web-page-time 10
+(defcustom erbn-internal-web-page-time 10
   "" :group 'erbc)
+(defcustom erbn-url-functions-p nil
+  "when true, enable url functions, provided that erbot-paranoid-p
+allows us that.
+
+The reason you may not want to enable this function is that when you
+fetch url's like http://205.188.215.230:8012 (icecast, etc. content),
+url.el continues fetching that url forever.  The bot times out, but
+url continues fetching it in the background, slowing down your bot."
+  :group 'erbc)
+
+
 
 (defmacro erbn-with-web-page-buffer (site &rest body)
   (let ((buffer (make-symbol "web-buffer")))
-    `(with-timeout (fs-internal-web-page-time "HTTP time out")
-       (let ((,buffer (url-retrieve-synchronously ,site)))
-         (when (null ,buffer)
-           (error "Invalid URL %s" site))
-         (save-excursion
-           (set-buffer ,buffer)
-           (goto-char (point-min))
-           (prog1
-               (progn
-                 ,@body)
-             (kill-buffer ,buffer)))))))
+    `(progn
+       (unless (and (not erbot-paranoid-p)
+                   erbn-url-functions-p)
+        (error "erbn-url-functions-p is disabled"))
+       (with-timeout (erbn-internal-web-page-time "HTTP time out")
+        (let ((,buffer (url-retrieve-synchronously ,site)))
+          (when (null ,buffer)
+            (error "Invalid URL %s" site))
+          (save-excursion
+            (set-buffer ,buffer)
+            (goto-char (point-min))
+            (prog1
+                (progn
+                  ,@body)
+              (kill-buffer ,buffer))))))))
 
 (defun fsi-web-page-title (&optional site &rest args)
   (unless site (error (format "Syntax: %s web-page-title SITE" erbn-char)))
Index: erbot/erbot.el
diff -u erbot/erbot.el:1.50 erbot/erbot.el:1.51
--- erbot/erbot.el:1.50 Fri Apr  7 16:53:11 2006
+++ erbot/erbot.el      Thu Apr 20 14:37:03 2006
@@ -1,5 +1,5 @@
 ;;; erbot.el --- Another robot for ERC.
-;; Time-stamp: <2006-04-07 12:51:41 deego>
+;; Time-stamp: <2006-04-20 10:25:52 deego>
 ;; Emacs Lisp Archive entry
 ;; Filename: erbot.el
 ;; Package: erbot
@@ -125,7 +125,9 @@
   " Meant as a CATCHALL for security. Setting this variable to non-nil
 should disable most features. When non-nil, all potentially funny
 functions are disabled.  We think these functions are safe, but we
-disable them in any case.
+disable them in any case.  We also disable all functions that we can
+that may potentially freeze the bot or severly slow it down upon
+receiving weird requests.
 
 
 t by default.  No enablings like erbot-setf-p, etc. will work




reply via email to

[Prev in Thread] Current Thread [Next in Thread]