summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ACE/ChangeLog44
-rw-r--r--ACE/apps/Gateway/Gateway/Connection_Handler.cpp41
-rw-r--r--ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.cpp10
-rw-r--r--ACE/apps/Gateway/Peer/Options.cpp32
-rw-r--r--ACE/apps/JAWS/clients/Blobby/Options.cpp11
-rw-r--r--ACE/apps/JAWS/clients/Blobby/blobby.cpp14
-rw-r--r--ACE/apps/JAWS/clients/Caching/ID_Generator.cpp4
-rw-r--r--ACE/apps/JAWS/clients/Caching/Local_Locator.cpp218
-rw-r--r--ACE/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp52
-rw-r--r--ACE/apps/JAWS/clients/Caching/URL_Properties.inl2
-rw-r--r--ACE/apps/JAWS/clients/WebSTONE/src/bench.c265
-rw-r--r--ACE/apps/JAWS/clients/WebSTONE/src/cgi-send.c46
-rw-r--r--ACE/apps/JAWS/clients/WebSTONE/src/get.c228
-rw-r--r--ACE/apps/JAWS/clients/WebSTONE/src/getopt.c104
-rw-r--r--ACE/apps/JAWS/clients/WebSTONE/src/nsapi-send.c12
-rw-r--r--ACE/apps/JAWS/server/HTTP_Config.cpp8
-rw-r--r--ACE/apps/JAWS/server/HTTP_Handler.cpp12
-rw-r--r--ACE/apps/JAWS/server/HTTP_Helpers.cpp136
-rw-r--r--ACE/apps/JAWS/server/HTTP_Response.cpp34
-rw-r--r--ACE/apps/JAWS/server/HTTP_Server.cpp30
-rw-r--r--ACE/apps/JAWS/server/HTTP_Server.h4
-rw-r--r--ACE/apps/JAWS/stress_testing/benchd.cpp50
-rw-r--r--ACE/apps/JAWS/stress_testing/connection.cpp36
-rw-r--r--ACE/apps/JAWS/stress_testing/http_tester.cpp10
-rw-r--r--ACE/apps/JAWS2/JAWS/Cache_Hash_T.h2
-rw-r--r--ACE/apps/JAWS2/JAWS/Hash_Bucket_T.h8
-rw-r--r--ACE/apps/drwho/File_Manager.cpp10
-rw-r--r--ACE/apps/drwho/Hash_Table.cpp19
-rw-r--r--ACE/apps/drwho/PMC_All.cpp4
-rw-r--r--ACE/apps/drwho/PMC_Flo.cpp4
-rw-r--r--ACE/apps/drwho/PMC_Ruser.cpp32
-rw-r--r--ACE/apps/drwho/PMC_Usr.cpp26
-rw-r--r--ACE/apps/drwho/PMS_Ruser.cpp2
-rw-r--r--ACE/apps/drwho/PM_Client.cpp32
-rw-r--r--ACE/apps/drwho/Rwho_DB_Manager.cpp16
-rw-r--r--ACE/apps/gperf/src/Gen_Perf.cpp8
36 files changed, 799 insertions, 767 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 1b2859849e5..411ad007d53 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,43 @@
+Mon Jun 16 20:24:45 UTC 2008 Abdullah Sowayan <abdullah.sowayan@lmco.com>
+
+ * apps/Gateway/Gateway/Connection_Handler.cpp:
+ * apps/Gateway/Gateway/Event_Forwarding_Discriminator.cpp:
+ * apps/Gateway/Peer/Options.cpp:
+ * apps/JAWS/clients/Blobby/Options.cpp:
+ * apps/JAWS/clients/Blobby/blobby.cpp:
+ * apps/JAWS/clients/Caching/ID_Generator.cpp:
+ * apps/JAWS/clients/Caching/Local_Locator.cpp:
+ * apps/JAWS/clients/Caching/Locator_Request_Reply.cpp:
+ * apps/JAWS/clients/Caching/URL_Properties.inl:
+ * apps/JAWS/clients/WebSTONE/src/bench.c:
+ * apps/JAWS/clients/WebSTONE/src/cgi-send.c:
+ * apps/JAWS/clients/WebSTONE/src/get.c:
+ * apps/JAWS/clients/WebSTONE/src/getopt.c:
+ * apps/JAWS/clients/WebSTONE/src/nsapi-send.c:
+ * apps/JAWS/server/HTTP_Config.cpp:
+ * apps/JAWS/server/HTTP_Handler.cpp:
+ * apps/JAWS/server/HTTP_Helpers.cpp:
+ * apps/JAWS/server/HTTP_Response.cpp:
+ * apps/JAWS/server/HTTP_Server.h:
+ * apps/JAWS/server/HTTP_Server.cpp:
+ * apps/JAWS/stress_testing/benchd.cpp:
+ * apps/JAWS/stress_testing/connection.cpp:
+ * apps/JAWS/stress_testing/http_tester.cpp:
+ * apps/JAWS2/JAWS/Cache_Hash_T.h:
+ * apps/JAWS2/JAWS/Hash_Bucket_T.h:
+ * apps/drwho/File_Manager.cpp:
+ * apps/drwho/Hash_Table.cpp:
+ * apps/drwho/PMC_All.cpp:
+ * apps/drwho/PMC_Flo.cpp:
+ * apps/drwho/PMC_Ruser.cpp:
+ * apps/drwho/PMC_Usr.cpp:
+ * apps/drwho/PMS_Ruser.cpp:
+ * apps/drwho/PM_Client.cpp:
+ * apps/drwho/Rwho_DB_Manager.cpp:
+ * apps/gperf/src/Gen_Perf.cpp:
+
+ Untabify.
+
Mon Jun 16 19:06:38 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu>
* ace/config-borland-common.h:
@@ -7,8 +47,8 @@ Mon Jun 16 19:06:38 UTC 2008 William R. Otte <wotte@dre.vanderbilt.edu>
* ace/config-win32-ghs.h:
* ace/config-win32-msvc.h:
- Fixes for MCPP preprocessing on Windows.
-
+ Fixes for MCPP preprocessing on Windows.
+
Mon Jun 16 19:06:44 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
* ace/Acceptor.cpp:
diff --git a/ACE/apps/Gateway/Gateway/Connection_Handler.cpp b/ACE/apps/Gateway/Gateway/Connection_Handler.cpp
index ff93886c187..b3f95e5d30c 100644
--- a/ACE/apps/Gateway/Gateway/Connection_Handler.cpp
+++ b/ACE/apps/Gateway/Gateway/Connection_Handler.cpp
@@ -133,7 +133,7 @@ Connection_Handler::handle_timeout (const ACE_Time_Value &,
const void *)
{
ACE_DEBUG ((LM_DEBUG,
- "(%t) attempting to reconnect Connection_Handler %d with timeout = %d\n",
+ "(%t) attempting to reconnect Connection_Handler %d with timeout = %d\n",
this->connection_id (),
this->timeout_));
@@ -149,9 +149,9 @@ int
Connection_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
{
ACE_DEBUG ((LM_DEBUG,
- "(%t) shutting down %s Connection_Handler %d on handle %d\n",
- this->connection_role () == 'C' ? "Consumer" : "Supplier",
- this->connection_id (),
+ "(%t) shutting down %s Connection_Handler %d on handle %d\n",
+ this->connection_role () == 'C' ? "Consumer" : "Supplier",
+ this->connection_id (),
this->get_handle ()));
// Restart the connection, if possible.
@@ -181,8 +181,8 @@ int
Connection_Handler::open (void *)
{
ACE_DEBUG ((LM_DEBUG, "(%t) %s Connection_Handler's handle = %d\n",
- this->connection_role () == 'C' ? "Consumer" : "Supplier",
- this->peer ().get_handle ()));
+ this->connection_role () == 'C' ? "Consumer" : "Supplier",
+ this->peer ().get_handle ()));
// Call back to the <Event_Channel> to complete our initialization.
if (this->event_channel_->complete_connection_connection (this) == -1)
@@ -240,33 +240,32 @@ Connection_Handler_Factory::make_connection_handler (const Connection_Config_Inf
{
// Create a threaded Consumer_Handler.
if (ACE_BIT_ENABLED (Options::instance ()->threading_strategy (),
- Options::OUTPUT_MT))
- ACE_NEW_RETURN (connection_handler,
- Thr_Consumer_Handler (pci),
- 0);
+ Options::OUTPUT_MT))
+ ACE_NEW_RETURN (connection_handler,
+ Thr_Consumer_Handler (pci),
+ 0);
// Create a reactive Consumer_Handler.
else
- ACE_NEW_RETURN (connection_handler,
- Consumer_Handler (pci),
- 0);
+ ACE_NEW_RETURN (connection_handler,
+ Consumer_Handler (pci),
+ 0);
}
else // connection_role == 'S', so configure a Supplier_Handler.
{
// Create a threaded Supplier_Handler.
if (ACE_BIT_ENABLED (Options::instance ()->threading_strategy (),
- Options::INPUT_MT))
- ACE_NEW_RETURN (connection_handler,
- Thr_Supplier_Handler (pci),
- 0);
+ Options::INPUT_MT))
+ ACE_NEW_RETURN (connection_handler,
+ Thr_Supplier_Handler (pci),
+ 0);
// Create a reactive Supplier_Handler.
else
- ACE_NEW_RETURN (connection_handler,
- Supplier_Handler (pci),
- 0);
+ ACE_NEW_RETURN (connection_handler,
+ Supplier_Handler (pci),
+ 0);
}
return connection_handler;
}
-
diff --git a/ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.cpp b/ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.cpp
index d170dee9005..887d675a8a7 100644
--- a/ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.cpp
+++ b/ACE/apps/Gateway/Gateway/Event_Forwarding_Discriminator.cpp
@@ -10,8 +10,8 @@ ACE_RCSID(Gateway, Event_Forwarding_Discriminator, "$Id$")
// Bind the Event_Key to the INT_ID.
int
-Event_Forwarding_Discriminator::bind (Event_Key event_addr,
- Consumer_Dispatch_Set *cds)
+Event_Forwarding_Discriminator::bind (Event_Key event_addr,
+ Consumer_Dispatch_Set *cds)
{
return this->map_.bind (event_addr, cds);
}
@@ -19,8 +19,8 @@ Event_Forwarding_Discriminator::bind (Event_Key event_addr,
// Find the Consumer_Dispatch_Set corresponding to the Event_Key.
int
-Event_Forwarding_Discriminator::find (Event_Key event_addr,
- Consumer_Dispatch_Set *&cds)
+Event_Forwarding_Discriminator::find (Event_Key event_addr,
+ Consumer_Dispatch_Set *&cds)
{
return this->map_.find (event_addr, cds);
}
@@ -36,7 +36,7 @@ Event_Forwarding_Discriminator::unbind (Event_Key event_addr)
return result;
}
-Event_Forwarding_Discriminator_Iterator::Event_Forwarding_Discriminator_Iterator
+Event_Forwarding_Discriminator_Iterator::Event_Forwarding_Discriminator_Iterator
(Event_Forwarding_Discriminator &rt)
: map_iter_ (rt.map_)
{
diff --git a/ACE/apps/Gateway/Peer/Options.cpp b/ACE/apps/Gateway/Peer/Options.cpp
index 0b33552e629..d48f98c5067 100644
--- a/ACE/apps/Gateway/Peer/Options.cpp
+++ b/ACE/apps/Gateway/Peer/Options.cpp
@@ -36,7 +36,7 @@ Options::Options (void)
{
char *timeout = ACE_OS::getenv ("TIMEOUT");
- if (timeout == 0)
+ if (timeout == 0)
this->timeout_ = Options::DEFAULT_TIMEOUT;
else
this->timeout_ = ACE_OS::atoi (timeout);
@@ -113,7 +113,7 @@ Options::parse_args (int argc, ACE_TCHAR *argv[])
for (int c; (c = get_opt ()) != -1; )
{
switch (c)
- {
+ {
case 'a':
{
// Become an Acceptor.
@@ -172,30 +172,30 @@ Options::parse_args (int argc, ACE_TCHAR *argv[])
this->connection_id_ = ACE_OS::atoi (get_opt.opt_arg ());
break;
/* NOTREACHED */
- case 'h':
+ case 'h':
// connector host
- this->connector_host_ = get_opt.opt_arg ();
- break;
+ this->connector_host_ = get_opt.opt_arg ();
+ break;
/* NOTREACHED */
- case 'm':
+ case 'm':
// max queue size.
- this->max_queue_size_ = ACE_OS::atoi (get_opt.opt_arg ());
- break;
+ this->max_queue_size_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
/* NOTREACHED */
- case 't':
+ case 't':
// Timeout
- this->timeout_ = ACE_OS::atoi (get_opt.opt_arg ());
- break;
+ this->timeout_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
/* NOTREACHED */
- case 'v':
+ case 'v':
// Verbose mode.
- ACE_SET_BITS (this->options_, Options::VERBOSE);
- break;
+ ACE_SET_BITS (this->options_, Options::VERBOSE);
+ break;
/* NOTREACHED */
- default:
+ default:
this->print_usage_and_die ();
/* NOTREACHED */
- }
+ }
}
}
diff --git a/ACE/apps/JAWS/clients/Blobby/Options.cpp b/ACE/apps/JAWS/clients/Blobby/Options.cpp
index 08f7de4ad8b..cff24935e4e 100644
--- a/ACE/apps/JAWS/clients/Blobby/Options.cpp
+++ b/ACE/apps/JAWS/clients/Blobby/Options.cpp
@@ -14,7 +14,7 @@ Options *
Options::instance (void)
{
- if (Options::instance_ == 0)
+ if (Options::instance_ == 0)
Options::instance_ = new Options;
return Options::instance_;
@@ -61,15 +61,16 @@ Options::parse_args (int argc, ACE_TCHAR *argv[])
}
if (this->hostname_ == 0 || this->filename_ == 0)
{
- ACE_DEBUG ((LM_DEBUG,
- "%s -h hostname -f filename -[r/w] [-p port] [-l length] [-o offset] [-d]\n",
- argv[0]));
+ ACE_DEBUG ((LM_DEBUG,
+ "%s -h hostname -f filename -[r/w] [-p port] [-l length] [-o offset] [-d]\n",
+ argv[0]));
+
ACE_OS::exit (1);
}
}
-Options::Options (void)
+Options::Options (void)
: hostname_ (0),
port_ (ACE_DEFAULT_HTTP_SERVER_PORT),
filename_ (0),
diff --git a/ACE/apps/JAWS/clients/Blobby/blobby.cpp b/ACE/apps/JAWS/clients/Blobby/blobby.cpp
index e614b049c20..4d6f5802f56 100644
--- a/ACE/apps/JAWS/clients/Blobby/blobby.cpp
+++ b/ACE/apps/JAWS/clients/Blobby/blobby.cpp
@@ -39,14 +39,14 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
// Explain what is going to happen
if (options->debug_)
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("hostname = %C, port = %d, filename = %s, ")
+ ACE_TEXT ("hostname = %C, port = %d, filename = %s, ")
ACE_TEXT ("length = %d, offset = %d, operation = %c\n"),
- options->hostname_,
- options->port_,
- options->filename_,
- options->length_,
- options->offset_,
- options->operation_));
+ options->hostname_,
+ options->port_,
+ options->filename_,
+ options->length_,
+ options->offset_,
+ options->operation_));
// Create a blob
ACE_Blob blob;
diff --git a/ACE/apps/JAWS/clients/Caching/ID_Generator.cpp b/ACE/apps/JAWS/clients/Caching/ID_Generator.cpp
index 6e868611835..c2bde44f71c 100644
--- a/ACE/apps/JAWS/clients/Caching/ID_Generator.cpp
+++ b/ACE/apps/JAWS/clients/Caching/ID_Generator.cpp
@@ -22,7 +22,7 @@ ACE_ID_Generator::get_new_id (char *id)
ACE_ID_Generator::get_serial_id (t, sn);
ACE_NEW_RETURN (id, char [ACE_OFFER_ID_LENGTH], 0);
-
+
ACE_OS::sprintf (id, "%014d%06d", t, sn);
return id;
}
@@ -52,7 +52,7 @@ ACE_ID_Generator::get_lock (void)
// Double-checked Locking Optimization.
if (ACE_ID_Generator::lock_ == 0)
- ACE_NEW_RETURN (ACE_ID_Generator::lock_, ACE_SYNCH_MUTEX, 0);
+ ACE_NEW_RETURN (ACE_ID_Generator::lock_, ACE_SYNCH_MUTEX, 0);
}
#endif /* ACE_HAS_THREADS */
return ACE_ID_Generator::lock_;
diff --git a/ACE/apps/JAWS/clients/Caching/Local_Locator.cpp b/ACE/apps/JAWS/clients/Caching/Local_Locator.cpp
index 2aab4f874d8..1c9df290fbe 100644
--- a/ACE/apps/JAWS/clients/Caching/Local_Locator.cpp
+++ b/ACE/apps/JAWS/clients/Caching/Local_Locator.cpp
@@ -13,10 +13,10 @@ ACE_RCSID(Caching, Local_Locator, "$Id$")
int
ACE_URL_Local_Locator::url_query (const ACE_URL_Locator::ACE_Selection_Criteria how,
- const ACE_URL_Property_Seq *pseq,
- const size_t how_many,
- size_t &num_query,
- ACE_URL_Offer_Seq *offer)
+ const ACE_URL_Property_Seq *pseq,
+ const size_t how_many,
+ size_t &num_query,
+ ACE_URL_Offer_Seq *offer)
{
ACE_URL_Record *item = 0;
@@ -41,27 +41,27 @@ ACE_URL_Local_Locator::url_query (const ACE_URL_Locator::ACE_Selection_Criteria
// implement this using Hash_Map. Better yet, I think we should
// put this in a database and put SQL query here.
for (i_query = 0; found == 0 && i_query < pseq->size (); i_query++)
- for (i_db = 0; i_db < item->offer_->url_properties ().size (); i_db++)
- {
- if ((*pseq)[i_query].name () == item->offer_->url_properties ()[i_db].name ())
- if (how == ACE_URL_Locator::SOME)
+ for (i_db = 0; i_db < item->offer_->url_properties ().size (); i_db++)
+ {
+ if ((*pseq)[i_query].name () == item->offer_->url_properties ()[i_db].name ())
+ if (how == ACE_URL_Locator::SOME)
;
- // if match and Some, copy to <offer>, inc <num_query>, advance iterator
+ // if match and Some, copy to <offer>, inc <num_query>, advance iterator
- // else if All, advance iterator
+ // else if All, advance iterator
- // else if None, check next property in <pseq>.
+ // else if None, check next property in <pseq>.
- if (all properties checked and found and ALL)
- copy to <offer>; inc <num_query>;
- else if (all properties checked and not found and NONE)
- copy to <offer>; inc <num_query>;
- else
- shouldn't happen, internal error
+ if (all properties checked and found and ALL)
+ copy to <offer>; inc <num_query>;
+ else if (all properties checked and not found and NONE)
+ copy to <offer>; inc <num_query>;
+ else
+ shouldn't happen, internal error
if (num_query == how_many)
- break;
+ break;
}
return 0;
@@ -69,7 +69,7 @@ ACE_URL_Local_Locator::url_query (const ACE_URL_Locator::ACE_Selection_Criteria
int
ACE_URL_Local_Locator::export_offer (ACE_URL_Offer *offer,
- ACE_WString &offer_id)
+ ACE_WString &offer_id)
{
ACE_URL_Record *item = 0;
@@ -79,15 +79,15 @@ ACE_URL_Local_Locator::export_offer (ACE_URL_Offer *offer,
iter.advance ())
if (*item->offer_->url () == *offer->url ())
{
- errno = ACE_URL_Locator::OFFER_EXIST;
- return -1;
+ errno = ACE_URL_Locator::OFFER_EXIST;
+ return -1;
}
ACE_URL_Record *new_offer;
// Offer is not in repository, we can add new one in safely.
ACE_NEW_RETURN (new_offer, ACE_URL_Record (offer),
- ACE_URL_Locator::NOMEM);
+ ACE_URL_Locator::NOMEM);
this->repository_.push (*new_offer);
@@ -105,15 +105,15 @@ ACE_URL_Local_Locator::withdraw_offer (const ACE_WString &offer_id)
iter.next (item) != 0;
iter.advance ())
if (offer_id == *item->id_)
- {
- if (this->repository_.remove (*item) == 0)
- return 0
- else
- {
- errno = ACE_URL_Locator::UNKNOWN;
- return -1;
- }
- }
+ {
+ if (this->repository_.remove (*item) == 0)
+ return 0
+ else
+ {
+ errno = ACE_URL_Locator::UNKNOWN;
+ return -1;
+ }
+ }
errno = ACE_URL_Locator::NO_SUCH_OFFER;
return 0;
@@ -121,7 +121,7 @@ ACE_URL_Local_Locator::withdraw_offer (const ACE_WString &offer_id)
int
ACE_URL_Local_Locator::describe_offer (const ACE_WString &offer_id,
- ACE_URL_Offer *offer)
+ ACE_URL_Offer *offer)
{
ACE_URL_Record *item = 0;
@@ -132,8 +132,8 @@ ACE_URL_Local_Locator::describe_offer (const ACE_WString &offer_id,
iter.advance ())
if (offer_id == *item->id_)
{
- ACE_NEW_RETURN (offer, ACE_URL_Offer (*item->offer_), -1);
- return 0;
+ ACE_NEW_RETURN (offer, ACE_URL_Offer (*item->offer_), -1);
+ return 0;
}
errno = ACE_URL_Locator::NO_SUCH_OFFER;
@@ -142,9 +142,9 @@ ACE_URL_Local_Locator::describe_offer (const ACE_WString &offer_id,
int
ACE_URL_Local_Locator::modify_offer (const ACE_WString &offer_id,
- const ACE_WString *url,
- const ACE_URL_Property_Seq *del,
- const ACE_URL_Property_Seq *modify)
+ const ACE_WString *url,
+ const ACE_URL_Property_Seq *del,
+ const ACE_URL_Property_Seq *modify)
{
ACE_Unbounded_Set_Iterator<ACE_URL_Record> iter (this->repository_);
ACE_URL_Record *item = 0;
@@ -155,90 +155,90 @@ ACE_URL_Local_Locator::modify_offer (const ACE_WString &offer_id,
for (; iter.next (item) != 0; iter.advance ())
{
if (url != 0 && *url == item->offer_->url ())
- {
- errno = ACE_URL_Locator::OFFER_EXIST;
- return -1;
- }
+ {
+ errno = ACE_URL_Locator::OFFER_EXIST;
+ return -1;
+ }
if (offer_id == *item->id_)
- target = item;
+ target = item;
}
if (target != 0) // Aha, we found a target to work on
{
if (del != 0 && modify != 0)
- {
- // We need to make a copy of the original property sequence
- // so if any error occurs, we can revert our change easily.
-
- // First we need to calculate the maximum number of perperties.
- int psize = target->offer_->url_properties ().size ();
- if (del != 0)
- if ((psize -= del->size ()) < 0)
- {
- // If you try to delete more properties than we have,
- // you are doomed. No need to proceed.
- errno = ACE_URL_Locator::INVALID_ARGUMENT;
- return -1;
- }
- if (modify != 0)
- // In the worst case, all properties in <modify> will be added.
- psize += modify->size ();
-
- // Now, create a temporary work space.
- ACE_URL_Property_Seq working (psize);
- size_t sz = 0;
- for (; sz < item->offer_->url_properties ().size ())
- working[sz] = item->offer_->url_properties() [sz];
-
- if (del != 0)
- {
- // Argh, this is really a stupid design.
- // Go thru every property we want to delete
- for (size_t i = 0; i < del->size () && sz > 0; i++)
- // For earch, go thru our property sequence and
- // search for the property.
- for (size_t j = 0; j < sz; j++)
- if ((*del)[i].name () == working[j].name ())
- {
- sz -= 1;
- working[j] = working[sz]; // pack the array.
- break;
- }
- // Doesn't generate error when we want to delete an
- // imaginary property. Is this appropriate?
- }
-
- if (modify != 0)
- {
- // This is also stupid.
- // Go thru every property we want to modify/add
- for (size_t i = 0; i < modify->size () && sz > 0; i++)
- {
- // For each property, go thru our property list
- // and search for the matching property
- for (size_t j = 0; j < sz; j++)
- if ((*modify)[i].name () == working[j].name ())
- {
- // A match found.
- working[j].value ((*modify)[i].value ().fast_rep ());
- break;
- }
-
- // No matching property name were found,
- // We want to add this property into the list.
- if (j == sz)
- working[sz++] = (*modify)[i];
- }
- }
- }
+ {
+ // We need to make a copy of the original property sequence
+ // so if any error occurs, we can revert our change easily.
+
+ // First we need to calculate the maximum number of perperties.
+ int psize = target->offer_->url_properties ().size ();
+ if (del != 0)
+ if ((psize -= del->size ()) < 0)
+ {
+ // If you try to delete more properties than we have,
+ // you are doomed. No need to proceed.
+ errno = ACE_URL_Locator::INVALID_ARGUMENT;
+ return -1;
+ }
+ if (modify != 0)
+ // In the worst case, all properties in <modify> will be added.
+ psize += modify->size ();
+
+ // Now, create a temporary work space.
+ ACE_URL_Property_Seq working (psize);
+ size_t sz = 0;
+ for (; sz < item->offer_->url_properties ().size ())
+ working[sz] = item->offer_->url_properties() [sz];
+
+ if (del != 0)
+ {
+ // Argh, this is really a stupid design.
+ // Go thru every property we want to delete
+ for (size_t i = 0; i < del->size () && sz > 0; i++)
+ // For earch, go thru our property sequence and
+ // search for the property.
+ for (size_t j = 0; j < sz; j++)
+ if ((*del)[i].name () == working[j].name ())
+ {
+ sz -= 1;
+ working[j] = working[sz]; // pack the array.
+ break;
+ }
+ // Doesn't generate error when we want to delete an
+ // imaginary property. Is this appropriate?
+ }
+
+ if (modify != 0)
+ {
+ // This is also stupid.
+ // Go thru every property we want to modify/add
+ for (size_t i = 0; i < modify->size () && sz > 0; i++)
+ {
+ // For each property, go thru our property list
+ // and search for the matching property
+ for (size_t j = 0; j < sz; j++)
+ if ((*modify)[i].name () == working[j].name ())
+ {
+ // A match found.
+ working[j].value ((*modify)[i].value ().fast_rep ());
+ break;
+ }
+
+ // No matching property name were found,
+ // We want to add this property into the list.
+ if (j == sz)
+ working[sz++] = (*modify)[i];
+ }
+ }
+ }
// Yes, all operations passed. We can now copy the working version back.
item->offer_->url_properties (ACE_URL_Property_Seq (sz));
for (size_t i = 0; i < sz; i ++)
- item->offer_->url_properties ()[i] = working[i];
+ item->offer_->url_properties ()[i] = working[i];
if (url != 0)
- item->offer_->url (url->fast_rep ()); // replace URL location.
+ item->offer_->url (url->fast_rep ()); // replace URL location.
return 0;
}
errno = ACE_URL_Locator::NO_SUCH_OFFER;
diff --git a/ACE/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp b/ACE/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp
index 6c3f052aedc..7a0aa391b34 100644
--- a/ACE/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp
+++ b/ACE/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp
@@ -18,8 +18,8 @@ ACE_RCSID(Caching, Locator_Request_Reply, "$Id$")
int
ACE_URL_Locator_Request::url_query (const int how,
- const ACE_URL_Property_Seq &pseq,
- const int how_many)
+ const ACE_URL_Property_Seq &pseq,
+ const int how_many)
{
ACE_TRACE ("ACE_URL_Locator_Request::url_query");
@@ -29,19 +29,19 @@ ACE_URL_Locator_Request::url_query (const int how,
this->how_ = how;
this->how_many_ = how_many;
this->code_ = ACE_URL_Locator::QUERY;
- return 0;
+ return 0;
}
int
ACE_URL_Locator_Request::export_offer (const ACE_URL_Offer &offer)
{
ACE_TRACE ("ACE_URL_Locator_Request::export_offer");
-
+
ACE_NEW_RETURN (this->offer_, ACE_URL_Offer (offer), -1);
this->code_ = ACE_URL_Locator::EXPORT;
return 0;
}
-
+
int
ACE_URL_Locator_Request::withdraw_offer (const ACE_WString &offer_id)
{
@@ -56,7 +56,7 @@ int
ACE_URL_Locator_Request::describe_offer (const ACE_WString &offer_id)
{
ACE_TRACE ("ACE_URL_Locator_Request::describe_offer");
-
+
this->id_ = offer_id;
this->code_ = ACE_URL_Locator::DESCRIBE;
return 0;
@@ -64,9 +64,9 @@ ACE_URL_Locator_Request::describe_offer (const ACE_WString &offer_id)
int
ACE_URL_Locator_Request::modify_offer (const ACE_WString &offer_id,
- const ACE_WString *url,
- const ACE_URL_Property_Seq &del,
- const ACE_URL_Property_Seq &modify)
+ const ACE_WString *url,
+ const ACE_URL_Property_Seq &del,
+ const ACE_URL_Property_Seq &modify)
{
ACE_TRACE ("ACE_URL_Locator_Request::modify_offer");
@@ -107,7 +107,7 @@ ACE_URL_Locator_Request::encode (void)
ENCODE_UINT32 (this->buffer_, total_length, this->how_);
// Encode selection criteria.
-
+
ENCODE_UINT32 (this->buffer_, total_length, this->how_many_);
// Encode number of offers interested.
@@ -128,9 +128,9 @@ ACE_URL_Locator_Request::encode (void)
total_length += this->offer_->encode (this->buffer_ + total_length);
total_length += ACE_WString_Helper::encode (this->buffer_ + total_length,
- this->id_);
+ this->id_);
total_length += ACE_WString_Helper::encode (this->buffer_ + total_length,
- this->url_);
+ this->url_);
ACE_ASSERT (total_length == buf_size);
return total_length;
@@ -149,16 +149,16 @@ ACE_URL_Locator_Request::decode (void *buffer)
size_t buf_size;
size_t total_length = 0;
-
+
DECODE_UINT32 (cbuffer, total_length, buf_size);
// Decode length of buffer size first.
DECODE_UINT32 (cbuffer, total_length, this->code_);
// Get the operation code.
-
+
DECODE_UINT32 (cbuffer, total_length, this->how_);
// Decode selection criteria.
-
+
DECODE_UINT32 (cbuffer, total_length, this->how_many_);
// Decode number of offers interested.
@@ -184,7 +184,7 @@ ACE_URL_Locator_Request::decode (void *buffer)
ACE_NEW_RETURN (this->offer_, ACE_URL_Offer, 0);
total_length += this->offer_->decode (cbuffer + total_length);
}
-
+
this->id_ = ACE_WString ((ACE_USHORT16 *) (cbuffer + total_length));
total_length += ACE_WString_Helper::decode (cbuffer + total_length);
this->url_ = ACE_WString ((ACE_USHORT16 *) (cbuffer + total_length));
@@ -223,7 +223,7 @@ ACE_URL_Locator_Request::size (void)
this->valid_ptr_ |= VALID_OFFER;
total_length += this->offer_->size ();
}
-
+
total_length += ACE_WString_Helper::size (this->id_);
total_length += ACE_WString_Helper::size (this->url_);
@@ -269,16 +269,16 @@ ACE_URL_Locator_Request::dump (void) const
if (this->id_.length () > 0)
ACE_DEBUG ((LM_DEBUG, "Offer ID: %s\n",
- ACE_Auto_Basic_Array_Ptr<char> (this->id_.char_rep ()).get ()));
+ ACE_Auto_Basic_Array_Ptr<char> (this->id_.char_rep ()).get ()));
else
ACE_DEBUG ((LM_DEBUG, "Offer ID: \"\"\n"));
if (this->url_.length () > 0)
ACE_DEBUG ((LM_DEBUG, "URL: %s\n",
- ACE_Auto_Basic_Array_Ptr<char> (this->url_.char_rep ()).get ()));
+ ACE_Auto_Basic_Array_Ptr<char> (this->url_.char_rep ()).get ()));
else
ACE_DEBUG ((LM_DEBUG, "URL: \"\"\n"));
-
+
ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
}
@@ -294,10 +294,10 @@ ACE_URL_Locator_Reply::status_reply (u_int op, int result)
int
ACE_URL_Locator_Reply::query_reply (int result, size_t num,
- const ACE_URL_Offer_Seq &offers)
+ const ACE_URL_Offer_Seq &offers)
{
ACE_TRACE ("ACE_URL_Locator_Reply::query_reply");
-
+
this->code_ = ACE_URL_Locator::QUERY;
this->status_ = result;
ACE_NEW_RETURN (this->offers_, ACE_URL_Offer_Seq (offers), -1);
@@ -306,7 +306,7 @@ ACE_URL_Locator_Reply::query_reply (int result, size_t num,
int
ACE_URL_Locator_Reply::describe_reply (int result,
- const ACE_URL_Offer &offer)
+ const ACE_URL_Offer &offer)
{
ACE_TRACE ("ACE_URL_Locator_Reply::describe_reply");
@@ -353,7 +353,7 @@ ACE_URL_Locator_Reply::encode (void)
ACE_ASSERT (total_length == buf_size);
return 0;
}
-
+
size_t
ACE_URL_Locator_Reply::decode (void *buffer)
{
@@ -396,11 +396,11 @@ ACE_URL_Locator_Reply::decode (void *buffer)
ACE_NEW_RETURN (this->offers_, ACE_URL_Offer_Seq (n), 0);
total_length += ace_array_decode (cbuffer + total_length, *this->offers_);
}
-
+
ACE_ASSERT (total_length ==buf_size);
return 0;
}
-
+
size_t
ACE_URL_Locator_Reply::size (void)
{
diff --git a/ACE/apps/JAWS/clients/Caching/URL_Properties.inl b/ACE/apps/JAWS/clients/Caching/URL_Properties.inl
index 768ad967d94..c32484dbb5c 100644
--- a/ACE/apps/JAWS/clients/Caching/URL_Properties.inl
+++ b/ACE/apps/JAWS/clients/Caching/URL_Properties.inl
@@ -17,7 +17,7 @@ ACE_URL_Property::ACE_URL_Property (const char *name, const char *value)
ACE_INLINE
ACE_URL_Property::ACE_URL_Property (const ACE_USHORT16 *name,
- const ACE_USHORT16 *value)
+ const ACE_USHORT16 *value)
: name_ (name),
value_ (value)
{
diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/bench.c b/ACE/apps/JAWS/clients/WebSTONE/src/bench.c
index ace35460a1d..7139bcf040d 100644
--- a/ACE/apps/JAWS/clients/WebSTONE/src/bench.c
+++ b/ACE/apps/JAWS/clients/WebSTONE/src/bench.c
@@ -44,7 +44,7 @@ void *ptr;
return ptr;
}
-/*
+/*
* Receive n bytes from a socket
*/
int
@@ -53,18 +53,18 @@ recvdata(SOCKET sock, char *ptr, int nbytes) {
int nleft, nread;
nleft = nbytes;
- while (nleft > 0)
+ while (nleft > 0)
{
D_PRINTF( "In recvdata(%d, %d)\n", sock, nleft );
nread = NETREAD(sock, ptr, nleft);
D_PRINTF( "NETREAD() returned %d\n", nread );
if (BADSOCKET(nread) || nread == 0)
- {
- /* return error value NETWRITE */
+ {
+ /* return error value NETWRITE */
D_PRINTF( "Error in recvdata(): %s\n",neterrstr() );
- return(nread);
- }
-
+ return(nread);
+ }
+
D_PRINTF( "NETREAD() data: \"%.*s\"\n", nread, ptr);
nleft -= nread;
ptr += nread;
@@ -90,11 +90,11 @@ senddata(SOCKET sock, char *ptr, int nbytes) {
nwritten = NETWRITE(sock, ptr, nleft);
D_PRINTF( "senddata() returned %d\n", nwritten );
if (BADSOCKET(nwritten))
- {
- /* return error value from NETWRITE */
+ {
+ /* return error value from NETWRITE */
D_PRINTF( "Error in senddata(): %s\n", neterrstr() );
- return(nwritten);
- }
+ return(nwritten);
+ }
nleft -= nwritten;
ptr += nwritten;
}
@@ -110,7 +110,7 @@ senddata(SOCKET sock, char *ptr, int nbytes) {
char *
timeval_to_text(const struct timeval *the_timeval) {
- /*
+ /*
* given a timeval (seconds and microseconds), put the text
* "seconds.microseconds" into timeval_as_text
*/
@@ -120,8 +120,8 @@ timeval_to_text(const struct timeval *the_timeval) {
seconds = the_timeval->tv_sec;
microseconds = the_timeval->tv_usec;
- returnval = sprintf(timeval_as_text,
- "%10d.%6.6d\t", seconds, microseconds);
+ returnval = sprintf(timeval_as_text,
+ "%10d.%6.6d\t", seconds, microseconds);
return timeval_as_text;
}
@@ -139,14 +139,14 @@ double_to_text(const double the_double) {
}
struct timeval
-text_to_timeval(char *timeval_as_text) {
+text_to_timeval(char *timeval_as_text) {
int returnval = 0;
long int seconds, microseconds;
struct timeval the_timeval;
D_PRINTF("T/%d %s\n", (int)timeval_as_text, timeval_as_text);
- returnval = sscanf(timeval_as_text, "%ld.%ld",
- &seconds, &microseconds);
+ returnval = sscanf(timeval_as_text, "%ld.%ld",
+ &seconds, &microseconds);
the_timeval.tv_sec = seconds;
the_timeval.tv_usec = microseconds;
return the_timeval;
@@ -160,7 +160,7 @@ text_to_double(char *double_as_text) {
D_PRINTF("D/%d %s\n", (int)double_as_text, double_as_text);
returnval = sscanf(double_as_text, "%lf", &the_double);
return(the_double);
-}
+}
rqst_stats_t *
@@ -168,61 +168,61 @@ text_to_rqst_stats(char *rqst_stats_as_text) {
THREAD static rqst_stats_t rqst_stats;
rqst_stats_t *the_rqst_stats = &rqst_stats;
- the_rqst_stats->totalresponsetime =
+ the_rqst_stats->totalresponsetime =
text_to_timeval(strtok(rqst_stats_as_text, "\t"));
-
- the_rqst_stats->totalresponsetimesq =
- text_to_double(strtok((char *)0, "\t"));
-
- the_rqst_stats->minresponsetime =
+
+ the_rqst_stats->totalresponsetimesq =
+ text_to_double(strtok((char *)0, "\t"));
+
+ the_rqst_stats->minresponsetime =
text_to_timeval(strtok((char *)0, "\t"));
-
- the_rqst_stats->maxresponsetime =
+
+ the_rqst_stats->maxresponsetime =
text_to_timeval(strtok((char *)0, "\t"));
-
- the_rqst_stats->totalconnecttime =
+
+ the_rqst_stats->totalconnecttime =
text_to_timeval(strtok((char *)0, "\t"));
-
- the_rqst_stats->totalconnecttimesq =
+
+ the_rqst_stats->totalconnecttimesq =
text_to_double(strtok((char *)0, "\t"));
-
- the_rqst_stats->minconnecttime =
+
+ the_rqst_stats->minconnecttime =
text_to_timeval(strtok((char *)0, "\t"));
-
- the_rqst_stats->maxconnecttime =
+
+ the_rqst_stats->maxconnecttime =
text_to_timeval(strtok((char *)0, "\t"));
-
+
the_rqst_stats->totalconnects = (unsigned long)
text_to_double(strtok((char *)0, "\t"));
-
+
the_rqst_stats->totalerrs = (unsigned long)
text_to_double(strtok((char *)0, "\t"));
-
- the_rqst_stats->totalerrortime =
+
+ the_rqst_stats->totalerrortime =
text_to_timeval(strtok((char *)0, "\t"));
-
- the_rqst_stats->totalbytes =
+
+ the_rqst_stats->totalbytes =
text_to_double(strtok((char *)0, "\t"));
-
- the_rqst_stats->totalbytessq =
+
+ the_rqst_stats->totalbytessq =
text_to_double(strtok((char *)0, "\t"));
-
- the_rqst_stats->minbytes =
+
+ the_rqst_stats->minbytes =
text_to_double(strtok((char *)0, "\t"));
-
- the_rqst_stats->maxbytes =
+
+ the_rqst_stats->maxbytes =
text_to_double(strtok((char *)0, "\t"));
-
- the_rqst_stats->totalbody =
+
+ the_rqst_stats->totalbody =
text_to_double(strtok((char *)0, "\t"));
-
- the_rqst_stats->totalbodysq =
+
+ the_rqst_stats->totalbodysq =
text_to_double(strtok((char *)0, "\t"));
-
- the_rqst_stats->minbody =
+
+ the_rqst_stats->minbody =
text_to_double(strtok((char *)0, "\t"));
-
- the_rqst_stats->maxbody =
+
+ the_rqst_stats->maxbody =
text_to_double(strtok((char *)0, "\t"));
return(the_rqst_stats);
@@ -293,15 +293,15 @@ rqst_stats_to_text(rqst_stats_t *the_rqst_stats) {
tmpbuf = double_to_text((the_rqst_stats->maxbody));
strcat(rqst_stats_as_text, tmpbuf);
- D_PRINTF( "rqst_stats_to_text returning %d: %s\n",
- strlen(rqst_stats_as_text),
- rqst_stats_as_text );
+ D_PRINTF("rqst_stats_to_text returning %d: %s\n",
+ strlen(rqst_stats_as_text),
+ rqst_stats_as_text );
return(rqst_stats_as_text);
}
-stats_t *
+stats_t *
text_to_stats(char *stats_as_text) {
int i;
rqst_stats_t *the_rqst_stats;
@@ -314,13 +314,13 @@ text_to_stats(char *stats_as_text) {
the_stats->rs = *the_rqst_stats;
/* grab main structure */
- the_stats->starttime = text_to_timeval(strtok((char *)0, "\t"));
- the_stats->endtime = text_to_timeval(strtok((char *)0, "\t"));
- the_stats->datatime = text_to_timeval(strtok((char *)0, "\t"));
- the_stats->totalpages = (unsigned long) text_to_double(strtok((char *)0, "\t"));
- the_stats->total_num_of_files = (unsigned int) text_to_double(strtok((char *)0, "\t"));
- for (i = 0; i < number_of_pages; i++)
- {
+ the_stats->starttime = text_to_timeval(strtok((char *)0, "\t"));
+ the_stats->endtime = text_to_timeval(strtok((char *)0, "\t"));
+ the_stats->datatime = text_to_timeval(strtok((char *)0, "\t"));
+ the_stats->totalpages = (unsigned long) text_to_double(strtok((char *)0, "\t"));
+ the_stats->total_num_of_files = (unsigned int) text_to_double(strtok((char *)0, "\t"));
+ for (i = 0; i < number_of_pages; i++)
+ {
the_stats->page_numbers[i] = (unsigned int) text_to_double(strtok((char *)0, "\t"));
}
/* return bytes read */
@@ -330,7 +330,7 @@ text_to_stats(char *stats_as_text) {
-char *
+char *
stats_to_text(const stats_t *the_stats) {
int i;
THREAD static char stats_as_text[SIZEOF_STATSTEXT];
@@ -346,24 +346,24 @@ stats_to_text(const stats_t *the_stats) {
/* main structure */
- tmpbuf = timeval_to_text(&(the_stats->starttime));
+ tmpbuf = timeval_to_text(&(the_stats->starttime));
strcat(stats_as_text, tmpbuf);
- tmpbuf = timeval_to_text(&(the_stats->endtime));
+ tmpbuf = timeval_to_text(&(the_stats->endtime));
strcat(stats_as_text, tmpbuf);
-
- tmpbuf = timeval_to_text(&(the_stats->datatime));
+
+ tmpbuf = timeval_to_text(&(the_stats->datatime));
strcat(stats_as_text, tmpbuf);
- tmpbuf = double_to_text((the_stats->totalpages));
+ tmpbuf = double_to_text((the_stats->totalpages));
strcat(stats_as_text, tmpbuf);
- tmpbuf = double_to_text((the_stats->total_num_of_files));
+ tmpbuf = double_to_text((the_stats->total_num_of_files));
strcat(stats_as_text, tmpbuf);
- for (i = 0; i < number_of_pages; i++)
- {
- tmpbuf = double_to_text((the_stats->page_numbers[i]));
+ for (i = 0; i < number_of_pages; i++)
+ {
+ tmpbuf = double_to_text((the_stats->page_numbers[i]));
strcat(stats_as_text, tmpbuf);
}
@@ -384,12 +384,12 @@ text_to_page_stats(char *page_stats_as_text) {
the_rqst_stats = text_to_rqst_stats(page_stats_as_text);
/* grab main structure */
- pagestats->totalpages = (unsigned long) text_to_double(strtok((char *)0, "\t"));
-
- pagestats->page_size = (unsigned int) text_to_double(strtok((char *)0, "\t"));
-
- pagestats->page_valid = (int) text_to_double(strtok((char *)0, "\t"));
-
+ pagestats->totalpages = (unsigned long) text_to_double(strtok((char *)0, "\t"));
+
+ pagestats->page_size = (unsigned int) text_to_double(strtok((char *)0, "\t"));
+
+ pagestats->page_valid = (int) text_to_double(strtok((char *)0, "\t"));
+
pagestats->rs = *the_rqst_stats;
/* return bytes read */
@@ -398,7 +398,7 @@ text_to_page_stats(char *page_stats_as_text) {
-char *
+char *
page_stats_to_text(const page_stats_t *pagestats) {
THREAD static char page_stats_as_text[SIZEOF_PAGESTATSTEXT];
char *tmpbuf;
@@ -412,13 +412,13 @@ page_stats_to_text(const page_stats_t *pagestats) {
strcat(page_stats_as_text, tmpbuf);
/* main structure */
- tmpbuf = double_to_text(pagestats->totalpages);
+ tmpbuf = double_to_text(pagestats->totalpages);
strcat(page_stats_as_text, tmpbuf);
- tmpbuf = double_to_text(pagestats->page_size);
+ tmpbuf = double_to_text(pagestats->page_size);
strcat(page_stats_as_text, tmpbuf);
- tmpbuf = double_to_text(pagestats->page_valid);
+ tmpbuf = double_to_text(pagestats->page_valid);
strcat(page_stats_as_text, tmpbuf);
strcat(page_stats_as_text, "\n");
@@ -479,7 +479,7 @@ rqstat_times(rqst_stats_t *rs, rqst_timer_t *rt)
double t;
compdifftime(&(rt->exittime), &(rt->entertime),
- &(rs->totalresponsetime));
+ &(rs->totalresponsetime));
t = timevaldouble(&(rs->totalresponsetime));
rs->totalresponsetimesq = t * t;
@@ -487,7 +487,7 @@ rqstat_times(rqst_stats_t *rs, rqst_timer_t *rt)
rs->maxresponsetime = rs->totalresponsetime;
compdifftime(&(rt->afterconnect), &(rt->beforeconnect),
- &(rs->totalconnecttime));
+ &(rs->totalconnecttime));
t = timevaldouble(&(rs->totalconnecttime));
rs->totalconnecttimesq = t * t;
@@ -556,80 +556,77 @@ rqstat_fprint(FILE *f, rqst_stats_t *stats)
struct timeval meantime, /*vartime,*/ stdtime;
fprintf(f, "%d connection(s) to server, %d errors\n",
- stats->totalconnects, stats->totalerrs);
+ stats->totalconnects, stats->totalerrs);
if (stats->totalconnects == 0) {
- fprintf(f,"NO CONNECTIONS, THEREFORE NO STATISTICS\n"
- "IS YOUR WEBSERVER RUNNING?\n"
- "DO THE PAGES EXIST ON THE SERVER?\n");
- return;
+ fprintf(f,"NO CONNECTIONS, THEREFORE NO STATISTICS\n"
+ "IS YOUR WEBSERVER RUNNING?\n"
+ "DO THE PAGES EXIST ON THE SERVER?\n");
+ return;
}
/* title */
fprintf(f, "\n\t\t\t Average Std Dev Minimum Maximum\n\n");
/* first line (connect time) */
- avgtime(&(stats->totalconnecttime),
- stats->totalconnects, &meantime);
+ avgtime(&(stats->totalconnecttime),
+ stats->totalconnects, &meantime);
/* variancetime(&(stats->totalconnecttime),
- stats->totalconnecttimesq,
- stats->totalconnects, &vartime); */
+ stats->totalconnecttimesq,
+ stats->totalconnects, &vartime); */
stddevtime(&(stats->totalconnecttime),
- stats->totalconnecttimesq,
- stats->totalconnects, &stdtime);
+ stats->totalconnecttimesq,
+ stats->totalconnects, &stdtime);
fprintf(f, "Connect time (sec) \t%3d.%6.6d %3d.%6.6d %3d.%6.6d %3d.%6.6d\n",
- meantime.tv_sec,
- meantime.tv_usec,
- stdtime.tv_sec,
- stdtime.tv_usec,
- stats->minconnecttime.tv_sec,
- stats->minconnecttime.tv_usec,
- stats->maxconnecttime.tv_sec,
- stats->maxconnecttime.tv_usec);
+ meantime.tv_sec,
+ meantime.tv_usec,
+ stdtime.tv_sec,
+ stdtime.tv_usec,
+ stats->minconnecttime.tv_sec,
+ stats->minconnecttime.tv_usec,
+ stats->maxconnecttime.tv_sec,
+ stats->maxconnecttime.tv_usec);
/* second line (response time) */
- avgtime(&(stats->totalresponsetime),
- stats->totalconnects, &meantime);
+ avgtime(&(stats->totalresponsetime),
+ stats->totalconnects, &meantime);
/* variancetime(&(stats->totalresponsetime),
- stats->totalresponsetimesq,
- stats->totalconnects, &vartime); */
+ stats->totalresponsetimesq,
+ stats->totalconnects, &vartime); */
stddevtime(&(stats->totalresponsetime),
- stats->totalresponsetimesq,
- stats->totalconnects, &stdtime);
+ stats->totalresponsetimesq,
+ stats->totalconnects, &stdtime);
fprintf(f, "Response time (sec) \t%3d.%6.6d %3d.%6.6d %3d.%6.6d %3d.%6.6d\n",
- meantime.tv_sec,
- meantime.tv_usec,
- stdtime.tv_sec,
- stdtime.tv_usec,
- stats->minresponsetime.tv_sec,
- stats->minresponsetime.tv_usec,
- stats->maxresponsetime.tv_sec,
- stats->maxresponsetime.tv_usec);
+ meantime.tv_sec,
+ meantime.tv_usec,
+ stdtime.tv_sec,
+ stdtime.tv_usec,
+ stats->minresponsetime.tv_sec,
+ stats->minresponsetime.tv_usec,
+ stats->maxresponsetime.tv_sec,
+ stats->maxresponsetime.tv_usec);
/* 3rd-5th lines (response size, body size, # bytes moved */
fprintf(f, "Response size (bytes) \t%10.0lf %10.0lf %10.0lf %10.0lf\n",
- mean(stats->totalbytes, stats->totalconnects),
- stddev(stats->totalbytes, stats->totalbytessq,
- stats->totalconnects),
- stats->minbytes,
- stats->maxbytes);
+ mean(stats->totalbytes, stats->totalconnects),
+ stddev(stats->totalbytes, stats->totalbytessq, stats->totalconnects),
+ stats->minbytes,
+ stats->maxbytes);
fprintf(f, "Body size (bytes) \t%10.0lf %10.0lf %10.0lf %10.0lf\n\n",
- mean(stats->totalbody, stats->totalconnects),
- stddev(stats->totalbody, stats->totalbodysq,
- stats->totalconnects),
- stats->minbody,
- stats->maxbody);
+ mean(stats->totalbody, stats->totalconnects),
+ stddev(stats->totalbody, stats->totalbodysq, stats->totalconnects),
+ stats->minbody,
+ stats->maxbody);
fprintf(f, "%.0lf body bytes moved + %.0lf header bytes moved = %.0lf total\n",
- stats->totalbody,
- stats->totalbytes - stats->totalbody,
- stats->totalbytes);
-
+ stats->totalbody,
+ stats->totalbytes - stats->totalbody,
+ stats->totalbytes);
}
diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/cgi-send.c b/ACE/apps/JAWS/clients/WebSTONE/src/cgi-send.c
index f1474d34c28..5626836f650 100644
--- a/ACE/apps/JAWS/clients/WebSTONE/src/cgi-send.c
+++ b/ACE/apps/JAWS/clients/WebSTONE/src/cgi-send.c
@@ -15,34 +15,34 @@
int
main()
{
- int filesize;
- char *str_filesize;
- char *buffer;
- int index;
+ int filesize;
+ char *str_filesize;
+ char *buffer;
+ int index;
- printf("Content-type: text/plain\r\n\r\n");
+ printf("Content-type: text/plain\r\n\r\n");
- if ( !(str_filesize = getenv("QUERY_STRING")) )
- filesize = FILE_SIZE;
- else {
- if ( !strncmp(str_filesize, "size=", 5) )
- filesize = atoi(&(str_filesize[5]));
- else
- filesize = FILE_SIZE;
- }
+ if ( !(str_filesize = getenv("QUERY_STRING")) )
+ filesize = FILE_SIZE;
+ else {
+ if ( !strncmp(str_filesize, "size=", 5) )
+ filesize = atoi(&(str_filesize[5]));
+ else
+ filesize = FILE_SIZE;
+ }
- if ( !(buffer = (char *)malloc(filesize)) ) {
- fwrite(MALLOC_FAILURE, strlen(MALLOC_FAILURE), 1, stdout);
- return -1;
- }
+ if ( !(buffer = (char *)malloc(filesize)) ) {
+ fwrite(MALLOC_FAILURE, strlen(MALLOC_FAILURE), 1, stdout);
+ return -1;
+ }
- for (index=0; index< filesize; index++)
- /* generate random characters from A-Z */
- buffer[index] = rand() %26 + 63;
+ for (index=0; index< filesize; index++)
+ /* generate random characters from A-Z */
+ buffer[index] = rand() %26 + 63;
- fwrite(buffer, filesize, 1, stdout);
+ fwrite(buffer, filesize, 1, stdout);
- free(buffer);
+ free(buffer);
- return 0;
+ return 0;
}
diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/get.c b/ACE/apps/JAWS/clients/WebSTONE/src/get.c
index 8a6d9232deb..1fd5a31942c 100644
--- a/ACE/apps/JAWS/clients/WebSTONE/src/get.c
+++ b/ACE/apps/JAWS/clients/WebSTONE/src/get.c
@@ -1,15 +1,15 @@
/* $Id$ */
/**************************************************************************
- * *
- * Copyright (C) 1995 Silicon Graphics, Inc. *
- * *
- * These coded instructions, statements, and computer programs were *
- * developed by SGI for public use. If any changes are made to this code*
- * please try to get the changes back to the author. Feel free to make *
- * modifications and changes to the code and release it. *
- * *
+ *
+ * Copyright (C) 1995 Silicon Graphics, Inc.
+ *
+ * These coded instructions, statements, and computer programs were
+ * developed by SGI for public use. If any changes are made to this code
+ * please try to get the changes back to the author. Feel free to make
+ * modifications and changes to the code and release it.
+ *
**************************************************************************/
-
+
/* THIS IS WHERE WE GO OUT AND FETCH A URL */
#include <stdio.h>
@@ -51,13 +51,13 @@
/* compare two strings with max length, ignoring case */
int mystrincmp(const char *str1, const char *str2, int len) {
-register int diff;
+ register int diff;
while (*str1 && *str2 && len--) {
- if (diff = UPPER(*str1) - UPPER(*str2))
- return diff < 0 ? -1 : 1;
- str1++;
- str2++;
+ if (diff = UPPER(*str1) - UPPER(*str2))
+ return diff < 0 ? -1 : 1;
+ str1++;
+ str2++;
}
return 0;
}
@@ -85,52 +85,51 @@ get(char *loc, NETPORT port, char *url, rqst_timer_t *timer)
#ifdef ABORTIVE_CLOSE
#error don't enable this option
struct linger {
- int l_onoff;
- int l_linger;
+ int l_onoff;
+ int l_linger;
} linger_opt;
#endif /* ABORTIVE_CLOSE */
/* can you really get an error from gettimeofday?? */
if(GETTIMEOFDAY(&timer->entertime, &timer->entertimezone) != 0)
{
- returnerr("Error retrieving entertime\n");
- goto error;
+ returnerr("Error retrieving entertime\n");
+ goto error;
}
timer->valid = 1;
if(GETTIMEOFDAY(&timer->beforeconnect, &timer->beforeconnectzone) != 0)
{
- returnerr("Error retrieving beforeconnect\n");
- goto error;
+ returnerr("Error retrieving beforeconnect\n");
+ goto error;
}
sock = connectsock(loc, port, "tcp");
if (BADSOCKET(sock))
{
- D_PRINTF( "Call to connectsock returned %d (%s)\n", sock, neterrstr() );
- returnerr("Couldn't connect to WWW server: %s\n", neterrstr());
- goto error;
+ D_PRINTF( "Call to connectsock returned %d (%s)\n", sock, neterrstr() );
+ returnerr("Couldn't connect to WWW server: %s\n", neterrstr());
+ goto error;
}
-#ifdef ABORTIVE_CLOSE
+#ifdef ABORTIVE_CLOSE
#error don't enable this option
/* set up for abortive close */
linger_opt.l_onoff = 1;
linger_opt.l_linger = 0;
- if (setsockopt(sock, SOL_SOCKET, SO_LINGER,
- (char *) &linger_opt, sizeof(linger_opt)) < 0) {
- fprintf(stderr, "Can't set sockopt SO_LINGER");
- returnerr("Couldn't set SO_LINGER = 0\n");
- goto error;
+ if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (char *) &linger_opt, sizeof(linger_opt)) < 0) {
+ fprintf(stderr, "Can't set sockopt SO_LINGER");
+ returnerr("Couldn't set SO_LINGER = 0\n");
+ goto error;
}
#endif /* ABORTIVE_CLOSE */
if(GETTIMEOFDAY(&timer->afterconnect, &timer->afterconnectzone) != 0)
{
- NETCLOSE(sock);
- GETTIMEOFDAY(&timer->exittime, &timer->exittimezone);
- returnerr("Error retrieving afterconnect\n");
- goto error;
+ NETCLOSE(sock);
+ GETTIMEOFDAY(&timer->exittime, &timer->exittimezone);
+ returnerr("Error retrieving afterconnect\n");
+ goto error;
}
/*
@@ -143,19 +142,19 @@ get(char *loc, NETPORT port, char *url, rqst_timer_t *timer)
status = NETWRITE(sock, getcommand, writelen);
if(status != writelen)
{
- returnerr("Error sending command line to server: %s\n",
- neterrstr());
- goto error;
+ returnerr("Error sending command line to server: %s\n",
+ neterrstr());
+ goto error;
}
- /*
- * WE HAVE NOW SENT THE REQUEST SUCCESSFULLY.
- * WAIT FOR THE REPLY AND FIND THE HEADER
+ /*
+ * WE HAVE NOW SENT THE REQUEST SUCCESSFULLY.
+ * WAIT FOR THE REPLY AND FIND THE HEADER
*/
-
+
if(GETTIMEOFDAY(&timer->beforeheader, &timer->beforeheaderzone) != 0)
{
- returnerr("Error retrieving beforeheader\n");
- goto error;
+ returnerr("Error retrieving beforeheader\n");
+ goto error;
}
/* read the header and part of the file */
@@ -166,57 +165,57 @@ get(char *loc, NETPORT port, char *url, rqst_timer_t *timer)
bytesread = NETREAD(sock, headerbuffer+totalbytesread, HEADERBUFSIZ-totalbytesread);
if (BADSOCKET(bytesread))
{
- D_PRINTF( "Did not receive full header\n" );
- D_PRINTF( "NETREAD returned %d\n", bytesread );
- returnerr("Did not receive full header: %s\n",
- neterrstr());
- goto error;
+ D_PRINTF( "Did not receive full header\n" );
+ D_PRINTF( "NETREAD returned %d\n", bytesread );
+ returnerr("Did not receive full header: %s\n",
+ neterrstr());
+ goto error;
}
totalbytesread += bytesread;
- /* search for end of header */
- headerbuffer[totalbytesread] = 0;
- if (offset = strstr(headerbuffer, "\n\n")) {
- headerlen = offset - headerbuffer + 2;
- break;
- } else if (offset = strstr(headerbuffer, "\n\r\n")) {
- headerlen = offset - headerbuffer + 3;
- break;
- }
+ /* search for end of header */
+ headerbuffer[totalbytesread] = 0;
+ if (offset = strstr(headerbuffer, "\n\n")) {
+ headerlen = offset - headerbuffer + 2;
+ break;
+ } else if (offset = strstr(headerbuffer, "\n\r\n")) {
+ headerlen = offset - headerbuffer + 3;
+ break;
+ }
}
if (headerlen == 0) {
- returnerr("Can't find the end of the header in \"%s\"\n", headerbuffer);
- goto error;
+ returnerr("Can't find the end of the header in \"%s\"\n", headerbuffer);
+ goto error;
}
/* get and check status code from the first line of the header */
count = sscanf(headerbuffer, "HTTP/%s %d", version, &status);
if (count != 2) {
- returnerr("Bad status line in get(): %s\n", headerbuffer);
- goto error;
+ returnerr("Bad status line in get(): %s\n", headerbuffer);
+ goto error;
}
if (status < 200 || status > 300) {
- returnerr("Bad status (%d) in get() for url %s\n", status, url);
- goto error;
+ returnerr("Bad status (%d) in get() for url %s\n", status, url);
+ goto error;
}
/* get the content length line from the header */
offset = headerbuffer;
while (offset < headerbuffer+headerlen && *offset) {
- if (*offset++ != '\n')
- continue;
+ if (*offset++ != '\n')
+ continue;
- if (mystrincmp(offset, CONTENT_LENGTH_STRING, strlen(CONTENT_LENGTH_STRING)) == 0) {
- sscanf(offset+strlen(CONTENT_LENGTH_STRING), "%d", &contentlength);
- D_PRINTF( "Content-Length: %d\n", contentlength );
- }
+ if (mystrincmp(offset, CONTENT_LENGTH_STRING, strlen( CONTENT_LENGTH_STRING)) == 0) {
+ sscanf(offset+strlen(CONTENT_LENGTH_STRING), "%d", &contentlength);
+ D_PRINTF( "Content-Length: %d\n", contentlength );
+ }
}
if(GETTIMEOFDAY(&timer->afterheader, &timer->afterheaderzone) != 0)
{
- returnerr("Error retrieving afterheader\n");
- goto error;
+ returnerr("Error retrieving afterheader\n");
+ goto error;
}
if(savefile)
@@ -224,57 +223,56 @@ get(char *loc, NETPORT port, char *url, rqst_timer_t *timer)
sprintf(outputfilename,"/tmp/webstone.data.%d", (int)getpid());
if((outputfile = open(outputfilename,(O_WRONLY|O_CREAT),0777)) < 0)
{
- D_PRINTF( "outputfile %d %d\n", outputfile, errno );
- returnerr("Error saving file: %s\n", strerror(errno));
- goto error;
+ D_PRINTF( "outputfile %d %d\n", outputfile, errno );
+ returnerr("Error saving file: %s\n", strerror(errno));
+ goto error;
}
- lseek(outputfile,1,SEEK_END); /* this is odd... JEF */
+ lseek(outputfile,1,SEEK_END); /* this is odd... JEF */
- /* if we have part of the file already, save that part */
- if(totalbytesread > headerlen)
- {
- write(outputfile, headerbuffer+headerlen, totalbytesread-headerlen);
- }
+ /* if we have part of the file already, save that part */
+ if(totalbytesread > headerlen)
+ {
+ write(outputfile, headerbuffer+headerlen, totalbytesread-headerlen);
+ }
}
/* read the body of the file */
do
{
- bytesread = NETREAD(sock, headerbuffer, HEADERBUFSIZ);
- D_PRINTF( "Read %d bytes from socket %d\n", bytesread, sock );
+ bytesread = NETREAD(sock, headerbuffer, HEADERBUFSIZ);
+ D_PRINTF( "Read %d bytes from socket %d\n", bytesread, sock );
- if (BADSOCKET(bytesread))
- {
- D_PRINTF( "Read returns %d, error: %s\n", bytesread,
- neterrstr() );
+ if (BADSOCKET(bytesread))
+ {
+ D_PRINTF("Read returns %d, error: %s\n", bytesread,
+ neterrstr() );
returnerr("Error during read of page body. Read "
- "returns %d on socket %d, error: %s\n",
- bytesread, sock, neterrstr());
- goto error;
- }
-
- totalbytesread += bytesread;
+ "returns %d on socket %d, error: %s\n",
+ bytesread, sock, neterrstr());
+ goto error;
+ }
- if (outputfile != -1 && bytesread)
- {
- write(outputfile, headerbuffer, bytesread);
- }
+ totalbytesread += bytesread;
+ if (outputfile != -1 && bytesread)
+ {
+ write(outputfile, headerbuffer, bytesread);
+ }
} while (bytesread);
-
+
/* done reading body */
if ( contentlength && (totalbytesread - headerlen) != contentlength)
{
- D_PRINTF( "Warning: file length (%d) doesn't match Content-length (%d)\n",
- totalbytesread - headerlen, contentlength);
+ D_PRINTF( "Warning: file length (%d) doesn't match Content-length (%d)\n",
+ totalbytesread - headerlen, contentlength);
}
-
+
bodylength = totalbytesread - headerlen;
if(GETTIMEOFDAY(&timer->afterbody, &timer->afterbodyzone) != 0)
{
- returnerr("Error retrieving afterbody\n");
- goto error;
+ returnerr("Error retrieving afterbody\n");
+ goto error;
}
NETCLOSE(sock);
@@ -283,28 +281,28 @@ get(char *loc, NETPORT port, char *url, rqst_timer_t *timer)
close(outputfile);
}
- D_PRINTF( "Read %d bytes, %d of that being body\n",
- totalbytesread, bodylength );
+ D_PRINTF("Read %d bytes, %d of that being body\n",
+ totalbytesread, bodylength );
if(GETTIMEOFDAY(&timer->exittime, &timer->exittimezone) != 0)
{
- D_PRINTF( "Error retrieving exit time: %s\n", strerror(errno) );
- returnerr("Error retrieving exit time\n");
- goto error;
+ D_PRINTF( "Error retrieving exit time: %s\n", strerror(errno) );
+ returnerr("Error retrieving exit time\n");
+ goto error;
}
timer->valid = 2;
timer->totalbytes = totalbytesread;
timer->bodybytes = bodylength;
- D_PRINTF( "get returning totalbytes %d body %d valid %d\n",
- timer->totalbytes, timer->bodybytes, timer->valid );
+ D_PRINTF("get returning totalbytes %d body %d valid %d\n",
+ timer->totalbytes, timer->bodybytes, timer->valid );
- D_PRINTF( "get returning start %d, end %d\n",
- timer->entertime.tv_sec, timer->exittime.tv_sec );
+ D_PRINTF("get returning start %d, end %d\n",
+ timer->entertime.tv_sec, timer->exittime.tv_sec );
- D_PRINTF( "get returning connect %d, request %d, header %d, body %d\n",
- timer->afterconnect.tv_sec, timer->beforeheader.tv_sec,
- timer->afterheader.tv_sec, timer->afterbody.tv_sec );
+ D_PRINTF("get returning connect %d, request %d, header %d, body %d\n",
+ timer->afterconnect.tv_sec, timer->beforeheader.tv_sec,
+ timer->afterheader.tv_sec, timer->afterbody.tv_sec );
return 0;
@@ -312,7 +310,7 @@ error:
if (!BADSOCKET(sock))
NETCLOSE(sock);
if (outputfile != -1)
- close(outputfile);
+ close(outputfile);
GETTIMEOFDAY(&timer->exittime, &timer->exittimezone); /* needed? */
return -1;
-}
+}
diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/getopt.c b/ACE/apps/JAWS/clients/WebSTONE/src/getopt.c
index d04ea469aa6..a57064531ad 100644
--- a/ACE/apps/JAWS/clients/WebSTONE/src/getopt.c
+++ b/ACE/apps/JAWS/clients/WebSTONE/src/getopt.c
@@ -6,62 +6,62 @@
#include <string.h>
#define MYNULL 0
-#define ERR(s, c) if(opterr){\
- extern size_t strlen();\
- extern int write();\
- char errbuf[2];\
- errbuf[0] = c; errbuf[1] = '\n';\
- (void) write(2, argv[0], strlen(argv[0]));\
- (void) write(2, s, strlen(s));\
- (void) write(2, errbuf, 2);}
+#define ERR(s, c) if(opterr){\
+ extern size_t strlen();\
+ extern int write();\
+ char errbuf[2];\
+ errbuf[0] = c; errbuf[1] = '\n';\
+ (void) write(2, argv[0], strlen(argv[0]));\
+ (void) write(2, s, strlen(s));\
+ (void) write(2, errbuf, 2);}
-int opterr = 1;
-int optind = 1;
-int optopt;
-char *optarg;
+int opterr = 1;
+int optind = 1;
+int optopt;
+char *optarg;
int
getopt(argc, argv, opts)
-int argc;
-char **argv, *opts;
+int argc;
+char **argv, *opts;
{
- static int sp = 1;
- register int c;
- register char *cp;
+ static int sp = 1;
+ register int c;
+ register char *cp;
- if(sp == 1)
- if(optind >= argc ||
- argv[optind][0] != '-' || argv[optind][1] == '\0')
- return(EOF);
- else if(strcmp(argv[optind], "--") == MYNULL) {
- optind++;
- return(EOF);
- }
- optopt = c = argv[optind][sp];
- if(c == ':' || (cp=strchr(opts, c)) == 0) {
- ERR(": unknown option, -", c);
- if(argv[optind][++sp] == '\0') {
- optind++;
- sp = 1;
- }
- return('?');
- }
- if(*++cp == ':') {
- if(argv[optind][sp+1] != '\0')
- optarg = &argv[optind++][sp+1];
- else if(++optind >= argc) {
- ERR(": argument missing for -", c);
- sp = 1;
- return('?');
- } else
- optarg = argv[optind++];
- sp = 1;
- } else {
- if(argv[optind][++sp] == '\0') {
- sp = 1;
- optind++;
- }
- optarg = 0;
- }
- return(c);
+ if(sp == 1)
+ if(optind >= argc ||
+ argv[optind][0] != '-' || argv[optind][1] == '\0')
+ return(EOF);
+ else if(strcmp(argv[optind], "--") == MYNULL) {
+ optind++;
+ return(EOF);
+ }
+ optopt = c = argv[optind][sp];
+ if(c == ':' || (cp=strchr(opts, c)) == 0) {
+ ERR(": unknown option, -", c);
+ if(argv[optind][++sp] == '\0') {
+ optind++;
+ sp = 1;
+ }
+ return('?');
+ }
+ if(*++cp == ':') {
+ if(argv[optind][sp+1] != '\0')
+ optarg = &argv[optind++][sp+1];
+ else if(++optind >= argc) {
+ ERR(": argument missing for -", c);
+ sp = 1;
+ return('?');
+ } else
+ optarg = argv[optind++];
+ sp = 1;
+ } else {
+ if(argv[optind][++sp] == '\0') {
+ sp = 1;
+ optind++;
+ }
+ optarg = 0;
+ }
+ return(c);
}
diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/nsapi-send.c b/ACE/apps/JAWS/clients/WebSTONE/src/nsapi-send.c
index 70e99d33a87..e87514934d9 100644
--- a/ACE/apps/JAWS/clients/WebSTONE/src/nsapi-send.c
+++ b/ACE/apps/JAWS/clients/WebSTONE/src/nsapi-send.c
@@ -48,7 +48,7 @@
#define HEADERS "HTTP/1.0 200 OK\r\nContent-type: text/html\r\n\r\n"
#ifdef WIN32
-__declspec(dllexport)
+__declspec(dllexport)
#endif
int nsapi_send(pblock *pb, Session *sn, Request *rq)
@@ -63,9 +63,9 @@ int nsapi_send(pblock *pb, Session *sn, Request *rq)
* file size was specified.
*/
if ( !(query_string = pblock_findval("query", rq->reqpb)) )
- filesize = FILE_SIZE;
+ filesize = FILE_SIZE;
else {
- filesize = atoi(&(query_string[5]));
+ filesize = atoi(&(query_string[5]));
}
memcpy(&buffer, HEADERS, sizeof(HEADERS)-1);
@@ -73,16 +73,16 @@ int nsapi_send(pblock *pb, Session *sn, Request *rq)
/* Generate the output */
maxindex = sizeof(HEADERS) + filesize;
for (index=sizeof(HEADERS); index < (maxindex); index++)
- /* generate random characters from A-Z */
+ /* generate random characters from A-Z */
#ifdef IRIX
- buffer[index] = rand_r() % 26 + 63;
+ buffer[index] = rand_r() % 26 + 63;
#else
buffer[index] = rand() %26 + 63;
#endif
/* Send the output */
if (net_write(sn->csd, buffer, sizeof(HEADERS)-1+filesize, 0) == IO_ERROR)
- return REQ_EXIT;
+ return REQ_EXIT;
return REQ_PROCEED;
}
diff --git a/ACE/apps/JAWS/server/HTTP_Config.cpp b/ACE/apps/JAWS/server/HTTP_Config.cpp
index 11890037d3c..5ba338f655c 100644
--- a/ACE/apps/JAWS/server/HTTP_Config.cpp
+++ b/ACE/apps/JAWS/server/HTTP_Config.cpp
@@ -80,7 +80,7 @@ HTTP_Config_Info::document_root (const char *dr_string)
{
this->document_root_ = ACE_OS::getenv ("JAWS_DOCUMENT_ROOT");
if (!this->document_root_)
- this->document_root_ = ".";
+ this->document_root_ = ".";
}
return this->document_root_;
@@ -96,7 +96,7 @@ HTTP_Config_Info::cgi_path (const char *cp_string)
this->cgi_path_ = ACE_OS::getenv ("JAWS_CGI_PATH");
if (!this->cgi_path_)
- this->cgi_path_ = "cgi-bin";
+ this->cgi_path_ = "cgi-bin";
}
return this->cgi_path_;
@@ -111,7 +111,7 @@ HTTP_Config_Info::user_dir (const char *ud_string)
{
this->user_dir_ = ACE_OS::getenv ("JAWS_USER_DIR");
if (!this->user_dir_)
- this->user_dir_ = ".www";
+ this->user_dir_ = ".www";
}
return this->user_dir_;
@@ -126,7 +126,7 @@ HTTP_Config_Info::dir_index (const char *di_string)
{
this->dir_index_ = ACE_OS::getenv ("JAWS_DIR_INDEX");
if (!this->dir_index_)
- this->dir_index_ = "index.html";
+ this->dir_index_ = "index.html";
}
return this->dir_index_;
diff --git a/ACE/apps/JAWS/server/HTTP_Handler.cpp b/ACE/apps/JAWS/server/HTTP_Handler.cpp
index a4e4ad31b23..340d4773c3f 100644
--- a/ACE/apps/JAWS/server/HTTP_Handler.cpp
+++ b/ACE/apps/JAWS/server/HTTP_Handler.cpp
@@ -14,7 +14,7 @@
ACE_RCSID(server, HTTP_Handler, "$Id$")
HTTP_Handler::HTTP_Handler (JAWS_IO &io,
- HTTP_Handler_Factory &factory)
+ HTTP_Handler_Factory &factory)
: factory_ (factory),
request_data_ (0),
handle_ (ACE_INVALID_HANDLE),
@@ -32,7 +32,7 @@ HTTP_Handler::~HTTP_Handler (void)
void
HTTP_Handler::open (ACE_HANDLE handle,
- ACE_Message_Block &initial_data)
+ ACE_Message_Block &initial_data)
{
ACE_DEBUG ((LM_DEBUG, "(%t) New connection \n"));
@@ -171,7 +171,7 @@ void
HTTP_Handler::transmit_file_error (int result)
{
ACE_DEBUG ((LM_DEBUG,
- " (%t) %s error in transmitting file\n",
+ " (%t) %s error in transmitting file\n",
request_.uri ()));
int status_code;
@@ -276,7 +276,7 @@ No_Cache_Synch_HTTP_Handler_Factory::create_http_handler (void)
void
No_Cache_Synch_HTTP_Handler_Factory::destroy_http_handler (HTTP_Handler &handler,
- JAWS_IO &io)
+ JAWS_IO &io)
{
delete &io;
delete &handler;
@@ -288,7 +288,7 @@ No_Cache_Synch_HTTP_Handler_Factory::destroy_http_handler (HTTP_Handler &handler
#if defined (ACE_HAS_WIN32_OVERLAPPED_IO)
void
Asynch_HTTP_Handler_Factory::open (ACE_HANDLE handle,
- ACE_Message_Block &mb)
+ ACE_Message_Block &mb)
{
JAWS_Asynch_IO *io;
ACE_NEW (io, JAWS_Asynch_IO);
@@ -299,7 +299,7 @@ Asynch_HTTP_Handler_Factory::open (ACE_HANDLE handle,
void
Asynch_HTTP_Handler_Factory::destroy_http_handler (HTTP_Handler &handler,
- JAWS_IO &io)
+ JAWS_IO &io)
{
delete &handler;
delete &io;
diff --git a/ACE/apps/JAWS/server/HTTP_Helpers.cpp b/ACE/apps/JAWS/server/HTTP_Helpers.cpp
index 4bbaa6ee498..083199e49b1 100644
--- a/ACE/apps/JAWS/server/HTTP_Helpers.cpp
+++ b/ACE/apps/JAWS/server/HTTP_Helpers.cpp
@@ -44,9 +44,9 @@ HTTP_Helper::HTTP_mktime (const char *httpdate)
do
{
if (*ptr1 == ' ')
- *ptr2++ = ';';
+ *ptr2++ = ';';
else
- *ptr2++ = *ptr1;
+ *ptr2++ = *ptr1;
}
while (*ptr1++ != '\0');
@@ -70,11 +70,11 @@ HTTP_Helper::HTTP_mktime (const char *httpdate)
if (::sscanf(buf, "%3s,;%2d;%3s;%4d;%2d:%2d:%2d;GMT", // RFC-1123 date format
weekday,
&tms.tm_mday,
- month,
- &tms.tm_year,
+ month,
+ &tms.tm_year,
&tms.tm_hour,
- &tms.tm_min,
- &tms.tm_sec) == 7)
+ &tms.tm_min,
+ &tms.tm_sec) == 7)
;
else if (::sscanf(buf, "%s,;%2d-%3s-%2d;%2d:%2d:%2d;GMT", // RFC-850 date format
weekday,
@@ -192,14 +192,14 @@ HTTP_Helper::HTTP_decode_string (char *path)
for (i = j = 0; path[i] != '\0'; i++, j++)
{
if (path[i] == '%')
- {
- percentcode[0] = path[++i];
- percentcode[1] = path[++i];
- percentcode[2] = '\0';
- path[j] = (char) ACE_OS::strtol (percentcode, (char **) 0, 16);
- }
+ {
+ percentcode[0] = path[++i];
+ percentcode[1] = path[++i];
+ percentcode[2] = '\0';
+ path[j] = (char) ACE_OS::strtol (percentcode, (char **) 0, 16);
+ }
else
- path[j] = path[i];
+ path[j] = path[i];
}
path[j] = path[i];
@@ -248,7 +248,7 @@ HTTP_Helper::HTTP_decode_base64 (char *data)
char_count = 0;
}
else
- bits <<= 6;
+ bits <<= 6;
}
if (c == '\0')
@@ -360,23 +360,23 @@ HTTP_Helper::fixyear (int year)
time_t tloc;
if (ACE_OS::time (&tloc) != (time_t) -1)
- {
- ACE_OS::gmtime_r (&tloc, &tms);
+ {
+ ACE_OS::gmtime_r (&tloc, &tms);
- if (tms.tm_year % 100 == year)
- year = tms.tm_year;
+ if (tms.tm_year % 100 == year)
+ year = tms.tm_year;
// The last two cases check boundary conditions, in case the
// year just changed at the moment we checked to see if we
// need to fix it.
- if ((year+1) % 100 == tms.tm_year % 100)
- year = tms.tm_year - 1;
+ if ((year+1) % 100 == tms.tm_year % 100)
+ year = tms.tm_year - 1;
- if (year == (tms.tm_year + 1) % 100)
- year = tms.tm_year + 1;
+ if (year == (tms.tm_year + 1) % 100)
+ year = tms.tm_year + 1;
- // What to do if none of the above?
- }
+ // What to do if none of the above?
+ }
}
return year;
@@ -390,50 +390,50 @@ HTTP_Status_Code::instance (void)
ACE_MT (ACE_Guard<ACE_SYNCH_MUTEX> g (lock_));
if (HTTP_Status_Code::instance_ == 0)
- {
- for (size_t i = 0;
- i < HTTP_Status_Code::MAX_STATUS_CODE + 1;
- i++)
- {
- switch (i)
- {
- case STATUS_OK:
- HTTP_Status_Code::Reason[i] = "OK"; break;
- case STATUS_CREATED:
- HTTP_Status_Code::Reason[i] = "Created"; break;
- case STATUS_ACCEPTED:
- HTTP_Status_Code::Reason[i] = "Accepted"; break;
- case STATUS_NO_CONTENT:
- HTTP_Status_Code::Reason[i] = "No Content"; break;
- case STATUS_MOVED_PERMANENTLY:
- HTTP_Status_Code::Reason[i] = "Moved Permanently"; break;
- case STATUS_MOVED_TEMPORARILY:
- HTTP_Status_Code::Reason[i] = "Moved Temporarily"; break;
- case STATUS_NOT_MODIFIED:
- HTTP_Status_Code::Reason[i] = "Not Modified"; break;
- case STATUS_BAD_REQUEST:
- HTTP_Status_Code::Reason[i] = "Bad Request"; break;
- case STATUS_UNAUTHORIZED:
- HTTP_Status_Code::Reason[i] = "Unauthorized"; break;
- case STATUS_FORBIDDEN:
- HTTP_Status_Code::Reason[i] = "Forbidden"; break;
- case STATUS_NOT_FOUND:
- HTTP_Status_Code::Reason[i] = "Not Found"; break;
- case STATUS_INTERNAL_SERVER_ERROR:
- HTTP_Status_Code::Reason[i] = "Internal Server Error"; break;
- case STATUS_NOT_IMPLEMENTED:
- HTTP_Status_Code::Reason[i] = "Not Implemented"; break;
- case STATUS_BAD_GATEWAY:
- HTTP_Status_Code::Reason[i] = "Bad Gateway"; break;
- case STATUS_SERVICE_UNAVAILABLE:
- HTTP_Status_Code::Reason[i] = "Service Unavailable"; break;
- default:
- HTTP_Status_Code::Reason[i] = "Unknown";
- }
- }
-
- HTTP_Status_Code::instance_ = 1;
- }
+ {
+ for (size_t i = 0;
+ i < HTTP_Status_Code::MAX_STATUS_CODE + 1;
+ i++)
+ {
+ switch (i)
+ {
+ case STATUS_OK:
+ HTTP_Status_Code::Reason[i] = "OK"; break;
+ case STATUS_CREATED:
+ HTTP_Status_Code::Reason[i] = "Created"; break;
+ case STATUS_ACCEPTED:
+ HTTP_Status_Code::Reason[i] = "Accepted"; break;
+ case STATUS_NO_CONTENT:
+ HTTP_Status_Code::Reason[i] = "No Content"; break;
+ case STATUS_MOVED_PERMANENTLY:
+ HTTP_Status_Code::Reason[i] = "Moved Permanently"; break;
+ case STATUS_MOVED_TEMPORARILY:
+ HTTP_Status_Code::Reason[i] = "Moved Temporarily"; break;
+ case STATUS_NOT_MODIFIED:
+ HTTP_Status_Code::Reason[i] = "Not Modified"; break;
+ case STATUS_BAD_REQUEST:
+ HTTP_Status_Code::Reason[i] = "Bad Request"; break;
+ case STATUS_UNAUTHORIZED:
+ HTTP_Status_Code::Reason[i] = "Unauthorized"; break;
+ case STATUS_FORBIDDEN:
+ HTTP_Status_Code::Reason[i] = "Forbidden"; break;
+ case STATUS_NOT_FOUND:
+ HTTP_Status_Code::Reason[i] = "Not Found"; break;
+ case STATUS_INTERNAL_SERVER_ERROR:
+ HTTP_Status_Code::Reason[i] = "Internal Server Error"; break;
+ case STATUS_NOT_IMPLEMENTED:
+ HTTP_Status_Code::Reason[i] = "Not Implemented"; break;
+ case STATUS_BAD_GATEWAY:
+ HTTP_Status_Code::Reason[i] = "Bad Gateway"; break;
+ case STATUS_SERVICE_UNAVAILABLE:
+ HTTP_Status_Code::Reason[i] = "Service Unavailable"; break;
+ default:
+ HTTP_Status_Code::Reason[i] = "Unknown";
+ }
+ }
+
+ HTTP_Status_Code::instance_ = 1;
+ }
// GUARD released
}
diff --git a/ACE/apps/JAWS/server/HTTP_Response.cpp b/ACE/apps/JAWS/server/HTTP_Response.cpp
index 9750a1a6482..2f67a49c873 100644
--- a/ACE/apps/JAWS/server/HTTP_Response.cpp
+++ b/ACE/apps/JAWS/server/HTTP_Response.cpp
@@ -204,7 +204,7 @@ HTTP_Response::normal_response (void)
= HTTP_Helper::HTTP_decode_base64 (ACE_OS::strcpy (buf, hvv));
if (mmapfile.map (ACE_TEXT ("jaws.auth")) != -1
- && auth != 0
+ && auth != 0
&& ACE_OS::strstr((const char *) mmapfile.addr (), auth) != 0)
this->io_.receive_file (this->request_.path (),
this->request_.data (),
@@ -231,8 +231,8 @@ HTTP_Response::cgi_response (void)
if (this->request_.cgi_args ())
cgi_options.command_line ("%s %s",
- this->request_.path (),
- this->request_.cgi_args ());
+ this->request_.path (),
+ this->request_.cgi_args ());
else
cgi_options.command_line ("%s", this->request_.path ());
@@ -252,27 +252,27 @@ HTTP_Response::cgi_response (void)
if (this->request_.path_info ())
{
cgi_options.setenv ("PATH_INFO", "%s",
- this->request_.path_info ());
+ this->request_.path_info ());
cgi_options.setenv ("PATH_TRANSLATED",
- "%s/%s",
+ "%s/%s",
HTTP_Config::instance ()->document_root (),
this->request_.path_info ());
}
cgi_options.setenv ("SCRIPT_NAME",
- "%s",
- this->request_.uri ());
+ "%s",
+ this->request_.uri ());
if (this->request_.query_string ())
cgi_options.setenv ("QUERY_STRING",
- "%s",
- this->request_.query_string ());
+ "%s",
+ this->request_.query_string ());
if (this->request_.cgi_env ())
for (size_t i = 0; this->request_.cgi_env ()[i]; i += 2)
cgi_options.setenv (this->request_.cgi_env ()[i],
- "%s",
- this->request_.cgi_env ()[i+1]);
+ "%s",
+ this->request_.cgi_env ()[i+1]);
char buf[BUFSIZ];
char *p, *q;
@@ -345,12 +345,12 @@ HTTP_Response::build_headers (void)
if (HTTP_Helper::HTTP_date (date_ptr) != 0)
HTTP_HEADER_LENGTH +=
- ACE_OS::sprintf (HTTP_HEADER+HTTP_HEADER_LENGTH,
+ ACE_OS::sprintf (HTTP_HEADER+HTTP_HEADER_LENGTH,
"Date: %s\r\n", date_ptr);
if (! this->request_.cgi ()) {
- HTTP_HEADER_LENGTH +=
- ACE_OS::sprintf (HTTP_HEADER+HTTP_HEADER_LENGTH,
+ HTTP_HEADER_LENGTH +=
+ ACE_OS::sprintf (HTTP_HEADER+HTTP_HEADER_LENGTH,
"Content-type: %s\r\n",
"text/html");
@@ -362,9 +362,9 @@ HTTP_Response::build_headers (void)
if ((this->request_.type () == HTTP_Request::GET) &&
(ACE_OS::stat (this->request_.path (), &file_stat) == 0))
{
- HTTP_HEADER_LENGTH +=
- ACE_OS::sprintf (HTTP_HEADER+HTTP_HEADER_LENGTH,
- "Content-length: %u\r\n", file_stat.st_size);
+ HTTP_HEADER_LENGTH +=
+ ACE_OS::sprintf (HTTP_HEADER+HTTP_HEADER_LENGTH,
+ "Content-length: %u\r\n", file_stat.st_size);
}
// Complete header with empty line and adjust header length.
diff --git a/ACE/apps/JAWS/server/HTTP_Server.cpp b/ACE/apps/JAWS/server/HTTP_Server.cpp
index dcaf1858cd4..42cb6618241 100644
--- a/ACE/apps/JAWS/server/HTTP_Server.cpp
+++ b/ACE/apps/JAWS/server/HTTP_Server.cpp
@@ -143,10 +143,10 @@ HTTP_Server::init (int argc, ACE_TCHAR *argv[])
HTTP_Handler_Factory *f = 0;
if (this->strategy_ != (JAWS::JAWS_POOL | JAWS::JAWS_ASYNCH))
- if (this->caching_)
- ACE_NEW_RETURN (f, Synch_HTTP_Handler_Factory (), -1);
- else
- ACE_NEW_RETURN (f, No_Cache_Synch_HTTP_Handler_Factory (), -1);
+ if (this->caching_)
+ ACE_NEW_RETURN (f, Synch_HTTP_Handler_Factory (), -1);
+ else
+ ACE_NEW_RETURN (f, No_Cache_Synch_HTTP_Handler_Factory (), -1);
//NOTE: At this point f better not be a NULL pointer,
//so please do not change the ACE_NEW_RETURN macros unless
@@ -198,10 +198,10 @@ HTTP_Server::synch_thread_pool (HTTP_Handler_Factory &factory)
Synch_Thread_Pool_Task::Synch_Thread_Pool_Task (HTTP_Acceptor &acceptor,
ACE_Thread_Manager &tm,
int threads,
- HTTP_Handler_Factory &factory)
+ HTTP_Handler_Factory &factory)
: ACE_Task<ACE_NULL_SYNCH> (&tm),
acceptor_ (acceptor),
- factory_ (factory)
+ factory_ (factory)
{
if (this->activate (THR_DETACHED | THR_NEW_LWP, threads) == -1)
ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"),
@@ -271,36 +271,36 @@ HTTP_Server::thread_per_request (HTTP_Handler_Factory &factory)
ACE_NEW_RETURN (t, Thread_Per_Request_Task (stream.get_handle (),
this->tm_,
grp_id,
- factory),
+ factory),
-1);
if (t->open () != 0)
- ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"),
+ ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"),
ACE_TEXT ("Thread_Per_Request_Task::open")),
-1);
// Throttling is not allowing too many threads to run away.
// Should really use some sort of condition variable here.
if (!this->throttle_)
- continue;
+ continue;
// This works because each task has only one thread.
while (this->tm_.num_tasks_in_group (grp_id) > this->threads_)
- this->tm_.wait (&wait_time);
+ this->tm_.wait (&wait_time);
}
ACE_NOTREACHED(return 0);
}
Thread_Per_Request_Task::Thread_Per_Request_Task (ACE_HANDLE handle,
- ACE_Thread_Manager &tm,
+ ACE_Thread_Manager &tm,
int &grp_id,
- HTTP_Handler_Factory &factory)
+ HTTP_Handler_Factory &factory)
: ACE_Task<ACE_NULL_SYNCH> (&tm),
handle_ (handle),
grp_id_ (grp_id),
- factory_ (factory)
+ factory_ (factory)
{
}
@@ -343,7 +343,7 @@ int
Thread_Per_Request_Task::close (u_long)
{
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT (" (%t) Thread_Per_Request_Task::svc, dying\n")));
+ ACE_TEXT (" (%t) Thread_Per_Request_Task::svc, dying\n")));
delete this;
return 0;
}
@@ -376,7 +376,7 @@ HTTP_Server::asynch_thread_pool (void)
// Tell the acceptor to listen on this->port_, which makes an
// asynchronous I/O request to the OS.
if (acceptor.open (ACE_INET_Addr (this->port_),
- HTTP_Handler::MAX_REQUEST_SIZE + 1) == -1)
+ HTTP_Handler::MAX_REQUEST_SIZE + 1) == -1)
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"),
ACE_TEXT ("ACE_Asynch_Acceptor::open")), -1);
diff --git a/ACE/apps/JAWS/server/HTTP_Server.h b/ACE/apps/JAWS/server/HTTP_Server.h
index c7afbf729e0..942b1575d77 100644
--- a/ACE/apps/JAWS/server/HTTP_Server.h
+++ b/ACE/apps/JAWS/server/HTTP_Server.h
@@ -98,7 +98,7 @@ public:
Synch_Thread_Pool_Task (HTTP_Acceptor &acceptor,
ACE_Thread_Manager &tm,
int threads,
- HTTP_Handler_Factory &factory);
+ HTTP_Handler_Factory &factory);
virtual int svc (void);
private:
@@ -121,7 +121,7 @@ public:
Thread_Per_Request_Task (ACE_HANDLE handle,
ACE_Thread_Manager &tm,
int &grp_id,
- HTTP_Handler_Factory &factory);
+ HTTP_Handler_Factory &factory);
virtual int open (void *args = 0);
virtual int close (u_long);
virtual int svc (void);
diff --git a/ACE/apps/JAWS/stress_testing/benchd.cpp b/ACE/apps/JAWS/stress_testing/benchd.cpp
index da657813e09..02209a12a13 100644
--- a/ACE/apps/JAWS/stress_testing/benchd.cpp
+++ b/ACE/apps/JAWS/stress_testing/benchd.cpp
@@ -36,9 +36,9 @@ class Handle_Events : public ACE_Event_Handler
{
public:
Handle_Events (u_short udp_port,
- const char *ip_addr,
- const char *interface_,
- ACE_Reactor &reactor);
+ const char *ip_addr,
+ const char *interface_,
+ ACE_Reactor &reactor);
~Handle_Events (void);
virtual int handle_input (ACE_HANDLE);
@@ -59,16 +59,16 @@ Handle_Events::handle_input (ACE_HANDLE h)
{
int readresult = ACE_OS::read (h, buf, BUFSIZ);
if (readresult > 0)
- {
- if (this->mcast_.send (buf, readresult) != readresult)
- {
- ACE_OS::perror ("send error");
- return -1;
- }
- return 0;
- }
+ {
+ if (this->mcast_.send (buf, readresult) != readresult)
+ {
+ ACE_OS::perror ("send error");
+ return -1;
+ }
+ return 0;
+ }
else if (readresult == -1)
- ACE_OS::perror ("can't read from STDIN");
+ ACE_OS::perror ("can't read from STDIN");
return -1;
}
@@ -80,15 +80,15 @@ Handle_Events::handle_input (ACE_HANDLE h)
int retcode = this->mcast_.recv (buf, sizeof buf, remote_addr);
if (retcode != -1)
- {
+ {
/*
cout << "received datagram from host " << remote_addr.get_host_name ()
<< " on port " << remote_addr.get_port_number ()
<< " bytes = " << retcode << endl;
*/
serve (buf);
- return 0;
- }
+ return 0;
+ }
ACE_OS::perror ("Something amiss.");
return -1;
@@ -114,9 +114,9 @@ Handle_Events::~Handle_Events (void)
}
Handle_Events::Handle_Events (u_short udp_port,
- const char *ip_addr,
- const char *interface_,
- ACE_Reactor &reactor)
+ const char *ip_addr,
+ const char *interface_,
+ ACE_Reactor &reactor)
{
// Create multicast address to listen on.
@@ -138,8 +138,8 @@ Handle_Events::Handle_Events (u_short udp_port,
// Register callbacks with the ACE_Reactor.
if (reactor.register_handler (this->handle_set_,
- this,
- ACE_Event_Handler::READ_MASK) == -1)
+ this,
+ ACE_Event_Handler::READ_MASK) == -1)
ACE_OS::perror ("can't register events"), ACE_OS::exit (1);
}
@@ -185,13 +185,13 @@ parse_args (int argc, char *argv[])
case 'q':
QUIET = 1;
case 'i':
- INTERFACE = get_opt.opt_arg ();
- break;
+ INTERFACE = get_opt.opt_arg ();
+ break;
case 'u':
- // Usage fallthrough.
+ // Usage fallthrough.
default:
ACE_DEBUG ((LM_DEBUG, "%s -i interface\n", argv[0]));
- ACE_OS::exit (1);
+ ACE_OS::exit (1);
}
}
@@ -235,7 +235,7 @@ int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
ACE_ERROR ((LM_ERROR, "error: %s must be run on a platform that support IP multicast\n",
- argv[0]));
+ argv[0]));
return 0;
}
#endif /* ACE_HAS_IP_MULTICAST */
diff --git a/ACE/apps/JAWS/stress_testing/connection.cpp b/ACE/apps/JAWS/stress_testing/connection.cpp
index c81ae2fba53..5089fe987ac 100644
--- a/ACE/apps/JAWS/stress_testing/connection.cpp
+++ b/ACE/apps/JAWS/stress_testing/connection.cpp
@@ -8,22 +8,22 @@ ACE_RCSID(stress_testing, connection, "$Id$")
int connection::connect(char *hostname_opt_port, int tcp_nodelay, int sockbufsiz) {
if(!hostname_opt_port) return 1;
-
+
char *hostname_with_port;
// Check to see if portnumber is specified in the hostnameport
// If not, append :80
if(!ACE_OS::strchr(hostname_opt_port,':')) {
- hostname_with_port = new char[ACE_OS::strlen(hostname_opt_port) + 3];
- ACE_OS::sprintf(hostname_with_port, "%s:%d", hostname_opt_port, 80);
+ hostname_with_port = new char[ACE_OS::strlen(hostname_opt_port) + 3];
+ ACE_OS::sprintf(hostname_with_port, "%s:%d", hostname_opt_port, 80);
}
else {
hostname_with_port = hostname_opt_port;
}
-
+
// Beyond this point, hostname_with_port is of the form hostname:port
ACE_INET_Addr server_addr(hostname_with_port);
-
+
// Connect to server
ACE_SOCK_Connector con;
@@ -33,34 +33,34 @@ int connection::connect(char *hostname_opt_port, int tcp_nodelay, int sockbufsiz
return 1;
}
-
+
// tcp_nodelay processing.
// turn off weird ack things
if(tcp_nodelay) {
- struct protoent *p = ACE_OS::getprotobyname ("tcp");
+ struct protoent *p = ACE_OS::getprotobyname ("tcp");
int one = 1;
-
+
if (p && stream_.set_option (p->p_proto,
- TCP_NODELAY,
- (char *)& one,
- sizeof (one)))
+ TCP_NODELAY,
+ (char *)& one,
+ sizeof (one)))
{
ACE_OS::perror("tcp_nodelay");
return 1;
}
}
-
- if(sockbufsiz)
+
+ if(sockbufsiz)
if (stream_.set_option (SOL_SOCKET,
- SO_RCVBUF,
- (char *) &sockbufsiz,
- sizeof sockbufsiz) == -1)
+ SO_RCVBUF,
+ (char *) &sockbufsiz,
+ sizeof sockbufsiz) == -1)
{
ACE_OS::perror("socket_queue_size");
return 1;
}
-
+
return 0;
}
@@ -94,7 +94,7 @@ int connection::close(void) {
stream_.close();
return 0;
}
-
+
connection::~connection(void) {
this->close();
}
diff --git a/ACE/apps/JAWS/stress_testing/http_tester.cpp b/ACE/apps/JAWS/stress_testing/http_tester.cpp
index 199bfa33e19..b86dda0605d 100644
--- a/ACE/apps/JAWS/stress_testing/http_tester.cpp
+++ b/ACE/apps/JAWS/stress_testing/http_tester.cpp
@@ -160,11 +160,11 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
while(!feof(fp)) {
- fscanf(fp,"%s %d %f %s %f %s %f %s %f %d %d\n", id, &total_num, &rate, url1, &p1, url2, &p2, url3, &p3, &tcp, &sock);
- if (id[0] == '#') continue;
- ACE_OS::fprintf(stderr,"----\n");
- ACE_OS::fprintf(stderr,"\tNow performing experiment:%s\n\tSending %d requests at %f requests/second\n", id, total_num, rate);
- driver(id, total_num, rate, url1, p1, url2, p2, url3, p3, tcp, sock);
+ fscanf(fp,"%s %d %f %s %f %s %f %s %f %d %d\n", id, &total_num, &rate, url1, &p1, url2, &p2, url3, &p3, &tcp, &sock);
+ if (id[0] == '#') continue;
+ ACE_OS::fprintf(stderr,"----\n");
+ ACE_OS::fprintf(stderr,"\tNow performing experiment:%s\n\tSending %d requests at %f requests/second\n", id, total_num, rate);
+ driver(id, total_num, rate, url1, p1, url2, p2, url3, p3, tcp, sock);
}
ACE_OS::fclose(fp);
ACE_OS::close(fd);
diff --git a/ACE/apps/JAWS2/JAWS/Cache_Hash_T.h b/ACE/apps/JAWS2/JAWS/Cache_Hash_T.h
index f5f050c3801..7b3bd752ea0 100644
--- a/ACE/apps/JAWS2/JAWS/Cache_Hash_T.h
+++ b/ACE/apps/JAWS2/JAWS/Cache_Hash_T.h
@@ -30,7 +30,7 @@ public:
int bind (const EXT_ID &ext_id, JAWS_Cache_Object *const &int_id);
int trybind (const EXT_ID &ext_id, JAWS_Cache_Object *&int_id);
int rebind (const EXT_ID &ext_id, JAWS_Cache_Object *const &int_id,
- EXT_ID &old_ext_id, JAWS_Cache_Object *&old_int_id);
+ EXT_ID &old_ext_id, JAWS_Cache_Object *&old_int_id);
int unbind (const EXT_ID &ext_id);
int unbind (const EXT_ID &ext_id, JAWS_Cache_Object *&int_id);
diff --git a/ACE/apps/JAWS2/JAWS/Hash_Bucket_T.h b/ACE/apps/JAWS2/JAWS/Hash_Bucket_T.h
index f37c959445f..e7da2f6f680 100644
--- a/ACE/apps/JAWS2/JAWS/Hash_Bucket_T.h
+++ b/ACE/apps/JAWS2/JAWS/Hash_Bucket_T.h
@@ -26,10 +26,10 @@ class JAWS_Hash_Bucket_Item
{
public:
JAWS_Hash_Bucket_Item (const EXT_ID &ext_id, const INT_ID &int_id,
- JAWS_Hash_Bucket_Item<EXT_ID, INT_ID> *next = 0,
- JAWS_Hash_Bucket_Item<EXT_ID, INT_ID> *prev = 0);
+ JAWS_Hash_Bucket_Item<EXT_ID, INT_ID> *next = 0,
+ JAWS_Hash_Bucket_Item<EXT_ID, INT_ID> *prev = 0);
JAWS_Hash_Bucket_Item (JAWS_Hash_Bucket_Item<EXT_ID, INT_ID> *next = 0,
- JAWS_Hash_Bucket_Item<EXT_ID, INT_ID> *prev = 0);
+ JAWS_Hash_Bucket_Item<EXT_ID, INT_ID> *prev = 0);
~JAWS_Hash_Bucket_Item (void);
// Destructor.
@@ -170,7 +170,7 @@ public:
// made to bind an existing entry, and returns -1 if failures occur.
int rebind (const EXT_ID &ext_id, const INT_ID &int_id,
- EXT_ID &old_ext_id, INT_ID &old_int_id);
+ EXT_ID &old_ext_id, INT_ID &old_int_id);
// Associate <ext_id> with <int_id>. If <ext_id> is not in the map
// then behaves just like <bind>. Otherwise, store the old values
// of <ext_id> and <int_id> into the "out" parameters and rebind the
diff --git a/ACE/apps/drwho/File_Manager.cpp b/ACE/apps/drwho/File_Manager.cpp
index 945dd952c6b..30df49cf8d7 100644
--- a/ACE/apps/drwho/File_Manager.cpp
+++ b/ACE/apps/drwho/File_Manager.cpp
@@ -85,16 +85,16 @@ File_Manager::open_passwd_file (void)
(pwent = ACE_OS::getpwent ()) != 0; )
if (*pwent->pw_gecos != '\0')
{
- char *cp = ACE_OS::strchr (pwent->pw_gecos, ',');
+ char *cp = ACE_OS::strchr (pwent->pw_gecos, ',');
- if (cp != 0)
- *cp = '\0';
+ if (cp != 0)
+ *cp = '\0';
- ACE_OS::fprintf (fp,
+ ACE_OS::fprintf (fp,
"%-8.8s %s\n",
pwent->pw_name,
pwent->pw_gecos);
- this->number_of_friends++;
+ this->number_of_friends++;
}
ACE_OS::endpwent ();
diff --git a/ACE/apps/drwho/Hash_Table.cpp b/ACE/apps/drwho/Hash_Table.cpp
index 1bbee18dd9c..c8d24860bc9 100644
--- a/ACE/apps/drwho/Hash_Table.cpp
+++ b/ACE/apps/drwho/Hash_Table.cpp
@@ -30,16 +30,13 @@ Hash_Table::get_next_entry (void)
if (this->current_ptr == 0)
{
-
- for (;
- this->current_index < this->hash_table_size;
- this->current_index++)
- if (this->hash_table[this->current_index] != 0)
- {
- Protocol_Record *prp = this->hash_table[this->current_index++];
- this->current_ptr = prp->next_;
- return prp;
- }
+ for (; this->current_index < this->hash_table_size; this->current_index++)
+ if (this->hash_table[this->current_index] != 0)
+ {
+ Protocol_Record *prp = this->hash_table[this->current_index++];
+ this->current_ptr = prp->next_;
+ return prp;
+ }
this->current_index = -1;
return 0;
@@ -70,6 +67,6 @@ Hash_Table::~Hash_Table (void)
for (Protocol_Record *prp = this->hash_table[i];
prp != 0; )
{
- prp = prp->next_;
+ prp = prp->next_;
}
}
diff --git a/ACE/apps/drwho/PMC_All.cpp b/ACE/apps/drwho/PMC_All.cpp
index 7cb6fef01f3..5853051866d 100644
--- a/ACE/apps/drwho/PMC_All.cpp
+++ b/ACE/apps/drwho/PMC_All.cpp
@@ -68,9 +68,9 @@ PMC_All::decode (char *packet, int &packet_length)
char *real_name = cp = (char *) ACE::strend (cp);
for (cp = (char *) ACE::strend (cp);
- *(cp = this->handle_protocol_entries (cp, login_name, real_name)) != '\t';
+ *(cp = this->handle_protocol_entries (cp, login_name, real_name)) != '\t';
)
- continue;
+ continue;
}
return 1;
diff --git a/ACE/apps/drwho/PMC_Flo.cpp b/ACE/apps/drwho/PMC_Flo.cpp
index a05aff01195..2723e715100 100644
--- a/ACE/apps/drwho/PMC_Flo.cpp
+++ b/ACE/apps/drwho/PMC_Flo.cpp
@@ -94,8 +94,8 @@ PMC_Flo::decode (char *packet, int &packet_length)
for (cp = (char *) ACE::strend (cp);
*(cp = this->handle_protocol_entries (cp, login_name)) != '\t';
-)
- continue;
+ )
+ continue;
}
return 1;
diff --git a/ACE/apps/drwho/PMC_Ruser.cpp b/ACE/apps/drwho/PMC_Ruser.cpp
index d5256cafc8f..b969622f8e2 100644
--- a/ACE/apps/drwho/PMC_Ruser.cpp
+++ b/ACE/apps/drwho/PMC_Ruser.cpp
@@ -69,7 +69,7 @@ PMC_Ruser::decode (char *packet, int &packet_length)
for (cp = (char *) ACE::strend (cp);
*(cp = this->handle_protocol_entries (cp, host_name)) != '\t'; )
- continue;
+ continue;
}
return 1;
@@ -138,36 +138,36 @@ PMC_Ruser::process (void)
prp->get_host ()));
for (Drwho_Node *np = prp->get_drwho_list (); ;)
- {
- ACE_DEBUG ((LM_DEBUG,
+ {
+ ACE_DEBUG ((LM_DEBUG,
"%s",
(np->*get_name) ()));
- if (np->get_inactive_count () != 0)
- {
- if (np->get_active_count () != 0)
- ACE_DEBUG ((LM_DEBUG,
+ if (np->get_inactive_count () != 0)
+ {
+ if (np->get_active_count () != 0)
+ ACE_DEBUG ((LM_DEBUG,
"*(%d)",
np->get_active_count ()));
- }
- else if (np->get_active_count () > 1)
- ACE_DEBUG ((LM_DEBUG,
+ }
+ else if (np->get_active_count () > 1)
+ ACE_DEBUG ((LM_DEBUG,
"*(%d)",
np->get_active_count ()));
- else if (np->get_active_count () == 1)
+ else if (np->get_active_count () == 1)
ACE_DEBUG ((LM_DEBUG,
"*"));
np = np->next_;
- if (np == 0)
- break;
- else if (Options::get_opt (Options::PRINT_LOGIN_NAME))
+ if (np == 0)
+ break;
+ else if (Options::get_opt (Options::PRINT_LOGIN_NAME))
ACE_DEBUG ((LM_DEBUG,
" "));
- else
+ else
ACE_DEBUG ((LM_DEBUG,
", "));
- }
+ }
ACE_DEBUG ((LM_DEBUG,
"\n"));
diff --git a/ACE/apps/drwho/PMC_Usr.cpp b/ACE/apps/drwho/PMC_Usr.cpp
index a31edb5e7c6..6ccbf4ffba2 100644
--- a/ACE/apps/drwho/PMC_Usr.cpp
+++ b/ACE/apps/drwho/PMC_Usr.cpp
@@ -66,7 +66,7 @@ PMC_Usr::decode (char *packet, int &packet_length)
for (cp = (char *) ACE::strend (cp);
*(cp = this->handle_protocol_entries (cp, login_name)) != '\t';
)
- continue;
+ continue;
}
return 1;
@@ -86,28 +86,28 @@ PMC_Usr::process (void)
// First try to get a login session that is active...
for (; np != 0; np = np->next_)
- if (np->active_count_ > 0)
- {
- ACE_DEBUG ((LM_DEBUG,
+ if (np->active_count_ > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
"%s ",
np->get_host_name ()));
- if (Options::get_opt (Options::USE_VERBOSE_FORMAT) == 0)
- return;
- }
+ if (Options::get_opt (Options::USE_VERBOSE_FORMAT) == 0)
+ return;
+ }
for (np = prp->get_drwho_list ();
np != 0;
np = np->next_)
- if (np->active_count_ == 0)
- {
- ACE_DEBUG ((LM_DEBUG,
+ if (np->active_count_ == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
"%s ",
np->get_host_name ()));
- if (Options::get_opt (Options::USE_VERBOSE_FORMAT) == 0)
- return;
- }
+ if (Options::get_opt (Options::USE_VERBOSE_FORMAT) == 0)
+ return;
+ }
}
}
diff --git a/ACE/apps/drwho/PMS_Ruser.cpp b/ACE/apps/drwho/PMS_Ruser.cpp
index e1d4c42cb8c..815186b409f 100644
--- a/ACE/apps/drwho/PMS_Ruser.cpp
+++ b/ACE/apps/drwho/PMS_Ruser.cpp
@@ -99,7 +99,7 @@ PMS_Ruser::insert_protocol_info (Protocol_Record &protocol_record)
: ACE::strnew (pwent->pw_gecos)),
',');
if (cp != 0)
- *cp = '\0';
+ *cp = '\0';
}
if (current_node->get_idle_time () >= MAX_USER_TIMEOUT)
diff --git a/ACE/apps/drwho/PM_Client.cpp b/ACE/apps/drwho/PM_Client.cpp
index 216cb6e5368..d794db28e78 100644
--- a/ACE/apps/drwho/PM_Client.cpp
+++ b/ACE/apps/drwho/PM_Client.cpp
@@ -69,35 +69,35 @@ PM_Client::process (void)
(prp->*get_name) ()));
for (Drwho_Node *np = prp->get_drwho_list (); ;)
- {
- ACE_DEBUG ((LM_DEBUG,
+ {
+ ACE_DEBUG ((LM_DEBUG,
np->get_host_name (),
stdout));
- active_friends += np->get_active_count ();
+ active_friends += np->get_active_count ();
- if (np->get_inactive_count () != 0)
- {
- if (np->get_active_count () != 0)
- ACE_DEBUG ((LM_DEBUG,
+ if (np->get_inactive_count () != 0)
+ {
+ if (np->get_active_count () != 0)
+ ACE_DEBUG ((LM_DEBUG,
"*(%d)",
np->get_active_count ()));
- }
- else if (np->get_active_count () > 1)
- ACE_DEBUG ((LM_DEBUG,
+ }
+ else if (np->get_active_count () > 1)
+ ACE_DEBUG ((LM_DEBUG,
"*(%d)",
np->get_active_count ()));
- else if (np->get_active_count () == 1)
- ACE_DEBUG ((LM_DEBUG,
+ else if (np->get_active_count () == 1)
+ ACE_DEBUG ((LM_DEBUG,
"*"));
np = np->next_;
- if (np == 0)
- break;
- else
+ if (np == 0)
+ break;
+ else
ACE_DEBUG ((LM_DEBUG,
" "));
- }
+ }
ACE_DEBUG ((LM_DEBUG,
"]\n"));
diff --git a/ACE/apps/drwho/Rwho_DB_Manager.cpp b/ACE/apps/drwho/Rwho_DB_Manager.cpp
index 5197322feaf..cbff70bfb20 100644
--- a/ACE/apps/drwho/Rwho_DB_Manager.cpp
+++ b/ACE/apps/drwho/Rwho_DB_Manager.cpp
@@ -81,7 +81,7 @@ RWho_DB_Manager::get_next_host (void)
ACE_OS::open (dir_ptr->d_name, O_RDONLY);
if (user_file < 0)
- return -1;
+ return -1;
int host_data_length =
ACE_OS::read (user_file,
@@ -90,14 +90,14 @@ RWho_DB_Manager::get_next_host (void)
if (host_data_length > WHOD_HEADER_SIZE
&& current_time - this->host_data.wd_recvtime < MAX_HOST_TIMEOUT)
- {
- this->current_user = 0;
- this->number_of_users = (host_data_length - WHOD_HEADER_SIZE) / sizeof *this->host_data.wd_we;
- ACE_OS::close (user_file);
- return 1; // We found a good host, so return it.
- }
+ {
+ this->current_user = 0;
+ this->number_of_users = (host_data_length - WHOD_HEADER_SIZE) / sizeof *this->host_data.wd_we;
+ ACE_OS::close (user_file);
+ return 1; // We found a good host, so return it.
+ }
else
- ACE_OS::close (user_file);
+ ACE_OS::close (user_file);
}
// There are no more hosts, so return False.
diff --git a/ACE/apps/gperf/src/Gen_Perf.cpp b/ACE/apps/gperf/src/Gen_Perf.cpp
index 4f62eaecfae..548f19ab137 100644
--- a/ACE/apps/gperf/src/Gen_Perf.cpp
+++ b/ACE/apps/gperf/src/Gen_Perf.cpp
@@ -354,8 +354,8 @@ Gen_Perf::compute_perfect_hash (void)
this->hash (curr);
for (List_Node *ptr = this->key_list.head;
- ptr != curr;
- ptr = ptr->next)
+ ptr != curr;
+ ptr = ptr->next)
if (ptr->hash_value == curr->hash_value)
{
if (this->change (ptr, curr) == -1)
@@ -415,12 +415,12 @@ Gen_Perf::run (void)
else if (option[LINEARSEARCH])
{
if (this->compute_linear_search () == -1)
- return 1;
+ return 1;
}
else
{
if (this->compute_perfect_hash () == -1)
- return 1;
+ return 1;
// Sorts the key word list by hash value, and then outputs the
// list. The generated hash table code is only output if the