Author: sayer
Date: 2008-05-06 11:31:24 +0200 (Tue, 06 May 2008)
New Revision: 936

Modified:
   trunk/apps/voicemail/AmMail.cpp
Log:
requeuing messages that were in error

Modified: trunk/apps/voicemail/AmMail.cpp
===================================================================
--- trunk/apps/voicemail/AmMail.cpp     2008-05-06 09:28:11 UTC (rev 935)
+++ trunk/apps/voicemail/AmMail.cpp     2008-05-06 09:31:24 UTC (rev 936)
@@ -138,6 +138,7 @@
        cur_mail->error_count++;
       }
       else {
+       // todo: save messages with errors somewhere? 
        if(cur_mail->clean_up)
          (*(cur_mail->clean_up))(cur_mail);
        delete cur_mail;
@@ -145,18 +146,21 @@
       event_fifo_mut.lock();
     }
 
-    event_fifo_mut.unlock();
     smtp.disconnect();
     smtp.close();
 
     if(n_event_fifo.empty()){
       _run_cond.set(false);
-    }
-    else {
-      while(!n_event_fifo.empty())
+    } else {
+      // requeue unsent mail
+      while(!n_event_fifo.empty()) {
+       event_fifo.push(n_event_fifo.front());
        n_event_fifo.pop();
+      }
     }
 
+    event_fifo_mut.unlock();
+
     DBG("Mail deamon finished\n");
   }
 }

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to