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

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Thu Jul  8 15:19:50 2010 +0200

stats: no SO_REUSEADDR, don't start server on err

thanks to Robert Szokovacs for the hint

---

 core/plug-in/stats/Statistics.cpp     |    1 +
 core/plug-in/stats/StatsUDPServer.cpp |    5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/core/plug-in/stats/Statistics.cpp 
b/core/plug-in/stats/Statistics.cpp
index 3c0baed..9f93641 100644
--- a/core/plug-in/stats/Statistics.cpp
+++ b/core/plug-in/stats/Statistics.cpp
@@ -43,6 +43,7 @@ int StatsFactory::onLoad()
   StatsUDPServer* stat_srv = StatsUDPServer::instance();
   if(!stat_srv){
     ERROR("stats UDP server not initialized.\n");
+    return -1;
   }
 
   return 0;
diff --git a/core/plug-in/stats/StatsUDPServer.cpp 
b/core/plug-in/stats/StatsUDPServer.cpp
index 955af8e..6139ed9 100644
--- a/core/plug-in/stats/StatsUDPServer.cpp
+++ b/core/plug-in/stats/StatsUDPServer.cpp
@@ -152,10 +152,7 @@ int StatsUDPServer::init()
 
   /* set sock opts? */
   optval=1;
-  if (setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, sizeof(optval)) 
==-1){
-    ERROR("ERROR: setsockopt(reuseaddr): %s\n", strerror(errno));
-    return -1; 
-  }
+
   /* tos */
   optval=IPTOS_LOWDELAY;
   if (setsockopt(sd, IPPROTO_IP, IP_TOS, (void*)&optval, sizeof(optval)) ==-1){

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

Reply via email to