]> code.delx.au - gnu-emacs/commitdiff
* lisp/gnus/nnimap.el (nnimap-open-connection-1): Use tcp-keealive if possible.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 3 Nov 2011 19:28:45 +0000 (15:28 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 3 Nov 2011 19:28:45 +0000 (15:28 -0400)
lisp/gnus/ChangeLog
lisp/gnus/nnimap.el

index 12cbd30df68a39ce35669aa6d421501987446f2c..3fb44bb5b10d15f05fbdbeafb911a4d318afd2c2 100644 (file)
@@ -1,3 +1,7 @@
+2011-11-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * nnimap.el (nnimap-open-connection-1): Use tcp-keealive if possible.
+
 2011-11-02  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * gnus-util.el (gnus-bound-and-true-p): Another comment to explain why
index 77372c246cb44dc3030334ebf274488e66972374..cda17ba57c68aed1eb8c27c23852b88e8c15d438 100644 (file)
@@ -397,6 +397,14 @@ textual parts.")
             (stream-type (plist-get props :type)))
        (when (and stream (not (memq (process-status stream) '(open run))))
          (setq stream nil))
+
+        (when (and (fboundp 'set-network-process-option) ;; Not in XEmacs.
+                   (fboundp 'process-type) ;; Emacs 22 doesn't provide it.
+                   (eq (process-type stream) 'network))
+          ;; Use TCP-keepalive so that connections that pass through a NAT
+          ;; router don't hang when left idle.
+          (set-network-process-option stream :keepalive t))
+
        (setf (nnimap-process nnimap-object) stream)
        (setf (nnimap-stream-type nnimap-object) stream-type)
        (if (not stream)