Module: sems
Branch: master
Commit: f300e8ec187bdc1e8a5872db2c880134ac2fce37
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=f300e8ec187bdc1e8a5872db2c880134ac2fce37

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Fri Jul  2 01:29:58 2010 +0200

ignore SIGPIPE (like SIGCHLD)

---

 core/AmConfig.cpp |    1 +
 core/AmConfig.h   |    2 ++
 core/sems.cpp     |    4 ++++
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/core/AmConfig.cpp b/core/AmConfig.cpp
index 8c0e4aa..96e1a67 100644
--- a/core/AmConfig.cpp
+++ b/core/AmConfig.cpp
@@ -94,6 +94,7 @@ vector <string> AmConfig::CodecOrder;
 Dtmf::InbandDetectorType 
 AmConfig::DefaultDTMFDetector     = Dtmf::SEMSInternal;
 bool AmConfig::IgnoreSIGCHLD      = true;
+bool AmConfig::IgnoreSIGPIPE      = true;
 
 int AmConfig::setSIPPort(const string& port) 
 {
diff --git a/core/AmConfig.h b/core/AmConfig.h
index 225896b..b8a0706 100644
--- a/core/AmConfig.h
+++ b/core/AmConfig.h
@@ -145,6 +145,8 @@ struct AmConfig
 
   static bool IgnoreSIGCHLD;
 
+  static bool IgnoreSIGPIPE;
+
   static bool LogSessions;
 
   static bool LogEvents;
diff --git a/core/sems.cpp b/core/sems.cpp
index df2f6e6..f1dfb6b 100644
--- a/core/sems.cpp
+++ b/core/sems.cpp
@@ -207,6 +207,10 @@ static void signal_handler(int sig)
     return;
   }
 
+  if (sig == SIGPIPE && AmConfig::IgnoreSIGPIPE) {
+    return;
+  }
+
   if (main_pid == getpid()) {
     if(!is_shutting_down.get()) {
       is_shutting_down.set(true);

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

Reply via email to