]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTHOMERProxyHandler.cxx
fixed reading from OADB (M. Verweij)
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTHOMERProxyHandler.cxx
index 8f17693883c4667d0043d3f900d93dfb1dd3872f..203159f0344675f1c2d0ab95d75ccb7adc2e7e58 100644 (file)
@@ -68,12 +68,8 @@ AliHLTHOMERProxyHandler::~AliHLTHOMERProxyHandler() {
 //##################################################################################
 Int_t AliHLTHOMERProxyHandler::Initialize() {
   // see header file for class documentation
-
-  Int_t iResult = 0 ;
-
   IdentifyRealm();
-
-  return iResult;
+  return 0;
 }
 
 /*
@@ -96,7 +92,7 @@ Int_t AliHLTHOMERProxyHandler::FillSourceList(TList *srcList) {
     iResult = ProcessXmlRpcResponse();
 
   if (iResult < 0) {
-    HLTError(Form("Filling SourceList failed."));
+    HLTError("Filling SourceList failed.");
   }
 
   return iResult;
@@ -127,6 +123,8 @@ void AliHLTHOMERProxyHandler::IdentifyRealm() {
   // see header file for class documentation
 
   TString hostIP(gSystem->GetHostByName(gSystem->HostName()).GetHostAddress());
+  
+  HLTInfo(hostIP.Data());
 
   if ( hostIP.Contains("10.162.") )
     fRealm = kHLT;
@@ -137,12 +135,15 @@ void AliHLTHOMERProxyHandler::IdentifyRealm() {
   else  if ( hostIP.Contains("137.138") 
             || hostIP.Contains("128.141") 
             || hostIP.Contains("127.0.") 
+            || hostIP.Contains("192.168")
             )
     fRealm = kGPN;
   else {
     fRealm = kLoc;
   }
 
+  //fRealm = kLoc;
+
   return;
 }
 
@@ -232,7 +233,7 @@ Content-Length: 68\r\n\
 
       iResult = socket->RecvRaw(&buffer[bufferLength], 1);
       if ( iResult < 0) {
-       HLTError(Form("Error reading form socket."));
+       HLTError("Error reading form socket.");
        socket->Close();
        return iResult;
       }
@@ -280,7 +281,10 @@ Int_t AliHLTHOMERProxyHandler::ProcessXmlRpcResponse() {
   TDOMParser xmlParser;
   xmlParser.SetValidate(kFALSE);
 
-  HLTDebug(Form("XMLResponse: %s",fXmlRpcResponse.Data()));
+  //NOTE Have to use a temporary variable for printing the XML responce,
+  // because Form might overrun its internal buffer and crash for large strings.
+  TString infoMsg = Form("XMLResponse: %s",fXmlRpcResponse.Data());
+  HLTInfo(infoMsg.Data());
   
   iResult = xmlParser.ParseBuffer(fXmlRpcResponse.Data(), fXmlRpcResponse.Length());
   if ( iResult < 0 ) {
@@ -295,7 +299,7 @@ Int_t AliHLTHOMERProxyHandler::ProcessXmlRpcResponse() {
     GetChildren()->GetChildren()->GetChildren()->GetChildren();
   
   if ( strcmp( node->GetNodeName(), "string" ) ) {
-    HLTError(Form("No node 'string' in XmlRpcResponse."));
+    HLTError("No node 'string' in XmlRpcResponse.");
     return -1;
   }
 
@@ -316,7 +320,7 @@ Int_t AliHLTHOMERProxyHandler::ProcessXmlRpcResponse() {
   }
   
   if ( !xmlParser.GetXMLDocument()->GetRootNode()->HasChildren() ) {
-    HLTWarning(Form("No Services active."));
+    HLTWarning("No Services active.");
     return 1;
   }
 
@@ -330,7 +334,7 @@ Int_t AliHLTHOMERProxyHandler::ProcessXmlRpcResponse() {
     // -- Add service to list
     iResult = AddService( serviceNode->GetChildren() );
     if ( iResult > 0 ) {
-      HLTWarning(Form("Incomplete Service not added."));
+      HLTWarning("Incomplete Service not added.");
       iResult = 0;
     }
   } while ( ( serviceNode = prevServiceNode->GetNextNode() ) && !iResult );
@@ -352,7 +356,7 @@ Int_t AliHLTHOMERProxyHandler::AddService(TXMLNode *innerNode) {
 
   Int_t iResult = 0;
 
-  HLTInfo(Form(">> New service"));    
+  HLTInfo(">> New service");    
 
   TXMLNode* serviceNode = innerNode;
 
@@ -412,7 +416,7 @@ Int_t AliHLTHOMERProxyHandler::AddService(TXMLNode *innerNode) {
     TXMLNode* blocks = serviceNode->GetChildren();
 
     if ( ! blocks ) {
-      HLTError(Form("No blocks present"));
+      HLTError("No blocks present");
       return 1;
     }
       
@@ -420,7 +424,7 @@ Int_t AliHLTHOMERProxyHandler::AddService(TXMLNode *innerNode) {
     TXMLNode* prevBlockNode = NULL;
 
     if ( ! blockNode ) {
-      HLTError(Form("No block present in the blocks tag"));
+      HLTError("No block present in the blocks tag");
       return 1;
     }
       
@@ -436,7 +440,7 @@ Int_t AliHLTHOMERProxyHandler::AddService(TXMLNode *innerNode) {
       TXMLNode *prevDataNode = NULL;
 
       if ( ! dataNode ) {
-       HLTError(Form("No data specification tags present in block tag."));
+       HLTError("No data specification tags present in block tag.");
        return 1;
       }
       // -- data spec loop