summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2002-01-18 18:31:01 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2002-01-18 18:31:01 +0000
commit510d6f134782eb006891149e21558cee2f2c59b2 (patch)
tree8651eb77d80756b47f148560dc5deffa946289fc
parent064df7ea5c815d9ea7f9503ae91b3e7e332afe56 (diff)
downloadATCD-510d6f134782eb006891149e21558cee2f2c59b2.tar.gz
ChangeLogTag:Fri Jan 18 10:29:06 2002 Ossama Othman <ossama@uci.edu>
-rw-r--r--ChangeLog10
-rw-r--r--ChangeLogs/ChangeLog-02a10
-rw-r--r--ChangeLogs/ChangeLog-03a10
-rw-r--r--ace/Service_Config.cpp59
-rw-r--r--ace/Service_Config.h4
5 files changed, 74 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 63822622fab..c84d36b2c32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Fri Jan 18 10:29:06 2002 Ossama Othman <ossama@uci.edu>
+
+ * ace/Service_Config.h (process_file):
+ * ace/Service_Config.cpp (process_directives, process_file):
+
+ Factored out code that processes a svc.conf file into the new
+ static process_file() method. This allows svc.conf files to be
+ explicitly parsed by the application at any arbitrary point in
+ time instead of Service Configuration initialization time alone.
+
Thu Jan 17 18:51:09 2002 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
* ace/Name_Space.cpp (operator =): Fixed a memory leak. Thanks
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 63822622fab..c84d36b2c32 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,13 @@
+Fri Jan 18 10:29:06 2002 Ossama Othman <ossama@uci.edu>
+
+ * ace/Service_Config.h (process_file):
+ * ace/Service_Config.cpp (process_directives, process_file):
+
+ Factored out code that processes a svc.conf file into the new
+ static process_file() method. This allows svc.conf files to be
+ explicitly parsed by the application at any arbitrary point in
+ time instead of Service Configuration initialization time alone.
+
Thu Jan 17 18:51:09 2002 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
* ace/Name_Space.cpp (operator =): Fixed a memory leak. Thanks
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 63822622fab..c84d36b2c32 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,13 @@
+Fri Jan 18 10:29:06 2002 Ossama Othman <ossama@uci.edu>
+
+ * ace/Service_Config.h (process_file):
+ * ace/Service_Config.cpp (process_directives, process_file):
+
+ Factored out code that processes a svc.conf file into the new
+ static process_file() method. This allows svc.conf files to be
+ explicitly parsed by the application at any arbitrary point in
+ time instead of Service Configuration initialization time alone.
+
Thu Jan 17 18:51:09 2002 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
* ace/Name_Space.cpp (operator =): Fixed a memory leak. Thanks
diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp
index 4992825f577..019de34af91 100644
--- a/ace/Service_Config.cpp
+++ b/ace/Service_Config.cpp
@@ -385,6 +385,41 @@ ACE_Service_Config::process_directives_i (ACE_Svc_Conf_Param *param)
}
int
+ACE_Service_Config::process_file (const ACE_TCHAR file[])
+{
+ ACE_TRACE ("ACE_Service_Config::process_file");
+
+ int result = 0;
+
+ FILE *fp = ACE_OS::fopen (file,
+ ACE_LIB_TEXT ("r"));
+
+ if (fp == 0)
+ {
+ // Invalid svc.conf file. We'll report it here and break out of
+ // the method.
+ if (ACE::debug ())
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_LIB_TEXT ("%p\n"),
+ file));
+
+ errno = ENOENT;
+ result = -1;
+ }
+ else
+ {
+ ACE_Svc_Conf_Param f (fp);
+
+ // Keep track of the number of errors.
+ result = ACE_Service_Config::process_directives_i (&f);
+
+ (void) ACE_OS::fclose (fp);
+ }
+
+ return result;
+}
+
+int
ACE_Service_Config::process_directive (const ACE_TCHAR directive[])
{
ACE_TRACE ("ACE_Service_Config::process_directive");
@@ -405,7 +440,6 @@ ACE_Service_Config::process_directive (const ACE_TCHAR directive[])
// Process service configuration requests as indicated in the queue of
// svc.conf files.
-
int
ACE_Service_Config::process_directives (void)
{
@@ -423,28 +457,15 @@ ACE_Service_Config::process_directives (void)
iter.next (sptr) != 0;
iter.advance ())
{
- FILE *fp = ACE_OS::fopen (sptr->fast_rep (),
- ACE_LIB_TEXT ("r"));
- if (fp == 0)
+ int r = ACE_Service_Config::process_file (sptr->fast_rep ());
+
+ if (r < 0)
{
- // Invalid svc.conf file. We'll report it here and
- // break out of the method.
- if (ACE::debug ())
- ACE_DEBUG ((LM_DEBUG,
- ACE_LIB_TEXT ("%p\n"),
- sptr->fast_rep ()));
- errno = ENOENT;
- result = -1;
+ result = r;
break;
}
- else
- {
- ACE_Svc_Conf_Param f (fp);
- // Keep track of the number of errors.
- result += ACE_Service_Config::process_directives_i (&f);
- }
- ACE_OS::fclose (fp);
+ result += r;
}
}
diff --git a/ace/Service_Config.h b/ace/Service_Config.h
index 49a31acac59..b667cc5f7f9 100644
--- a/ace/Service_Config.h
+++ b/ace/Service_Config.h
@@ -395,6 +395,10 @@ public:
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
+ /// Process a file containing a list of service configuration
+ /// directives.
+ static int process_file (const ACE_TCHAR file[]);
+
/// Process one service configuration <directive>, which is passed as
/// a string. Returns the number of errors that occurred.
static int process_directive (const ACE_TCHAR directive[]);