[gnus git] branch master updated: n0-17-372-g76b52f3 =1= nnimap.el (nnimap-open-connection-1): Use tcp-keealive if possible.

Katsumi Yamaoka <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  76b52f35ba35be09d3b15184f062e91c2fe9fb56 (commit)
      from  07ca14ba05aebc722f7edac0122c73b6bbf4c110 (commit)


- Log -----------------------------------------------------------------
commit 76b52f35ba35be09d3b15184f062e91c2fe9fb56
Author: Stefan Monnier <[email protected]>
Date:   Thu Nov 3 22:11:57 2011 +0000

    nnimap.el (nnimap-open-connection-1): Use tcp-keealive if possible.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e8d44de..0d7d392 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -6,6 +6,10 @@
 
 	* message.el (message-send-and-exit): Document `arg'.
 
+2011-11-03  Stefan Monnier  <[email protected]>
+
+	* nnimap.el (nnimap-open-connection-1): Use tcp-keealive if possible.
+
 2011-11-02  Teodor Zlatanov  <[email protected]>
 
 	* gnus-sync.el: More commentary about `gnus-sync-read' issues.
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 77372c2..cda17ba 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -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)

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    4 ++++
 lisp/nnimap.el |    8 ++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.