Avoid race in rcirc process filter (bug#33145)
* lisp/net/rcirc.el (rcirc-filter): Clear rcirc-process-output before processing its constituent lines. Otherwise, if rcirc-filter runs again before the last rcirc-process-server-response is finished, the contents of rcirc-process-output could be duplicated.
This commit is contained in:
parent
88ef31abd4
commit
bd1d61753d
1 changed files with 6 additions and 6 deletions
|
@ -753,12 +753,12 @@ Function is called with PROCESS, COMMAND, SENDER, ARGS and LINE.")
|
||||||
(with-rcirc-process-buffer process
|
(with-rcirc-process-buffer process
|
||||||
(setq rcirc-last-server-message-time (current-time))
|
(setq rcirc-last-server-message-time (current-time))
|
||||||
(setq rcirc-process-output (concat rcirc-process-output output))
|
(setq rcirc-process-output (concat rcirc-process-output output))
|
||||||
(when (= (aref rcirc-process-output
|
(when (= ?\n (aref rcirc-process-output
|
||||||
(1- (length rcirc-process-output))) ?\n)
|
(1- (length rcirc-process-output))))
|
||||||
(mapc (lambda (line)
|
(let ((lines (split-string rcirc-process-output "[\n\r]" t)))
|
||||||
(rcirc-process-server-response process line))
|
(setq rcirc-process-output nil)
|
||||||
(split-string rcirc-process-output "[\n\r]" t))
|
(dolist (line lines)
|
||||||
(setq rcirc-process-output nil))))
|
(rcirc-process-server-response process line))))))
|
||||||
|
|
||||||
(defun rcirc-reschedule-timeout (process)
|
(defun rcirc-reschedule-timeout (process)
|
||||||
(with-rcirc-process-buffer process
|
(with-rcirc-process-buffer process
|
||||||
|
|
Loading…
Add table
Reference in a new issue