[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] engine/core core_proc.cpp,1.73.6.2.6.2,1.73.6.2.6.3
From:       svaidhya () helixcommunity ! org
Date:       2008-10-23 0:47:34
Message-ID: 200810230054.m9N0sORe018979 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/engine/core
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv14919

Modified Files:
      Tag: SERVER_12_1
	core_proc.cpp 
Log Message:
Synopsis
========
Fix for "Server fails to start when FCS, SSPL and FileSys port are same or equal to \
HTTP Port"

Branches:  SERVER_CURRENT, SERVER_12_1
Reviewer(s):JJ, Dean

Description
===========

The FCS, SSPL and File System ports may match the port number claimed by either of \
the other two ports listed bove, or by the Helix HTTP port. Since this check is not \
present in the core proc, the server fails to start in cases where the port numbers \
are same, as it tries to create a listening process when there is already one \
listening to that port.

Added a variable to the InitHTTPControl method to specify if the process can share \
the same port. If yes then it will not create another process.

Files Affected
==============

Changed Files
~~~~~~~~~~~~~
/server/engine/core/core_proc.cpp
/server/engine/core/pub/core_proc.h

Testing Performed
=================
Unit Tests:
None.

Integration Tests:
- Tested with same port values for FCS, SSPL, and File System Port
- Tested with port values for FCS, SSPL, and File System Port same as HTTP Port
- Tested with unique port values

Leak Tests:
- None.

Performance Tests:
None.

Platforms Tested: : linux-rhel4-i686
Build verified: linux-rhel4-i686



Index: core_proc.cpp
===================================================================
RCS file: /cvsroot/server/engine/core/core_proc.cpp,v
retrieving revision 1.73.6.2.6.2
retrieving revision 1.73.6.2.6.3
diff -u -d -r1.73.6.2.6.2 -r1.73.6.2.6.3
--- core_proc.cpp	17 Oct 2008 18:57:17 -0000	1.73.6.2.6.2
+++ core_proc.cpp	23 Oct 2008 00:47:32 -0000	1.73.6.2.6.3
@@ -1202,10 +1202,16 @@
     HX_ASSERT(FALSE);
 }
 
+/**
+ * The bShareSamePort variable, if TRUE,  specifies that the process can share the \
same  + * port value as another process. If this variable is FALSE, the function \
would  + * report an error. Mainly introduced for SSPL, FCS and FileSys Port Sharing.
+ */
 void CoreProcessInitCallback::InitHTTPControlPort(char* szConfigString,
                                                   Process* proc,
                                                   Config* config,
-                                                  ServerRegistry* registry)
+                                                  ServerRegistry* registry,
+                                                  HXBOOL bShareSamePort)
 {
     IHXActivePropUser* pActiveUser = NULL;
     UINT32 uPort = config->GetInt(proc, szConfigString);
@@ -1216,9 +1222,12 @@
         return;
     }
 
-    HTTPListenResponse* pResponse = new HTTPListenResponse(proc);
+    HTTPListenResponse* pResponse = new HTTPListenResponse(proc);   
     if (pResponse->Init(uPort) != HXR_OK)
     {
+        if(bShareSamePort && (hx_lastsockerr() == SOCKERR_ADDRINUSE))
+            return;
+
         ReportListenErrorAndExit();
     }
 
@@ -1262,27 +1271,27 @@
     pRTSPResponse->AddRef();
     ((CoreContainer*)proc->pc)->m_pListenResponseList->AddTail(pRTSPResponse);
 
-    InitHTTPControlPort("config.HTTPPort", proc, config, registry);
+    InitHTTPControlPort("config.HTTPPort", proc, config, registry, FALSE);
     
 #if defined(HELIX_FEATURE_SERVER_FCS)
     //ChannelControlPort for FCS.
-    InitHTTPControlPort("config.ChannelControlPort", proc, config, registry);
+    InitHTTPControlPort("config.ChannelControlPort", proc, config, registry, TRUE);
 #endif //HELIX_FEATURE_SERVER_FCS
 
 #if defined(HELIX_FEATURE_SERVER_SSPL)
     //sspl control port
-    InitHTTPControlPort("config.PlaylistControlPort", proc, config, registry);
+    InitHTTPControlPort("config.PlaylistControlPort", proc, config, registry, TRUE);
 #endif //HELIX_FEATURE_SERVER_SSPL
 
 #if defined(HELIX_FEATURE_SERVER_CONTENT_MGMT)
     //content management port
-    InitHTTPControlPort("config.FileSystemControlPort", proc, config, registry);
+    InitHTTPControlPort("config.FileSystemControlPort", proc, config, registry, \
TRUE);  #endif //HELIX_FEATURE_SERVER_CONTENT_MGMT
 
     /*
      *  If they specified an AdminPort, then we need to open that too.
      */
-    InitHTTPControlPort("config.AdminPort", proc, config, registry);
+    InitHTTPControlPort("config.AdminPort", proc, config, registry, FALSE);
 
 #ifdef HELIX_FEATURE_SERVER_WMT_MMS
     uPort = config->GetInt(proc, "config.MMSPort");


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic