mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-21 12:27:33 +00:00
Ensure that nnimap doesn't send too long lines to the server
* lisp/gnus/nnimap.el (nnimap-retrieve-headers): Don't send too-long lines to the server (bug#56138).
This commit is contained in:
parent
716a0f4025
commit
ea640581ba
1 changed files with 15 additions and 6 deletions
|
|
@ -239,12 +239,21 @@ during splitting, which may be slow."
|
|||
(when (nnimap-change-group group server)
|
||||
(with-current-buffer (nnimap-buffer)
|
||||
(erase-buffer)
|
||||
(nnimap-wait-for-response
|
||||
(nnimap-send-command
|
||||
"UID FETCH %s %s"
|
||||
(nnimap-article-ranges (gnus-compress-sequence articles))
|
||||
(nnimap-header-parameters))
|
||||
t)
|
||||
(let ((ranges (gnus-compress-sequence articles))
|
||||
sequence)
|
||||
;; If we have a lot of ranges, split them up to avoid
|
||||
;; generating too-long lines. (The limit is 8192 octects,
|
||||
;; and this should guarantee that it's (much) shorter than
|
||||
;; that.)
|
||||
(while ranges
|
||||
(setq sequence
|
||||
(nnimap-send-command
|
||||
"UID FETCH %s %s"
|
||||
(nnimap-article-ranges (seq-take ranges 200))
|
||||
(nnimap-header-parameters)))
|
||||
(setq ranges (nthcdr 200 ranges)))
|
||||
;; Wait for the final one.
|
||||
(nnimap-wait-for-response sequence t))
|
||||
(unless (process-live-p (get-buffer-process (current-buffer)))
|
||||
(error "IMAP server %S closed connection" nnimap-address))
|
||||
(nnimap-transform-headers)
|
||||
|
|
|
|||
Loading…
Reference in a new issue