aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-11-03 15:28:45 -0400
committerStefan Monnier2011-11-03 15:28:45 -0400
commit3ccc1742ba32bf118c15d19b639032fbf503fcea (patch)
tree7cd0b9c8ac9b084dfc108127ee7d314564d44814
parent3ab15fd62dfe3a0284df38ee415b5b95f040dc2a (diff)
downloademacs-3ccc1742ba32bf118c15d19b639032fbf503fcea.tar.gz
emacs-3ccc1742ba32bf118c15d19b639032fbf503fcea.zip
* lisp/gnus/nnimap.el (nnimap-open-connection-1): Use tcp-keealive if possible.
-rw-r--r--lisp/gnus/ChangeLog4
-rw-r--r--lisp/gnus/nnimap.el8
2 files changed, 12 insertions, 0 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 12cbd30df68..3fb44bb5b10 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,7 @@
12011-11-03 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * nnimap.el (nnimap-open-connection-1): Use tcp-keealive if possible.
4
12011-11-02 Teodor Zlatanov <tzz@lifelogs.com> 52011-11-02 Teodor Zlatanov <tzz@lifelogs.com>
2 6
3 * gnus-util.el (gnus-bound-and-true-p): Another comment to explain why 7 * gnus-util.el (gnus-bound-and-true-p): Another comment to explain why
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 77372c246cb..cda17ba57c6 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -397,6 +397,14 @@ textual parts.")
397 (stream-type (plist-get props :type))) 397 (stream-type (plist-get props :type)))
398 (when (and stream (not (memq (process-status stream) '(open run)))) 398 (when (and stream (not (memq (process-status stream) '(open run))))
399 (setq stream nil)) 399 (setq stream nil))
400
401 (when (and (fboundp 'set-network-process-option) ;; Not in XEmacs.
402 (fboundp 'process-type) ;; Emacs 22 doesn't provide it.
403 (eq (process-type stream) 'network))
404 ;; Use TCP-keepalive so that connections that pass through a NAT
405 ;; router don't hang when left idle.
406 (set-network-process-option stream :keepalive t))
407
400 (setf (nnimap-process nnimap-object) stream) 408 (setf (nnimap-process nnimap-object) stream)
401 (setf (nnimap-stream-type nnimap-object) stream-type) 409 (setf (nnimap-stream-type nnimap-object) stream-type)
402 (if (not stream) 410 (if (not stream)