Update of /cvsroot/mahogany/M/src/mail
In directory usw-pr-cvs1:/tmp/cvs-serv14544/src/mail

Modified Files:
        MailFolderCC.cpp 
Log Message:
close the kept alive connections slightly sooner

Index: MailFolderCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolderCC.cpp,v
retrieving revision 1.612
retrieving revision 1.613
diff -b -u -2 -r1.612 -r1.613
--- MailFolderCC.cpp    28 Apr 2002 14:53:43 -0000      1.612
+++ MailFolderCC.cpp    28 Apr 2002 15:18:59 -0000      1.613
@@ -6651,4 +6651,7 @@
            (ms_connCloseTimer->GetInterval() / 1000 > delay) )
    {
+      wxLogTrace(TRACE_CONN_CACHE,
+                 "Starting connection clean up timer (delay = %ds)", delay);
+
       // we want to use a smaller interval
       ms_connCloseTimer->Start(delay * 1000);
@@ -6658,5 +6661,10 @@
 void ServerInfoEntry::CheckTimeout()
 {
-   time_t t = time(NULL);
+   // close the connection even if the timeout hasn't expired yet but expires
+   // in less than 1 second: this helps when we have a really big timeout (i.e.
+   // 30 minutes) and if the timer comes up slightly before the moment *j
+   // (which does happen in practice): we don't want to wait for another 30
+   // minutes before closing the connection
+   time_t t = time(NULL) + 1;
 
    // iterate in parallel over both lists
@@ -6665,5 +6673,5 @@
    while ( i != m_connections.end() )
    {
-      if ( *j < t )
+      if ( *j <= t )
       {
          // timed out
@@ -6710,4 +6718,6 @@
    {
       // timer will be restarted in KeepStream() when/if neecessary
+      wxLogTrace(TRACE_CONN_CACHE, "Stopping connection clean up timer");
+
       ms_connCloseTimer->Stop();
    }


_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to