summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DAnCE/RepositoryManager
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/CIAO/DAnCE/RepositoryManager')
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/HTTP_Handler.cpp16
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp12
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h4
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp1
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/README.txt18
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp10
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h1
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp8
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp25
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc3
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp30
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h53
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp16
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.h9
14 files changed, 112 insertions, 94 deletions
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/HTTP_Handler.cpp b/TAO/CIAO/DAnCE/RepositoryManager/HTTP_Handler.cpp
index 0e91f073a9c..ffd85ca1ebf 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/HTTP_Handler.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/HTTP_Handler.cpp
@@ -25,7 +25,7 @@ HTTP_Handler::~HTTP_Handler (void)
{
if (filename_)
{
- ACE_OS::free ((void *) filename_);
+ ACE_OS::free (filename_);
filename_ = 0;
}
}
@@ -35,10 +35,10 @@ int
HTTP_Handler::open (void *)
{
if (this->send_request () != 0)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Handler::open():send_request failed"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Handler::open():send_request failed\n"), -1);
if (this->receive_reply () != 0)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Handler::open():receive_reply failed"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Handler::open():receive_reply failed\n"), -1);
return 0;
}
@@ -101,7 +101,7 @@ HTTP_Reader::send_request (void)
// Send the message to server
if (peer ().send_n (mesg, len) != len)
- ACE_ERROR_RETURN((LM_ERROR,"Error sending request"), -1);
+ ACE_ERROR_RETURN((LM_ERROR,"Error sending request\n"), -1);
return 0;
@@ -124,7 +124,7 @@ HTTP_Reader::receive_reply (void)
//Make sure that response type is 200 OK
if (ACE_OS::strstr (buf,"200 OK") == 0)
ACE_ERROR_RETURN ((LM_ERROR,
- "HTTP_Reader::receiveReply(): Response is not 200 OK" ), -1);
+ "HTTP_Reader::receiveReply(): Response is not 200 OK\n" ), -1);
// Search for the header termination string "\r\n\r\n", or "\n\n". If
// found, move past it to get to the data portion.
@@ -141,7 +141,7 @@ HTTP_Reader::receive_reply (void)
}
else
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Reader::receiveReply():Error while reading header"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Reader::receiveReply():Error while reading header\n"), -1);
// ***************************************************************
// At this point, we have stripped off the header and are ready to
@@ -165,7 +165,7 @@ HTTP_Reader::receive_reply (void)
// Copy over all the data bytes into our message buffer.
if (curr->copy (buf_ptr, bytes_read) == -1)
ACE_ERROR_RETURN ((LM_ERROR, "%p\n",
- "HTTP_Reader::receiveReply():Error copying data into Message_Block" ), -1);
+ "HTTP_Reader::receiveReply():Error copying data into Message_Block\n" ), -1);
//read the rest of the data into a number of ACE_Message_Blocks and
//chain them together in a link list fashion
@@ -191,7 +191,7 @@ HTTP_Reader::receive_reply (void)
}
else
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Reader::receiveReply():Error while reading header"), -1);
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Reader::receiveReply():Error while reading header\n"), -1);
}while (num_recvd != 0);
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp
index 9858d39a3c5..2096fccbc6f 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp
@@ -44,7 +44,7 @@ using namespace PC_Updater_T;
PC_Updater::PC_Updater (const char* server_path, const char* package)
: server_path_ (server_path),
- file_list_ (&allocator_),
+ file_list_ (),
package_ (package),
success_ (true)
{
@@ -53,7 +53,7 @@ PC_Updater::PC_Updater (const char* server_path, const char* package)
PC_Updater::PC_Updater (ACE_CString& server_path, ACE_CString& package)
: server_path_ (server_path),
- file_list_ (&allocator_),
+ file_list_ (),
package_ (package),
success_ (true)
{
@@ -137,7 +137,7 @@ void PC_Updater::clear_list ()
void PC_Updater::update (const ::Deployment::SubcomponentInstantiationDescription &sid)
{
- update_sequence (sid.package, this);
+ update_sequence (sid.basePackage, this);
}
// SubcomponentPortEndpoint
@@ -185,17 +185,13 @@ void PC_Updater::clear_list ()
//weird. Need to call next to get current ?!?!
const char* name;
- const char* ext;
name = ACE_OS::strstr (str, iad.location[0].in ());
if (name)
{
- ext = ACE_OS::strstr (name, ".");
-
ACE_CString loc (this->server_path_);
- loc += iad.location[0].in ();
- loc += ext;
+ loc += name;
iad.location[0] = CORBA::string_dup (loc.c_str ());
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h
index da254ab97dc..b9d8a1cb7cf 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h
+++ b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h
@@ -26,12 +26,10 @@
#include "ace/Containers_T.h" //for ACE_Double_Linked_List
#include "ace/Malloc_Allocator.h" //for ACE_New_Allocator needed by the doubly link list
-
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-
/**
* @class PC_Updater
*
@@ -103,7 +101,7 @@ private:
ACE_CString server_path_;
/// create a doubly link list
- ACE_New_Allocator allocator_;
+ //ACE_New_Allocator allocator_;
ACE_Double_Linked_List<ZIP_File_Info> file_list_;
ACE_CString package_;
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp
index 2fb6bdb6bd3..f1b53537735 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp
@@ -15,7 +15,6 @@ namespace PC_Updater_T
for (CORBA::ULong i = 0; i < size; ++i)
updater->update (seq[i]);
}
-
}
#endif /* PC_Updater_C */
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/README.txt b/TAO/CIAO/DAnCE/RepositoryManager/README.txt
index e4cd2fa6397..ee8eb6bcdce 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/README.txt
+++ b/TAO/CIAO/DAnCE/RepositoryManager/README.txt
@@ -1,28 +1,28 @@
This is the README file for the Repository Manager (RM).
-In order to be able to compile the RM you need to have ZZIP lib because the Repository
+In order to be able to compile the RM you need to have ZZIP lib because the Repository
Manager (RM) uses it to read the contents of CCM packages. ZZIP itself is a C++ wrapper
around ZLIB, thus you will also need ZLIB. In order to compile the RM successfully
you will need to do the following:
-
+
1. Download ZLIB and ZZIP-LIB
2. Compile the multi-threaded versions of these libraries
-3. [on Windows] create a separate directory for each library; create an include and a lib
+3. [on Windows] create a separate directory for each library; create an include and a lib
subdirectory within them. Then copy the libraries files in the library subdirectory.
-Copy zlib.h in the zlib_path/include and copy zziplib.h, zzip-conf.h and zzip-msvc.h
+Copy zlib.h in the zlib_path/include and copy zziplib.h, zzip-conf.h and zzip-msvc.h
(for Windows platforms; Linux might have its own file!!!). This step might be easier if
you find a binary package of the libraries and just install it.
-4. Set $ZLIB_ROOT and $ZZIP_ROOT to point to the directories where you placed the
+4. Set $ZLIB_ROOT and $ZZIP_ROOT to point to the directories where you placed the
libraries and the include files.
5. Turn on zzip and zlib in default.features for MPC.
6. MPC will handle the rest.
-Things to watch out for:
-On Windows make sure that you are linking the right ZIP libraries
-together with the rest of the libraries, i.e. if you are building the debug version of ACE,
+Things to watch out for:
+On Windows make sure that you are linking the right ZIP libraries
+together with the rest of the libraries, i.e. if you are building the debug version of ACE,
TAO and CIAO, then use the debug version of the ZIP libraries. Otherwise the RM will compile
-but it will not work properly.
+but it will not work properly.
to compile the idl with the tao_idl compiler:
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp
index f2af0de45b5..9c14b6b9608 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp
@@ -2,11 +2,11 @@
#include "RM_Helper.h"
#include "ciao/Packaging_DataC.h" //for the PackageConfiguration declaration
-#include "tao/CDR.h" //for TAO CDR classes
-#include "ace/Message_Block.h" //for ACE_Message_Block
-#include "ace/Auto_Ptr.h" //for Auto_Ptr
-#include "ace/OS_NS_fcntl.h" //for open
-#include "ace/OS_NS_unistd.h" //for close
+#include "tao/CDR.h" //for TAO CDR classes
+#include "ace/Message_Block.h" //for ACE_Message_Block
+#include "ace/Auto_Ptr.h" //for Auto_Ptr
+#include "ace/OS_NS_fcntl.h" //for open
+#include "ace/OS_NS_unistd.h" //for close
#include "ace/OS_NS_sys_stat.h" //for filesize and mkdir
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h
index 241ae507078..fb2f8a61db0 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h
@@ -21,6 +21,7 @@
#include "ciao/Packaging_DataC.h" //for the PackageConfiguration declaration
#include "tao/CDR.h" //for TAO CDR classes
+#include "ace/Message_Block.h" //for ACE_Message_Block
//int operator<< (ACE_OutputCDR& cdr, const Deployment::PackageConfiguration& pc);
//int operator>> (ACE_InputCDR& cdr, Deployment::PackageConfiguration& pc);
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp
index 0840a02dfb8..705af70b8d3 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp
@@ -14,7 +14,6 @@
#include "RepositoryManagerC.h"
#include "Options.h"
-//#include "Config_Handlers/pcd.hpp" //for the PackageConfiguration data struct
#include "ace/OS_NS_fcntl.h" //for open
#include "ace/OS_NS_unistd.h" //for close
#include "ace/OS_NS_sys_stat.h" //for filesize and fstat and mkdir
@@ -228,10 +227,10 @@ CORBA::Octet* read_from_disk (
ACE_OS::fstat (handle, &file_info);
- CORBA::Octet* buffer;
+ CORBA::Octet* buffer = 0;
ACE_NEW_RETURN (buffer, CORBA::Octet[file_info.st_size], 0);
- //read the contents of the file into the buffer
+ // read the contents of the file into the buffer
if (ACE_OS::read_n (handle, buffer, file_info.st_size) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
@@ -252,7 +251,6 @@ int write_to_disk (
size_t length
)
{
-
// Open a file handle to the local filesystem
ACE_HANDLE handle = ACE_OS::open (full_path, O_CREAT | O_TRUNC | O_WRONLY);
if (handle == ACE_INVALID_HANDLE)
@@ -265,7 +263,7 @@ int write_to_disk (
if (ACE_OS::write (handle, buffer, length) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("%p\n"),
- ACE_TEXT ("[RM::write_to_disk] file write error")),
+ ACE_TEXT ("[RM::write_to_disk] file write error")),
-1);
// Close the file handle
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp
index 744f5df5a02..b8a94492920 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp
@@ -25,35 +25,32 @@ using namespace std;
namespace
{
-///name of the file holding the IOR of the RM
+/// Name of the file holding the IOR of the RM
const char * rm_ior = "RepositoryManagerDeamon.ior";
-///default number of worker threads to run in the multi-threaded RM
+/// Default number of worker threads to run in the multi-threaded RM
unsigned int nthreads = 3;
}
-///Class that implements the service routine of the worker threads
-///of the repository manager
-
+/**
+ * @class Worker
+ *
+ * Class that implements the service routine of the worker threads
+ * of the repository manager
+ */
class Worker : public ACE_Task_Base
{
- // = TITLE
- // Run a server thread
- //
- // = DESCRIPTION
- // Use the ACE_Task_Base class to run server threads
- //
public:
+ /// ctor
Worker (CORBA::ORB_ptr orb);
- // ctor
+ /// The thread entry point.
virtual int svc (void);
- // The thread entry point.
private:
+ /// The orb
CORBA::ORB_var orb_;
- // The orb
};
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc
index 6ab070bc72a..d558e6fbb46 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.mpc
@@ -6,8 +6,11 @@
project (RepositoryManager) : ciao_component_dnc, taoexe, ciao_config_handlers, zzip, zlib {
+ includes += $(CIAO_ROOT)/tools/Config_Handlers //to circumvent an improper include resolution
+ //in the Package_Handlers/PC_Intf.h
exename = RepositoryManagerDeamon
requires += zzip zlib
+ libs += Package_Config_Handlers
IDL_Files {
RepositoryManager.idl
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp
index 476df857146..0def3f8ff68 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp
@@ -30,11 +30,12 @@
#include "ace/Malloc_Allocator.h" //for ACE_New_Allocator
//for the PackageConfiguration parsing
-#include "Config_Handlers/STD_PC_Intf.h"
+//#include "Config_Handlers/Package_Handlers/PC_Intf.h"
#include "ciao/Deployment_DataC.h"
#include "ciao/Packaging_DataC.h"
#include "Config_Handlers/Utils/XML_Helper.h"
-#include "xercesc/dom/DOM.hpp"
+#include "Config_Handlers/Package_Handlers/PCD_Handler.h"
+//#include "xercesc/dom/DOM.hpp"
#include "RM_Helper.h" //to be able to externalize/internalize a PackageConfiguration
#include "ace/Message_Block.h" //for ACE_Message_Block
@@ -153,7 +154,7 @@ void CIAO_RepositoryManagerDaemon_i::installPackage (
//TODO: how can I incorporate a Auto_Ptr is explicit release is needed
ACE_Message_Block* mb;
- ACE_NEW_THROW_EX (mb, ACE_Message_Block (0,0), CORBA::INTERNAL ());
+ ACE_NEW_THROW_EX (mb, ACE_Message_Block (), CORBA::INTERNAL ());
ACE_CHECK_RETURN (0);
//get the remote file
@@ -169,6 +170,8 @@ void CIAO_RepositoryManagerDaemon_i::installPackage (
mb->release ();
ACE_THROW (CORBA::INTERNAL ());
}
+
+ mb->release ();
}
else
{
@@ -710,9 +713,8 @@ CIAO_RepositoryManagerDaemon_i::retrieve_PC_from_package (char* package)
//parse the PCD to make sure that there are no package errors
ACE_TRY
{
- CIAO::Config_Handlers::STD_PC_Intf intf (pcd_name.c_str ());
-
- pc = intf.get_PC ();
+ //CIAO::Config_Handlers::STD_PC_Intf intf (pcd_name.c_str ());
+ //pc = intf.get_PC ();
}
ACE_CATCHALL
{
@@ -789,9 +791,21 @@ CIAO_RepositoryManagerDaemon_i::retrieve_PC_from_descriptors (const char* pc_nam
//parse the PCD to make sure that there are no package errors
ACE_TRY
{
- CIAO::Config_Handlers::STD_PC_Intf intf (pc_name);
+ //CIAO::Config_Handlers::STD_PC_Intf intf (pc_name);
+ //pc = intf.get_PC ();
+ if (xercesc::DOMDocument *doc = CIAO::Config_Handlers::XML_HELPER->create_dom (pc_name))
+ {
+ {
+ //Read in the XSC type structure from the DOMDocument
- pc = intf.get_PC ();
+ //Convert the XSC to an IDL datatype
+ CIAO::Config_Handlers::Packaging::PCD_Handler::package_config (pc_name, pc);
+ std::cout << "Instance document import succeeded. Dumping contents to file\n";
+ }
+
+ //Cleanliness is next to Godliness
+ delete doc;
+ }
}
ACE_CATCHALL
{
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h
index 7023b12fa25..a3d9557aa35 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h
@@ -33,7 +33,6 @@
#include "RepositoryManagerS.h"
-#include "DeploymentS.h" //added for the deployment stuff
#include "ace/Hash_Map_Manager.h" //for the ACE_Hash_Map_Manager
#include "ace/Null_Mutex.h" //for ACE_Null_Mutex
@@ -41,30 +40,29 @@
#include "ace/OS_NS_string.h" //for ACE_CString
#include "ace/SString.h"
-
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-
namespace
{
-///DIRECTORY WHERE THE PACKAGES WILL BE STORED LOCALLY
-const static char* INSTALL_PATH = "RepositoryDir";
+ /// Directory where the packages will be stored locally
+ const static char* INSTALL_PATH = "RepositoryDir";
-const static size_t TEMP_LEN = 512;
+ const static size_t TEMP_LEN = 512;
-const static char* PC_EXTENSION = ".epc";
+ const static char* PC_EXTENSION = ".epc";
}
-class CIAO_RepositoryManagerDaemon_i : public virtual POA_CIAO::RepositoryManagerDaemon
+class CIAO_RepositoryManagerDaemon_i :
+ public virtual POA_CIAO::RepositoryManagerDaemon
{
public:
- //Constructor
+ /// Constructor
CIAO_RepositoryManagerDaemon_i (CORBA::ORB_ptr the_orb,
const char* server = "http://localhost:5432/");
- //Destructor
+ /// Destructor
virtual ~CIAO_RepositoryManagerDaemon_i (void);
virtual
@@ -152,34 +150,35 @@ public:
protected:
- ///function to parse and return the PackageConfiguration from a specified package
+ /// Function to parse and return the PackageConfiguration from a specified
+ /// package
Deployment::PackageConfiguration* retrieve_PC_from_package (char* package);
- ///find out what the name of the PackageConfiguration file is
+ /// Find out what the name of the PackageConfiguration file is
void find_PC_name (char* package, ACE_CString& pcd_name);
- ///function to parse and return the PackageConfiguration from the already
- ///extracted descriptor files
+ /// Function to parse and return the PackageConfiguration from the already
+ /// extracted descriptor files
Deployment::PackageConfiguration* retrieve_PC_from_descriptors (const char* pc_name,
const char* descriptor_dir);
- ///function to retvieve a file via HTTP
- ///stores the file in the passed preallocated ACE_Message_Block
- ///returns 1 on success
- /// 0 on error
+ /// Function to retrieve a file via HTTP
+ /// stores the file in the passed preallocated ACE_Message_Block
+ /// @retval 1 success
+ /// @retval 0 error
int HTTP_Get (const char* URL, ACE_Message_Block &mb);
- ///function to extract all necessary files for parsing the PackageConfiguration
- ///descriptor and populating the idl struct.
- ///return 1 on success
- /// 0 on error
+ /// Function to extract all necessary files for parsing the
+ /// PackageConfiguration descriptor and populating the idl struct.
+ /// @retval 1 success
+ /// @retval 0 error
///
- ///NOTE: ACE_CString& pcd_name is an out parameter
+ /// @note ACE_CString& pcd_name is an out parameter
int extract_descriptor_files (char* package,
- ACE_CString& pcd_name);
+ ACE_CString& pcd_name);
///function to remove the files extracted for parsing the PackageConfiguration
@@ -270,10 +269,10 @@ public:
//a hash map that associates the names of
//PackageConfigurations with their location
- PCMap names_;
+ PCMap names_;
- //a hash map that associates the UUIDs of
- //PackageConfigurations with their location
+ /// a hash map that associates the UUIDs of
+ /// PackageConfigurations with their location
PCMap uuids_;
#if defined ASSEMBLY_INTERFACE_SUPPORT
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp b/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp
index 2ab483823b6..7eed65dafbb 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.cpp
@@ -50,7 +50,9 @@ bool URL_Parser::parseURL (char* url)
url += ACE_OS::strlen ("http://");
if (url[0] == '/')
- this->filename_ = url;
+ {
+ this->filename_ = ACE_OS::strdup (url);
+ }
else
{
if (ptr = ACE_OS::strstr (url, ":"))
@@ -63,13 +65,13 @@ bool URL_Parser::parseURL (char* url)
else
{
size_t host_len = ptr - url;
- ACE_NEW_RETURN (this->hostname_, char [host_len], false);
+ ACE_NEW_RETURN (this->hostname_, char [host_len + 1], false);
ACE_OS::strncpy (this->hostname_, url, host_len);
this->hostname_ [host_len] = '\0';
if (ptr = ACE_OS::strstr (ptr, "/"))
{
- this->filename_ = ptr;
+ this->filename_ = ACE_OS::strdup(ptr);
}
else
success = false;
@@ -89,5 +91,13 @@ void URL_Parser::Error (void)
URL_Parser::~URL_Parser()
{
if(this->hostname_)
+ {
delete [] this->hostname_;
+ this->hostname_ =0;
+ }
+ if (this->filename_)
+ {
+ ACE_OS::free (this->filename_);
+ this->filename_ = 0;
+ }
}
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.h b/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.h
index 54f9db42877..aaaeab4960c 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.h
+++ b/TAO/CIAO/DAnCE/RepositoryManager/URL_Parser.h
@@ -33,6 +33,8 @@ class URL_Parser
{
public:
+ friend class ACE_Singleton <URL_Parser, ACE_Null_Mutex>;
+
/// parses commandline arguments
bool parse_args (int argc, ACE_TCHAR *argv[]);
@@ -53,11 +55,12 @@ public:
/// turns on verbosity
int debug_;
- URL_Parser (void);
- // protected constructor, singleton
-
//destructor
~URL_Parser (void);
+
+protected:
+ URL_Parser (void);
+ // protected constructor, singleton
};