(riece-flush-send-queue): New function.
(riece-process-send-string): Use it.
(riece-reset-process-buffer): Reset riece-send-queue,
- riece-last-send-time, riece-send-size.
+ riece-send-size.
* riece-options.el (riece-max-send-size): New user option.
(riece-send-delay): New user option.
* riece-globals.el (riece-send-queue): New variable.
- (riece-last-send-time): New variable.
(riece-send-size): New variable.
2004-09-14 OHASHI Akira <bg66@koka-in.org>
(defvar riece-send-queue nil
"Send queue for avoiding client flood.
Local to the server buffers.")
-(defvar riece-last-send-time nil
- "Timestamp of the last send.
-Local to the server buffers.")
(defvar riece-send-size nil
"Size of the last send.
Local to the server buffers.")
(if (> length riece-max-send-size)
(message "Long message (%d > %d)" length riece-max-send-size)
(setq riece-send-size (+ riece-send-size length))
- (when (<= riece-send-size riece-max-send-size)
- (process-send-string process string)
- (setq riece-last-send-time (current-time))))
+ (if (<= riece-send-size riece-max-send-size)
+ (process-send-string process string)))
(setq riece-send-queue (cdr riece-send-queue)))
(if riece-send-queue
(riece-run-at-time riece-send-delay nil
(make-local-variable 'riece-server-name)
(make-local-variable 'riece-read-point)
(make-local-variable 'riece-send-queue)
- (make-local-variable 'riece-last-send-time)
- (setq riece-last-send-time '(0 0 0))
(make-local-variable 'riece-send-size)
(setq riece-send-size 0)
(setq riece-read-point (point-min))