diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-10-11 15:10:34 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-10-11 15:10:34 +0000 |
commit | 23111468052a9f4ec607b9b10123f62004348216 (patch) | |
tree | f81e272d0159b645be87a876da75ae4911e4dfaa /apps/JAWS/clients/Caching | |
parent | d71e1419e3c009e237fec7a91e832be8fc0fe31a (diff) | |
download | ATCD-TAO-1_0_6.tar.gz |
This commit was manufactured by cvs2svn to create tag 'TAO-1_0_6'.TAO-1_0_6
Diffstat (limited to 'apps/JAWS/clients/Caching')
26 files changed, 0 insertions, 3175 deletions
diff --git a/apps/JAWS/clients/Caching/Caching.dsp b/apps/JAWS/clients/Caching/Caching.dsp deleted file mode 100644 index 3bbc59cca79..00000000000 --- a/apps/JAWS/clients/Caching/Caching.dsp +++ /dev/null @@ -1,111 +0,0 @@ -# Microsoft Developer Studio Project File - Name="http_client" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=http_client - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "Caching.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "Caching.mak" CFG="http_client - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "http_client - Win32 Release" (based on\
- "Win32 (x86) Console Application")
-!MESSAGE "http_client - Win32 Debug" (based on\
- "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "http_client - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\http_client\Release"
-# PROP BASE Intermediate_Dir ".\http_client\Release"
-# PROP BASE Target_Dir ".\http_client"
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "."
-# PROP Intermediate_Dir ".\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ".\http_client"
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\ace"
-
-!ELSEIF "$(CFG)" == "http_client - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\http_client\Debug"
-# PROP BASE Intermediate_Dir ".\http_client\Debug"
-# PROP BASE Target_Dir ".\http_client"
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "."
-# PROP Intermediate_Dir ".\Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ".\http_client"
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
-# ADD LINK32 aced.lib /nologo /subsystem:console /debug /machine:I386 /libpath:"..\..\..\..\ace"
-
-!ENDIF
-
-# Begin Target
-
-# Name "http_client - Win32 Release"
-# Name "http_client - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\http_client.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\http_handler.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=.\http_handler.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/apps/JAWS/clients/Caching/Caching.dsw b/apps/JAWS/clients/Caching/Caching.dsw deleted file mode 100644 index b1fb6547d22..00000000000 --- a/apps/JAWS/clients/Caching/Caching.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "http_client"=.\Caching.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/apps/JAWS/clients/Caching/ID_Generator.cpp b/apps/JAWS/clients/Caching/ID_Generator.cpp deleted file mode 100644 index 6e868611835..00000000000 --- a/apps/JAWS/clients/Caching/ID_Generator.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// $Id$ - -#if !defined (ACE_ID_GENERATOR_C) -#define ACE_ID_GENERATOR_C - -#include "ace/Object_Manager.h" -#include "ID_Generator.h" - -ACE_RCSID(Caching, ID_Generator, "$Id$") - -time_t ACE_ID_Generator::last_time_ = 0; - -size_t ACE_ID_Generator::last_number_ = 0; - -ACE_SYNCH_MUTEX *ACE_ID_Generator::lock_ = 0; - -char * -ACE_ID_Generator::get_new_id (char *id) -{ - time_t t; - size_t sn; - - 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; -} - -void -ACE_ID_Generator::get_serial_id (time_t &t, size_t &s) -{ - ACE_MT (ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, *ACE_ID_Generator::get_lock ())); - ACE_OS::time (&t); - - if (t != ACE_ID_Generator::last_time_) - { - ACE_ID_Generator::last_time_ = t; - s = ACE_ID_Generator::last_number_ = 0; - } - else - s = ACE_ID_Generator::last_number_++; -} - -ACE_SYNCH_MUTEX * -ACE_ID_Generator::get_lock (void) -{ -#if defined (ACE_HAS_THREADS) - if (ACE_ID_Generator::lock_ == 0) - { - ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance (), 0)); - - // Double-checked Locking Optimization. - if (ACE_ID_Generator::lock_ == 0) - ACE_NEW_RETURN (ACE_ID_Generator::lock_, ACE_SYNCH_MUTEX, 0); - } -#endif /* ACE_HAS_THREADS */ - return ACE_ID_Generator::lock_; -} - -#endif /* ACE_ID_GENERATOR_C */ diff --git a/apps/JAWS/clients/Caching/ID_Generator.h b/apps/JAWS/clients/Caching/ID_Generator.h deleted file mode 100644 index 3c02779f36e..00000000000 --- a/apps/JAWS/clients/Caching/ID_Generator.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// none -// -// = FILENAME -// ID_Generator.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#ifndef ACE_ID_GENERATOR_H -#define ACE_ID_GENERATOR_h - -#include "ace/Synch.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#define ACE_OFFER_ID_LENGTH 21 - -class ACE_ID_Generator - // = TITLE - // An unique ID generator. - // - // = DESCRIPTION - - // Generate an offer ID according to current time and avoid - // duplicate ID. It guarantees ID uniqueness within a process, - // i.e. no two threads may get the same ID string. Using a - // similar method like the backery algorithm. -{ -public: - static char *get_new_id (char *id); - // allocate a new ID string and point <id> to it. - -private: - static void get_serial_id (time_t &t, size_t &s); - // Atomically get info required to generate an offer ID. - - static ACE_SYNCH_MUTEX *get_lock (void); - // Get the lock instance. - - static time_t last_time_; - // Record the time last offer ID generated. - - static size_t last_number_; - // Record serial number of last offer ID with same - // generation time. - - static ACE_SYNCH_MUTEX *lock_; - // mutex to access private member. -}; - -#endif /* ACE_ID_GENERATOR_H */ diff --git a/apps/JAWS/clients/Caching/Local_Locator.cpp b/apps/JAWS/clients/Caching/Local_Locator.cpp deleted file mode 100644 index 5c084bd783a..00000000000 --- a/apps/JAWS/clients/Caching/Local_Locator.cpp +++ /dev/null @@ -1,257 +0,0 @@ -// $Id$ - -#if !defined (ACE_LOCAL_LOCATOR_C) -#define ACE_LOCAL_LOCATOR_C - -#include "Local_Locator.h" - -#if !defined (__ACE_INLINE__) -#include "Local_Locator.i" -#endif /* __ACE_INLINE__ */ - -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) -{ - ACE_URL_Record *item = 0; - - ACE_NEW_RETURN (offer, ACE_URL_Offer_Seq (how_many), -1); - - if (how >= ACE_URL_Locator::INVALID_SELECTION) - { - errno = ACE_URL_Locator::INVALID_ARGUMENT; - return -1; - } - - num_query = 0; - for (ACE_Unbounded_Set_Iterator<ACE_URL_Record> iter (this->repository_); - iter.next (item) != 0; - iter.advance ()) - { - size_t i_query; - size_t i_db; - int found = 0; - - // Now this is a stupid implementation. Perhaps we can - // 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) - ; - - // if match and Some, copy to <offer>, inc <num_query>, advance iterator - - // else if All, advance iterator - - // 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 (num_query == how_many) - break; - } - - return 0; -} - -int -ACE_URL_Local_Locator::export_offer (ACE_URL_Offer *offer, - ACE_WString &offer_id) -{ - ACE_URL_Record *item = 0; - - // First check if we have registered this URL already. - for (ACE_Unbounded_Set_Iterator<ACE_URL_Record> iter (this->repository_); - iter.next (item) != 0; - iter.advance ()) - if (*item->offer_->url () == *offer->url ()) - { - 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); - - this->repository_.push (*new_offer); - - offer_id = *new_offer->id_; - return 0; -} - -int -ACE_URL_Local_Locator::withdraw_offer (const ACE_WString &offer_id) -{ - ACE_URL_Record *item = 0; - - // Iterate thru repository and remove offer with <offer_id>. - for (ACE_Unbounded_Set_Iterator<ACE_URL_Record> iter (this->repository_); - 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; - } - } - - errno = ACE_URL_Locator::NO_SUCH_OFFER; - return 0; -} - -int -ACE_URL_Local_Locator::describe_offer (const ACE_WString &offer_id, - ACE_URL_Offer *offer) -{ - ACE_URL_Record *item = 0; - - // Iterate thru the repository and produce a copy of offer's - // description. - for (ACE_Unbounded_Set_Iterator<ACE_URL_Record> iter (this->repository_); - iter.next (item) != 0; - iter.advance ()) - if (offer_id == *item->id_) - { - ACE_NEW_RETURN (offer, ACE_URL_Offer (*item->offer_), -1); - return 0; - } - - errno = ACE_URL_Locator::NO_SUCH_OFFER; - return -1; -} - -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) -{ - ACE_Unbounded_Set_Iterator<ACE_URL_Record> iter (this->repository_); - ACE_URL_Record *item = 0; - ACE_URL_Record *target = 0; - - // Errno Checking - - for (; iter.next (item) != 0; iter.advance ()) - { - if (url != 0 && *url == item->offer_->url ()) - { - errno = ACE_URL_Locator::OFFER_EXIST; - return -1; - } - if (offer_id == *item->id_) - 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]; - } - } - } - - // 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]; - - if (url != 0) - item->offer_->url (url->fast_rep ()); // replace URL location. - return 0; - } - errno = ACE_URL_Locator::NO_SUCH_OFFER; - return -1; -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Unbounded_Set<ACE_URL_Record>; -template class ACE_Unbounded_Set_Iterator<ACE_URL_Record>; -template class ACE_Node<ACE_URL_Record>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Unbounded_Set<ACE_URL_Record> -#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_URL_Record> -#pragma instantiate ACE_Node<ACE_URL_Record> -#endif /*ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* ACE_LOCAL_LOCATOR_C */ diff --git a/apps/JAWS/clients/Caching/Local_Locator.h b/apps/JAWS/clients/Caching/Local_Locator.h deleted file mode 100644 index 36969e6cb2c..00000000000 --- a/apps/JAWS/clients/Caching/Local_Locator.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// none -// -// = FILENAME -// Local_Locator.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#ifndef ACE_LOCAL_LOCATOR_H -#define ACE_LOCAL_LOCATOR_H - -#include "URL_Locator.h" -#include "ace/Containers.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ID_Generator.h" - -class ACE_Svc_Export ACE_URL_Record - // = TITLE - // A URL Record. - // - // = DESCRIPTION - // A record placed in URL repository. Notice that - // both member pointers are own by URL_Record. - // They will get deallocated when the object goes - // out of scope. -{ - friend class ACE_URL_Local_Locator; - friend class ACE_Node<ACE_URL_Record>; - // We are making ACE_Node as friend class because we don't want - // others to access default constructor and pushing in an invalid - // record. However, container classes need to use default constructor - // for its head record. -public: - ACE_URL_Record (ACE_URL_Offer *offer); - // ctor. - - ~ACE_URL_Record (void); - // dtor. - - int operator== (const ACE_URL_Record &rhs) const; - // Two records are equal if they have the same offer id. - - int operator!= (const ACE_URL_Record &rhs) const; - // Unequal, complement of equal. - -private: - ACE_URL_Record (void); - // Default ctor. This is put here to prevent users from - // pushing in an invalid record. - - ACE_WString *id_; - // Offer ID in the repository. - - ACE_URL_Offer *offer_; - // Offer (and its properties). -}; - -class ACE_Svc_Export ACE_URL_Local_Locator - // = TITLE - // A simple URL repository to store URL offer locally. - // - // = DESCRIPTION - // This class manage a collection of URL offers - // for local query and registration. But we should - // really use it within a server. -{ - virtual ~ACE_URL_Local_Locator (void); - // Default destructor. - - virtual int 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); - // Query the locator for HTTP with designate properties (none, some, - // or all). The locator being queried will return a sequence of - // offers with <how_many> offers in it. This interface allocates - // <offer> so users must deallocate it after use. - - virtual int export_offer (ACE_URL_Offer *offer, - ACE_WString &offer_id); - // Export an offer to the locator. - - virtual int withdraw_offer (const ACE_WString &offer_id); - // Withdraw an offer. return 0 if succeed, -1 otherwise. - - virtual int describe_offer (const ACE_WString &offer_id, - ACE_URL_Offer *offer); - // Query a specific offer. - - virtual int modify_offer (const ACE_WString &offer_id, - const ACE_WString *url = 0, - const ACE_URL_Property_Seq *del = 0, - const ACE_URL_Property_Seq *modify = 0); - // Modify a previously registered offer. - -protected: - ACE_Unbounded_Set<ACE_URL_Record> repository_; -}; - -#if defined (__ACE_INLINE__) -#include "Local_Locator.i" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_LOCAL_LOCATOR_H */ diff --git a/apps/JAWS/clients/Caching/Local_Locator.i b/apps/JAWS/clients/Caching/Local_Locator.i deleted file mode 100644 index 1d693472eb8..00000000000 --- a/apps/JAWS/clients/Caching/Local_Locator.i +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -ACE_INLINE -ACE_URL_Record::ACE_URL_Record (void) - : id_ (0), - offer_ (0) -{ -} - -ACE_INLINE -ACE_URL_Record::ACE_URL_Record (ACE_URL_Offer *offer) - : offer_ (offer) -{ - char buf[ACE_OFFER_ID_LENGTH]; - - ACE_NEW (this->id_, ACE_WString (ACE_ID_Generator::get_new_id (buf))); -} - -ACE_INLINE -ACE_URL_Record::~ACE_URL_Record (void) -{ - delete this->id_; - delete this->offer_; -} - -ACE_INLINE int -ACE_URL_Record::operator== (const ACE_URL_Record &rhs) const -{ - return this == &rhs || *this->id_ == *rhs.id_; -} - -ACE_INLINE int -ACE_URL_Record::operator!= (const ACE_URL_Record &rhs) const -{ - return !(*this == rhs); -} - -ACE_INLINE -ACE_URL_Local_Locator::~ACE_URL_Local_Locator (void) -{ -} - diff --git a/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp b/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp deleted file mode 100644 index 6f7a7898e59..00000000000 --- a/apps/JAWS/clients/Caching/Locator_Request_Reply.cpp +++ /dev/null @@ -1,459 +0,0 @@ -// $Id$ - -#if !defined (ACE_LOCATOR_REQUEST_REPLY_C) -#define ACE_LOCATOR_REQUEST_REPLY_C - -#include "Locator_Request_Reply.h" - -#if !defined (__ACE_INLINE__) -#include "Locator_Request_Reply.i" -#endif - -#include "ace/Auto_Ptr.h" -#include "URL_Properties.h" -#include "URL_Array_Helper.h" -#include "URL_Locator.h" - -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) -{ - ACE_TRACE ("ACE_URL_Locator_Request::url_query"); - - if (how >= ACE_URL_Locator::INVALID_SELECTION) - return -1; - ACE_NEW_RETURN (this->seq1_, ACE_URL_Property_Seq (pseq), -1); - this->how_ = how; - this->how_many_ = how_many; - this->code_ = ACE_URL_Locator::QUERY; - 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) -{ - ACE_TRACE ("ACE_URL_Locator_Request::withdraw_offer"); - - this->id_ = offer_id; - this->code_ = ACE_URL_Locator::WITHDRAW; - return 0; -} - -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; -} - -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) -{ - ACE_TRACE ("ACE_URL_Locator_Request::modify_offer"); - - ACE_NEW_RETURN (this->seq1_, ACE_URL_Property_Seq (del), -1); - ACE_NEW_RETURN (this->seq2_, ACE_URL_Property_Seq (modify), -1); - - if (url != 0) - this->url_ = *url; - - this->id_ = offer_id; - this->code_ = ACE_URL_Locator::MODIFY; - return 0; -} - -#define ENCODE_UINT32(ADDR,LEN,V) \ - * (ACE_UINT32 *) (ADDR+LEN) = htonl (V); \ - LEN += sizeof (ACE_UINT32); - -#define DECODE_UINT32(ADDR,LEN,V) \ - V = ntohl (* (ACE_UINT32 *) (ADDR+LEN)); \ - LEN += sizeof (ACE_UINT32); - -size_t -ACE_URL_Locator_Request::encode (void) -{ - ACE_TRACE ("ACE_URL_Locator_Request::encode"); - - size_t buf_size = this->size (); - size_t total_length = 0; - - ACE_NEW_RETURN (this->buffer_, char [buf_size], 0); - - ENCODE_UINT32 (this->buffer_, total_length, buf_size); - // Encode buffer size. - - ENCODE_UINT32 (this->buffer_, total_length, this->code_); - // Encode Op code. - - 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. - - ENCODE_UINT32 (this->buffer_, total_length, this->valid_ptr_); - // Encode valide pointer flag. - - if (this->seq1_ != 0) - { - ENCODE_UINT32 (this->buffer_, total_length, this->seq1_->size ()); - total_length += ace_array_encode (this->buffer_ + total_length, *this->seq1_); - } - if (this->seq2_ != 0) - { - ENCODE_UINT32 (this->buffer_, total_length, this->seq2_->size ()); - total_length += ace_array_encode (this->buffer_ + total_length, *this->seq2_); - } - if (this->offer_ != 0) - total_length += this->offer_->encode (this->buffer_ + total_length); - - total_length += ACE_WString_Helper::encode (this->buffer_ + total_length, - this->id_); - total_length += ACE_WString_Helper::encode (this->buffer_ + total_length, - this->url_); - - ACE_ASSERT (total_length == buf_size); - return total_length; -} - -size_t -ACE_URL_Locator_Request::decode (void *buffer) -{ - ACE_TRACE ("ACE_URL_Locator_Request::decode"); - - if (buffer == 0) - return 0; - // Check if we have a valid buffer available. - - char *cbuffer = (char *) 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. - - DECODE_UINT32 (cbuffer, total_length, this->valid_ptr_); - // Decode valide pointer flag. - - if ((this->valid_ptr_ & VALID_SEQ1) != 0) - { - size_t n; - DECODE_UINT32 (cbuffer, total_length, n); - ACE_NEW_RETURN (this->seq1_, ACE_URL_Property_Seq (n), 0); - total_length += ace_array_decode (cbuffer + total_length, *this->seq1_); - } - if ((this->valid_ptr_ & VALID_SEQ2) != 0) - { - size_t n; - DECODE_UINT32 (cbuffer, total_length, n); - ACE_NEW_RETURN (this->seq2_, ACE_URL_Property_Seq (n), 0); - total_length += ace_array_decode (cbuffer + total_length, *this->seq2_); - } - if ((this->valid_ptr_ & VALID_OFFER) != 0) - { - 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)); - total_length += ACE_WString_Helper::decode (cbuffer + total_length); - - ACE_ASSERT (total_length == buf_size); - return total_length; -} - - -size_t -ACE_URL_Locator_Request::size (void) -{ - ACE_TRACE ("ACE_URL_Locator_Request::size"); - - size_t total_length = 5 * sizeof (ACE_UINT32); - // There are 5 UINT32 variables at the beginning - // of the buffer. <buffer size>, <code>, <how>, - // <how_many>, <valid_ptr>. - - this->valid_ptr_ = 0; - // Check valid pointers and mark corresponding flag in <valid_prt>. - - if (this->seq1_ != 0) - { - this->valid_ptr_ |= VALID_SEQ1; - total_length += ace_array_size (*this->seq1_); - } - if (this->seq2_ != 0) - { - this->valid_ptr_ |= VALID_SEQ2; - total_length += ace_array_size (*this->seq2_); - } - if (this->offer_ != 0) - { - 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_); - - return total_length; -} - -void -ACE_URL_Locator_Request::dump (void) const -{ - //ACE_TRACE ("ACE_URL_Locator_Request::dump"); - - size_t i; - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - if (this->code_ < ACE_URL_Locator::INVALID_OPERATION) - ACE_DEBUG ((LM_DEBUG, "%s Request:\n", ACE_URL_Locator::opname[this->code_])); - else - ACE_DEBUG ((LM_DEBUG, "Invalid Operation: %d\n", this->code_)); - - if (this->how_ < ACE_URL_Locator::INVALID_SELECTION) - ACE_DEBUG ((LM_DEBUG, "Select: %s\n", ACE_URL_Locator::selection_name[this->how_])); - else - ACE_DEBUG ((LM_DEBUG, "Invalid selection method: %d\n", this->how_)); - - ACE_DEBUG ((LM_DEBUG, "At most %d reply.\n", this->how_many_)); - - ACE_DEBUG ((LM_DEBUG, "Valid pointer pattern: %x\n", this->valid_ptr_)); - - ACE_DEBUG ((LM_DEBUG, "Property sequence 1: %x\n", this->seq1_)); - if (this->seq1_ != 0) - for (i = 0; i < this->seq1_->size (); i++) - (*this->seq1_)[i].dump (); - - ACE_DEBUG ((LM_DEBUG, "Property sequence 2: %x\n", this->seq2_)); - if (this->seq2_ != 0) - for (i = 0; i < this->seq2_->size (); i++) - (*this->seq2_)[i].dump(); - - ACE_DEBUG ((LM_DEBUG, "Offer: %x\n", this->offer_)); - if (this->offer_ != 0) - this->offer_->dump (); - - if (this->id_.length () > 0) - ACE_DEBUG ((LM_DEBUG, "Offer ID: %s\n", - 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 ())); - else - ACE_DEBUG ((LM_DEBUG, "URL: \"\"\n")); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -int -ACE_URL_Locator_Reply::status_reply (u_int op, int result) -{ - ACE_TRACE ("ACE_URL_Locator_Reply::status_reply"); - - this->code_ = op; - this->status_ = result; - return 0; -} - -int -ACE_URL_Locator_Reply::query_reply (int result, size_t num, - 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); - return 0; -} - -int -ACE_URL_Locator_Reply::describe_reply (int result, - const ACE_URL_Offer &offer) -{ - ACE_TRACE ("ACE_URL_Locator_Reply::describe_reply"); - - this->code_ = ACE_URL_Locator::DESCRIBE; - this->status_ = result; - ACE_NEW_RETURN (this->offer_, ACE_URL_Offer (offer), -1); - return 0; -} - -size_t -ACE_URL_Locator_Reply::encode (void) -{ - ACE_TRACE ("ACE_URL_Locator_Reply::encode"); - - size_t buf_size = this->size (); - size_t total_length = 0; - - ACE_NEW_RETURN (this->buffer_, char [buf_size], 0); - - ENCODE_UINT32 (this->buffer_, total_length, buf_size); - // Encode buffer size. - - ENCODE_UINT32 (this->buffer_, total_length, this->code_); - // Encode Op code. - - ENCODE_UINT32 (this->buffer_, total_length, this->status_); - // Encode Op result status. - - ENCODE_UINT32 (this->buffer_, total_length, this->num_offers_); - // Encode number of offers in this->offers_. - - ENCODE_UINT32 (this->buffer_, total_length, this->valid_ptr_); - // Encode valid pointers mask. - - if (this->offer_ != 0) - total_length += this->offer_->encode (this->buffer_ + total_length); - - if (this->offers_ != 0) - { - ENCODE_UINT32 (this->buffer_, total_length, this->offers_->size ()); - total_length += ace_array_encode (this->buffer_ + total_length, *this->offers_); - } - - ACE_ASSERT (total_length == buf_size); - return 0; -} - -size_t -ACE_URL_Locator_Reply::decode (void *buffer) -{ - ACE_TRACE ("ACE_URL_Locator_Reply::decode"); - - if (buffer == 0) - return 0; - // Check if we have a buffer available. - - char *cbuffer = (char *) buffer; - - size_t buf_size; - size_t total_length = 0; - - DECODE_UINT32 (cbuffer, total_length, buf_size); - // Get the length of the buffer first. - - DECODE_UINT32 (cbuffer, total_length, this->code_); - // Decode Op code. - - DECODE_UINT32 (cbuffer, total_length, this->status_); - // Decode Op result status. - - DECODE_UINT32 (cbuffer, total_length, this->num_offers_); - // Decode number of offers in this->offers_. - - DECODE_UINT32 (cbuffer, total_length, this->valid_ptr_); - // Decode valid pointers mask. - - if ((this->valid_ptr_ & VALID_OFFER) != 0) - { - ACE_NEW_RETURN (this->offer_, ACE_URL_Offer, 0); - total_length += this->offer_->decode (cbuffer + total_length); - } - - if ((this->valid_ptr_ & VALID_OFFERS) != 0) - { - size_t n; - DECODE_UINT32 (cbuffer, total_length, n); - 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) -{ - ACE_TRACE ("ACE_URL_Locator_Reply:size"); - - size_t total_length = 5 * sizeof (ACE_UINT32); - // size for 5 ACE_UINT32 objects: <buffer size>, <code_>, - // <status_>, <num_offers_>, and <valid_ptr_>. - - this->valid_ptr_ = 0; - if (this->offer_ != 0) - { - this->valid_ptr_ |= VALID_OFFER; - total_length += this->offer_->size (); - } - if (this->offers_ != 0) - { - this->valid_ptr_ |= VALID_OFFERS; - total_length += ace_array_size (*this->offers_); - } - return total_length; -} - -void -ACE_URL_Locator_Reply::dump (void) const -{ - //ACE_TRACE ("ACE_URL_Locator_Reply::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - if (this->code_ < ACE_URL_Locator::INVALID_OPERATION) - ACE_DEBUG ((LM_DEBUG, "Original request: %s\n", ACE_URL_Locator::opname[this->code_])); - else - ACE_DEBUG ((LM_DEBUG, "Invalid Original Request: %d\n", this->code_)); - - if (this->status_ < ACE_URL_Locator::MAX_URL_ERROR) - ACE_DEBUG ((LM_DEBUG, "Reply status: %s\n", ACE_URL_Locator::err_name[this->status_])); - else - ACE_DEBUG ((LM_DEBUG, "Invalid reply status: %d\n", this->status_)); - - ACE_DEBUG ((LM_DEBUG, "Number of offers: %d\n", this->num_offers_)); - - ACE_DEBUG ((LM_DEBUG, "Valid pointer pattern: %x\n", this->valid_ptr_)); - - ACE_DEBUG ((LM_DEBUG, "Offer: %x\n", this->offer_)); - if (this->offer_ != 0) - this->offer_->dump (); - - ACE_DEBUG ((LM_DEBUG, "Offer sequence: %x\n", this->offers_)); - if (this->offers_ != 0) - for (size_t i = 0; i < this->offers_->size (); i++) - (*this->offers_)[i].dump(); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} -#endif /* ACE_LOCATOR_REQUEST_REPLY_C */ diff --git a/apps/JAWS/clients/Caching/Locator_Request_Reply.h b/apps/JAWS/clients/Caching/Locator_Request_Reply.h deleted file mode 100644 index 057607c351d..00000000000 --- a/apps/JAWS/clients/Caching/Locator_Request_Reply.h +++ /dev/null @@ -1,220 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// none -// -// = FILENAME -// Locator_Request_Response.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#ifndef ACE_LOCATOR_REQUEST_REPLY_H -#define ACE_LOCATOR_REQUEST_REPLY_H - -#include "URL_Properties.h" - -class ACE_Svc_Export ACE_URL_Locator_Request - // = TITLE - // A URL request message formater/wrapper. - // - // = DESCRIPTION - // This class defines a URL request data. It is used - // to transform requests to an object so that we can - // ship them across network. -{ -public: - ACE_URL_Locator_Request (void); - // Default ctor. - - ~ACE_URL_Locator_Request (void); - // Default dtor. - - int url_query (const int how, - const ACE_URL_Property_Seq &pseq, - const int how_many); - // Query the locator for HTTP with designate properties (none, some, - // or all). The locator being queried will return a sequence of - // offers with <how_many> offers in it. This interface allocates - // <offer> so users must deallocate it after use. - - int export_offer (const ACE_URL_Offer &offer); - // Export an offer to the locator. - - int withdraw_offer (const ACE_WString &offer_id); - // Withdraw an offer. return 0 if succeed, -1 otherwise. - - int describe_offer (const ACE_WString &offer_id); - // Query a specific offer. - - int modify_offer (const ACE_WString &offer_id, - const char *url = 0, - const ACE_URL_Property_Seq &del = 0, - const ACE_URL_Property_Seq &modify = 0); - // Modify a previously registered offer. - - int modify_offer (const ACE_WString &offer_id, - const ACE_WString *url = 0, - const ACE_URL_Property_Seq &del = 0, - const ACE_URL_Property_Seq &modify = 0); - // Modify a previously registered offer. - - size_t encode (void); - // Encode request for network communication. If succeed, - // returns the size of the buffer, otherwise, return 0. - - size_t decode (void *buffer); - // Restore from network data. Returns size of the buffer - // if succeed, 0 otherwise. When passing in a buffer, - // caller must take the responsibility to delete the buffer - // afterward, if so needed. - - const int how (void) const; - const int how_many (void) const; - const u_int opcode (void) const; - const ACE_URL_Property_Seq *seq (void) const; - const ACE_URL_Property_Seq *del (void) const; - const ACE_URL_Property_Seq *modify (void) const; - const ACE_URL_Offer *offer (void) const; - const ACE_WString &id (void) const; - const ACE_WString &url (void) const; - const char *buffer (void) const; - // A bunch of methods to access internal data. - - void dump (void) const; - // Print out this object. - -protected: - size_t size (void); - // Return the size of the buffer required to encode - // this request. - - enum { - VALID_SEQ1 = 0x1, - VALID_SEQ2 = 0X2, - VALID_OFFER = 0X4 - }; - // These constants used to indicate which pointers are valid. - - u_int code_; - // Request type code. - - int how_; - // Query method (if code_ == QUERY.) - - int how_many_; - // How many offers are we interested in in this query. - - int valid_ptr_; - // Bit flag to mark valid pointers within this object. - - ACE_URL_Property_Seq *seq1_; - // For query or del in modify_offer. - - ACE_URL_Property_Seq *seq2_; - // For modify seq. in modify_offer. - - ACE_URL_Offer *offer_; - // Offer to export. - - ACE_WString id_; - // Offer ID. - - ACE_WString url_; - // URL of this offer. - - char *buffer_; - // Buffer to store encoded data. -}; - -class ACE_Svc_Export ACE_URL_Locator_Reply - // = TITLE - // A URL reply message formater/wrapper. - // - // = DESCRIPTION - // This class defines a URL reply data. It is used - // to transform reply messages to an object so that we can - // ship them across network. -{ -public: - ACE_URL_Locator_Reply (void); - // Default ctor. - - ~ACE_URL_Locator_Reply (void); - // Default dtor. - - int status_reply (u_int op, int result); - // Setup a reply message for EXPORT, WITHDRAW, or MODIFY operations. - - int query_reply (int result, size_t num, - const ACE_URL_Offer_Seq &offers); - // Setup a reply for QUERY operation. - - int describe_reply (int result, - const ACE_URL_Offer &offer); - // Construct a reply for DESCRIBE operation. - - size_t encode (void); - // Encode request for network communication. If succeed, - // returns the size of the buffer, otherwise, return 0. - - size_t decode (void *buffer); - // Restore from network data. Returns size of the buffer - // if succeed, 0 otherwise. When passing in a buffer, - // caller must take the responsibility to delete the buffer - // afterward, if so needed. - - // Accessor function. - const size_t num_offers (void) const; - const ACE_URL_Offer *offer (void) const; - const ACE_URL_Offer_Seq *offers (void) const; - const u_int opcode (void) const; - const u_int status (void) const; - const char *buffer (void) const ; - - void dump (void) const ; - // Print out this object. - -protected: - size_t size (void); - // Return the size of the buffer required to encode - // this request. - - enum { - VALID_OFFER = 0x1, - VALID_OFFERS = 0x2 - }; - // Valid pointer masks. - - u_int code_; - // Holds the original op code. - - int status_; - // Holds the result of an operation from the Location Server. - - size_t num_offers_; - // Holds the number of valid offers in the offers_ sequence. - - int valid_ptr_; - // Flag that marks valid internal pointers. - - ACE_URL_Offer *offer_; - // Holds a single offer. Used in query offer property. - - ACE_URL_Offer_Seq *offers_; - // Holds the replying offer sequence from a Locator. - - char *buffer_; - // Buffer to store encoded data. -}; -#if defined (__ACE_INLINE__) -#include "Locator_Request_Reply.i" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_LOCATOR_REQUEST_REPLY_H */ diff --git a/apps/JAWS/clients/Caching/Locator_Request_Reply.i b/apps/JAWS/clients/Caching/Locator_Request_Reply.i deleted file mode 100644 index 9dd2f851ceb..00000000000 --- a/apps/JAWS/clients/Caching/Locator_Request_Reply.i +++ /dev/null @@ -1,138 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -#include "URL_Locator.h" - -ACE_INLINE -ACE_URL_Locator_Request::ACE_URL_Locator_Request (void) - : code_(ACE_URL_Locator::INVALID_OPERATION), - seq1_ (0), - seq2_ (0), - offer_ (0), - buffer_ (0) -{ -} - -ACE_INLINE -ACE_URL_Locator_Request::~ACE_URL_Locator_Request (void) -{ - delete this->seq1_; - delete this->seq2_; - delete this->offer_; - delete [] this->buffer_; -} - -ACE_INLINE const int -ACE_URL_Locator_Request::how (void) const -{ - return this-> how_; -} - -ACE_INLINE const int -ACE_URL_Locator_Request::how_many (void) const -{ - return this->how_many_; -} - -ACE_INLINE const u_int -ACE_URL_Locator_Request::opcode (void) const -{ - return this->code_; -} - -ACE_INLINE const ACE_URL_Property_Seq * -ACE_URL_Locator_Request::seq (void) const -{ - return this->seq1_; -} - -ACE_INLINE const ACE_URL_Property_Seq * -ACE_URL_Locator_Request::del (void) const -{ - return this->seq1_; -} - -ACE_INLINE const ACE_URL_Property_Seq * -ACE_URL_Locator_Request::modify (void) const -{ - return this->seq2_; -} - -ACE_INLINE const ACE_URL_Offer * -ACE_URL_Locator_Request::offer (void) const -{ - return this->offer_; -} - -ACE_INLINE const ACE_WString & -ACE_URL_Locator_Request::id (void) const -{ - return this->id_; -} - -ACE_INLINE const ACE_WString & -ACE_URL_Locator_Request::url (void) const -{ - return this->url_; -} - -ACE_INLINE const char * -ACE_URL_Locator_Request::buffer (void) const -{ - return this->buffer_; -} - -ACE_INLINE -ACE_URL_Locator_Reply::ACE_URL_Locator_Reply (void) - : code_ (ACE_URL_Locator::INVALID_OPERATION), - offer_ (0), - offers_ (0), - buffer_ (0) -{ -} - -ACE_INLINE -ACE_URL_Locator_Reply::~ACE_URL_Locator_Reply (void) -{ - delete this->offer_; - delete this->offers_; - delete [] this->buffer_; -} - -ACE_INLINE const size_t -ACE_URL_Locator_Reply::num_offers (void) const -{ - return this->num_offers_; -} - - -ACE_INLINE const ACE_URL_Offer * -ACE_URL_Locator_Reply::offer (void) const -{ - return this->offer_; -} - -ACE_INLINE const ACE_URL_Offer_Seq * -ACE_URL_Locator_Reply::offers (void) const -{ - return this->offers_; -} - -ACE_INLINE const u_int -ACE_URL_Locator_Reply::opcode (void) const -{ - return this->code_; -} - -ACE_INLINE const u_int -ACE_URL_Locator_Reply::status (void) const -{ - return this->status_; -} - -ACE_INLINE const char * -ACE_URL_Locator_Reply::buffer (void) const -{ - return this->buffer_; -} diff --git a/apps/JAWS/clients/Caching/Makefile b/apps/JAWS/clients/Caching/Makefile deleted file mode 100644 index b51a7d4b756..00000000000 --- a/apps/JAWS/clients/Caching/Makefile +++ /dev/null @@ -1,199 +0,0 @@ -#---------------------------------------------------------------------------- -# $Id$ -# -# Makefile for the ACE Adapter Web Server (JAWS) client -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN2 = http_client - -FILES = http_handler - -SRC = $(addsuffix .cpp,$(FILES)) -OBJ = $(addsuffix .o,$(FILES)) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU - -#### If the ACE library wasn't built with sufficient components, don't -#### try to build here. -ACE_BUILD_COMPONENTS := $(shell sh $(ACE_ROOT)/bin/ace_components --ace) -ifeq (Utils,$(findstring Utils,$(ACE_BUILD_COMPONENTS))) - ifneq (FOR_TAO,$(ACE_COMPONENTS)) - BIN = $(BIN2) - endif # ! FOR_TAO -endif # ! Utils - -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/http_handler.o .obj/http_handler.so .shobj/http_handler.o .shobj/http_handler.so: http_handler.cpp \ - $(ACE_ROOT)/ace/Filecache.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/inc_user_config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/Basic_Types.h \ - $(ACE_ROOT)/ace/Basic_Types.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Synch_T.cpp \ - $(ACE_ROOT)/ace/Hash_Map_Manager.h \ - $(ACE_ROOT)/ace/Functor.h \ - $(ACE_ROOT)/ace/Functor.i \ - $(ACE_ROOT)/ace/Functor_T.h \ - $(ACE_ROOT)/ace/Functor_T.i \ - $(ACE_ROOT)/ace/Functor_T.cpp \ - $(ACE_ROOT)/ace/Hash_Map_Manager.i \ - $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ - $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ - $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ - $(ACE_ROOT)/ace/Service_Config.h \ - $(ACE_ROOT)/ace/Service_Object.h \ - $(ACE_ROOT)/ace/Shared_Object.h \ - $(ACE_ROOT)/ace/Shared_Object.i \ - $(ACE_ROOT)/ace/Service_Object.i \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Malloc_Base.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Containers_T.h \ - $(ACE_ROOT)/ace/Containers_T.i \ - $(ACE_ROOT)/ace/Containers_T.cpp \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Free_List.cpp \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Malloc_T.cpp \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Managed_Object.cpp \ - $(ACE_ROOT)/ace/SString.h \ - $(ACE_ROOT)/ace/SString.i \ - $(ACE_ROOT)/ace/Service_Config.i \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ - http_handler.h \ - $(ACE_ROOT)/ace/Connector.h \ - $(ACE_ROOT)/ace/Map_Manager.h \ - $(ACE_ROOT)/ace/Map_Manager.i \ - $(ACE_ROOT)/ace/Map_Manager.cpp \ - $(ACE_ROOT)/ace/Svc_Handler.h \ - $(ACE_ROOT)/ace/Synch_Options.h \ - $(ACE_ROOT)/ace/Synch_Options.i \ - $(ACE_ROOT)/ace/Task.h \ - $(ACE_ROOT)/ace/Thread_Manager.h \ - $(ACE_ROOT)/ace/Thread_Manager.i \ - $(ACE_ROOT)/ace/Task.i \ - $(ACE_ROOT)/ace/Task_T.h \ - $(ACE_ROOT)/ace/Message_Queue.h \ - $(ACE_ROOT)/ace/Message_Block.h \ - $(ACE_ROOT)/ace/Message_Block.i \ - $(ACE_ROOT)/ace/Message_Block_T.h \ - $(ACE_ROOT)/ace/Message_Block_T.i \ - $(ACE_ROOT)/ace/Message_Block_T.cpp \ - $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ - $(ACE_ROOT)/ace/Message_Queue_T.h \ - $(ACE_ROOT)/ace/Message_Queue_T.i \ - $(ACE_ROOT)/ace/Message_Queue_T.cpp \ - $(ACE_ROOT)/ace/Strategies.h \ - $(ACE_ROOT)/ace/Strategies_T.h \ - $(ACE_ROOT)/ace/Strategies_T.i \ - $(ACE_ROOT)/ace/Strategies_T.cpp \ - $(ACE_ROOT)/ace/Service_Repository.h \ - $(ACE_ROOT)/ace/Service_Types.h \ - $(ACE_ROOT)/ace/Service_Types.i \ - $(ACE_ROOT)/ace/Service_Repository.i \ - $(ACE_ROOT)/ace/WFMO_Reactor.h \ - $(ACE_ROOT)/ace/WFMO_Reactor.i \ - $(ACE_ROOT)/ace/Strategies.i \ - $(ACE_ROOT)/ace/Message_Queue.i \ - $(ACE_ROOT)/ace/Task_T.i \ - $(ACE_ROOT)/ace/Task_T.cpp \ - $(ACE_ROOT)/ace/Module.h \ - $(ACE_ROOT)/ace/Module.i \ - $(ACE_ROOT)/ace/Module.cpp \ - $(ACE_ROOT)/ace/Stream_Modules.h \ - $(ACE_ROOT)/ace/Stream_Modules.i \ - $(ACE_ROOT)/ace/Stream_Modules.cpp \ - $(ACE_ROOT)/ace/Svc_Handler.i \ - $(ACE_ROOT)/ace/Svc_Handler.cpp \ - $(ACE_ROOT)/ace/Dynamic.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Singleton.cpp \ - $(ACE_ROOT)/ace/Dynamic.i \ - $(ACE_ROOT)/ace/Connector.i \ - $(ACE_ROOT)/ace/Connector.cpp \ - $(ACE_ROOT)/ace/SOCK_Connector.h \ - $(ACE_ROOT)/ace/SOCK_Stream.h \ - $(ACE_ROOT)/ace/SOCK_IO.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_IO.i \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/INET_Addr.i \ - $(ACE_ROOT)/ace/SOCK_Stream.i \ - $(ACE_ROOT)/ace/Time_Value.h \ - $(ACE_ROOT)/ace/SOCK_Connector.i - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/apps/JAWS/clients/Caching/Makefile.bor b/apps/JAWS/clients/Caching/Makefile.bor deleted file mode 100644 index af633030078..00000000000 --- a/apps/JAWS/clients/Caching/Makefile.bor +++ /dev/null @@ -1,6 +0,0 @@ - -NAME = http_client -OBJFILES = \ - $(OBJDIR)\http_client.obj \ - $(OBJDIR)\http_handler.obj -!include <$(ACE_ROOT)\apps\build.bor> diff --git a/apps/JAWS/clients/Caching/README b/apps/JAWS/clients/Caching/README deleted file mode 100644 index 3dcfcd32815..00000000000 --- a/apps/JAWS/clients/Caching/README +++ /dev/null @@ -1,83 +0,0 @@ -# -*- text -*- -# Hey, Emacs! This is a TEXT file. - ----------------------------------- -README for the caching http_client ----------------------------------- - -This is the README file for the simple caching http_client. - ------------- -1. Compiling ------------- - -1a. Compiling on UNIX. - - On UNIX, with a properly configured ACE distribution, just -type make (using GNU make, of course). - -1b. Compiling on NT. - - Thus far, this code has only been tested under UNIX. A -Windows NT version will be out soon. - ------------- -2. Executing ------------- - -2a. Command line parameters. - - The program does not support any command line parameters. - -2b. General information. - - When the program runs, the client offers a ``*'' as a prompt. -At the prompt, you may enter a URL. The client will check to see if -the filename portion of the URL has already been cached. If so, a -message appears saying so. If not, the client will fetch the file -from the HTTP server and then cache it. - - Furthermore, the client supports the ``!'' shell escape -command. The content after the ``!'' will be executed by a shell. - - To exit the session, send the end-of-file character -(typically, ^D in UNIX). - - unix$ ./http_client - * http://www.cs.wustl.edu/cs/Art/brookings.gif - [1] sending request -- - GET /cs/Art/brookings.gif HTTP/1.0 - Accept: HTTP/1.0 - - ``brookings.gif'' is now cached. - * http://www.cs.wustl.edu/cs/Art/brookings.gif - ``brookings.gif'' is already cached. - * !ls - Makefile http_client http_handler.cpp zJAWSAAAa000Yg - brookings.gif http_client.cpp http_handler.h - * ^D - Bye! - unix$ ls - Makefile http_client http_handler.cpp - brookings.gif http_client.cpp http_handler.h - unix$ - --------------- -3. Limitations --------------- - - The caching mechanism as currently implemented requires a -``Content-length:'' to appear in the response header of the HTTP -response. This is because the caching utilizes mmap () to allocate -space for the file to be cached before the file is received. Unitl -the caching mecahnism is extended, you are limited to using servers -which will report the size of the file being transmitted. - - Currently, the cache creates temporary files (see the above -sample execution). - - The cache is not persistent between executions. - - Suggestions and other correspondence should be sent to me: - -James Hu <jxh@cs.wustl.edu> diff --git a/apps/JAWS/clients/Caching/URL_Array_Helper.cpp b/apps/JAWS/clients/Caching/URL_Array_Helper.cpp deleted file mode 100644 index c8dbb55e197..00000000000 --- a/apps/JAWS/clients/Caching/URL_Array_Helper.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// $Id$ - -// URL_Array_Helper.cpp - -#ifndef ACE_URL_ARRAY_HELPER_C -#define ACE_URL_ARRAY_HELPER_C - -#include "URL_Array_Helper.h" - -ACE_RCSID(Caching, URL_Array_Helper, "$Id$") - -// Some helper functions for encoding/decoding - -template <class T> -size_t ace_array_size (const T &x) -{ - size_t sum = sizeof (ACE_UINT32); - for (size_t i = 0; i < x.size (); i++) - sum += x[i].size (); - return sum; -} - -template <class T> -size_t ace_array_encode (void *buf, const T &x) -{ - size_t len = 0; - for (size_t i = 0; i < x.size (); i++) - len+= x[i].encode ((void *) ((char *) buf + len)); - return len ; -} - -template <class T> -size_t ace_array_decode (void *buf, T &x) -{ - size_t len = 0; - for (size_t i = 0; i < x.size (); i++) - len += x[i].decode ((void *) ((char *) buf + len)); - return len; -} - - - -#endif /* ACE_URL_ARRAY_HELPER_C */ diff --git a/apps/JAWS/clients/Caching/URL_Array_Helper.h b/apps/JAWS/clients/Caching/URL_Array_Helper.h deleted file mode 100644 index f38f9ebf5dd..00000000000 --- a/apps/JAWS/clients/Caching/URL_Array_Helper.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// none -// -// = FILENAME -// URL_Array_Helper.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#ifndef ACE_URL_ARRAY_HELPER_H -#define ACE_URL_ARRAY_HELPER_H - -// ### These template functions are probably named improperly. -// You should find some way to avoid name space polution. - -template <class T> -size_t ace_array_size (const T &x); - -template <class T> -size_t ace_array_encode (void *buf, const T &x); - -template <class T> -size_t ace_array_decode (void *buf, T &x); - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "URL_Array_Helper.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("URL_Array_Helper.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* ACE_URL_ARRAY_HELPER_H */ diff --git a/apps/JAWS/clients/Caching/URL_Locator.cpp b/apps/JAWS/clients/Caching/URL_Locator.cpp deleted file mode 100644 index fd3eacab06d..00000000000 --- a/apps/JAWS/clients/Caching/URL_Locator.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// $Id$ - -#if !defined (ACE_URL_LOCATOR_C) -#define ACE_URL_LOCATOR_C - -#include "URL_Locator.h" - -#if !defined (__ACE_INLINE__) -#include "URL_Locator.i" -#endif - -ACE_RCSID(Caching, URL_Locator, "$Id$") - -const char * const -ACE_URL_Locator::opname[] = -// Human readable operation name -{ - "Query", - "Export", - "Withdraw", - "Describe", - "Modify", - "Invalid Operation" -}; - -const char * const -ACE_URL_Locator::selection_name[] = -{ - "None", - "Some", - "All", - "Invalid Selection" -}; - -const char * const -ACE_URL_Locator::err_name[] = -{ - "No error", - "Offer already exist", - "no such offer", - "invalid argument", - "function not implemented", - "unknown error" -}; - -ACE_URL_Locator::~ACE_URL_Locator (void) -{ -} - -const char * -ACE_URL_Locator::error_status (void) -{ - return "Not implemented yet."; -} - -#endif /* ACE_URL_LOCATOR_C */ diff --git a/apps/JAWS/clients/Caching/URL_Locator.h b/apps/JAWS/clients/Caching/URL_Locator.h deleted file mode 100644 index cf6f294145e..00000000000 --- a/apps/JAWS/clients/Caching/URL_Locator.h +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// none -// -// = FILENAME -// URL_Locator.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#ifndef ACE_URL_LOCATOR_H -#define ACE_URL_LOCATOR_H - -#include "URL_Properties.h" - -class ACE_Svc_Export ACE_URL_Locator - // = TITLE - // Abstract Base class designates what interfaces a URL_Locator - // should provide. - // - // = DESCRIPTION - // This class defines the basic URL_Locator APIs. - // An URL locator provides services for URL clients to - // query specific URL location that has certain properties - // and URL providers to export their services and a set of - // APIs to maintain their offers. -{ -public: - // Request type - enum ACE_URL_Locator_Op_Type - { - QUERY = 0, - EXPORT, - WITHDRAW, - DESCRIBE, - MODIFY, - INVALID_OPERATION // LAST - }; - - static const char * const opname[]; - // Human Readable operation name. - - // = Specify how to select offers. - enum ACE_Selection_Criteria - { - NONE = 0, // URL that contains none of the properties. - SOME, // URL that contains some of the properties. - ALL, // URL that contains all of the properties. - INVALID_SELECTION // Invalid. - }; - - static const char * const selection_name[]; - - enum ACE_URL_Locator_Error - // errno will set to one of these value. - { - OK, // Everything is fine. - OFFER_EXIST, // trying to register an offer. - // that is already exist in repository. - NO_SUCH_OFFER, // No such offer in the repository. - INVALID_ARGUMENT, // Invalid argument encountered. - UNIMPLEMENTED, // function not implemented. - UNKNOWN, // Unknown error. - MAX_URL_ERROR - }; - // Possible error code of URL_Locator. - - static const char * const err_name[]; - // Human readable error status. - - virtual ~ACE_URL_Locator (void) = 0; - // Default destructor. - - virtual int url_query (const ACE_Selection_Criteria how, - const ACE_URL_Property_Seq *pseq, - const size_t how_many, - size_t &num_query, - ACE_URL_Offer_Seq *offer) = 0; - // Query the locator for HTTP with designate properties (none, some, - // or all). The locator being queried will return a sequence of - // offers with <how_many> offers in it. This interface allocates - // <offer> so users must deallocate it after use. - - virtual int export_offer (ACE_URL_Offer *offer, - ACE_WString &offer_id) = 0; - // Export an offer to the locator. - - virtual int withdraw_offer (const ACE_WString &offer_id) = 0; - // Withdraw an offer. return 0 if succeed, -1 otherwise. - - virtual int describe_offer (const ACE_WString &offer_id, - ACE_URL_Offer *offer) = 0; - // Query a specific offer. - - virtual int modify_offer (const ACE_WString &offer_id, - const ACE_WString *url = 0, - const ACE_URL_Property_Seq *del = 0, - const ACE_URL_Property_Seq *modify = 0) = 0; - // Modify a previously registered offer. - - virtual const char *error_status (void); - // Provide a human readable error status. -}; - -#if defined (__ACE_INLINE__) -#include "URL_Locator.i" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_WEB_LOCATOR_H */ diff --git a/apps/JAWS/clients/Caching/URL_Locator.i b/apps/JAWS/clients/Caching/URL_Locator.i deleted file mode 100644 index 722888896c1..00000000000 --- a/apps/JAWS/clients/Caching/URL_Locator.i +++ /dev/null @@ -1,4 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - diff --git a/apps/JAWS/clients/Caching/URL_Properties.cpp b/apps/JAWS/clients/Caching/URL_Properties.cpp deleted file mode 100644 index eeae1f43581..00000000000 --- a/apps/JAWS/clients/Caching/URL_Properties.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// $Id$ - -#if !defined (ACE_URL_PROPERTIES_C) -#define ACE_URL_PROPERTIES_C - -#include "URL_Properties.h" - -#if !defined (__ACE_INLINE__) -#include "URL_Properties.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/OS.h" -#include "ace/Auto_Ptr.h" -#include "URL_Array_Helper.h" - -ACE_RCSID(Caching, URL_Properties, "$Id$") - -size_t -ACE_WString_Helper::encode (void *buf, const ACE_WString &wstr) -{ - ACE_USHORT16 *wptr = (ACE_USHORT16 *) buf; - size_t i; - - for (i= 0; i <= wstr.length (); i++) - wptr[i] = htons (wstr[i]); - - return i * sizeof (ACE_USHORT16); -} - -size_t -ACE_WString_Helper::decode (void *buf) -{ - ACE_USHORT16 *wptr = (ACE_USHORT16 *) buf; - size_t i; - - for (i = 0; wptr[i] != 0; i++) - wptr[i] = ntohs (wptr[i]); - - return (i + 1) * sizeof (ACE_USHORT16); -} - -size_t -ACE_URL_Property::encode (void *buf) const -{ - size_t blen = ACE_WString_Helper::encode (buf, this->name_); - blen += ACE_WString_Helper::encode ((void *) ((char *) buf + blen), - this->value_); - return blen; -} - -size_t -ACE_URL_Property::decode (void *buf) -{ - char *cbuf = (char *) buf; - size_t len = ACE_WString_Helper::decode(buf); - this->name ((ACE_USHORT16 *) cbuf); - - cbuf += len; - len += ACE_WString_Helper::decode ((void *) cbuf); - this->value ((ACE_USHORT16 *) cbuf); - return len; -} - -void -ACE_URL_Property::dump (void) const -{ - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - if (this->name_.length () > 0) - ACE_DEBUG ((LM_DEBUG, "\n name_: \"%s\"\n", - ACE_Auto_Basic_Array_Ptr<char> (this->name_.char_rep ()).get ())); - else - ACE_DEBUG ((LM_DEBUG, "\n name_: \"\"\n")); - - if (this->value_.length () > 0) - ACE_DEBUG ((LM_DEBUG, " value_: \"%s\"\n", - ACE_Auto_Basic_Array_Ptr<char> (this->value_.char_rep ()).get ())); - else - ACE_DEBUG ((LM_DEBUG, " value_: \"\"\n")); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -size_t -ACE_URL_Offer::size (void) const -{ - size_t sum = (this->url_.length () + 1) * sizeof (ACE_USHORT16); - sum += ::ace_array_size (this->prop_); - return sum; -} - -size_t -ACE_URL_Offer::encode (void *buf) const -{ - ACE_UINT32 *s_buf = (ACE_UINT32 *) buf; - *s_buf = htonl (this->prop_.size ()); - - size_t len = sizeof (ACE_UINT32); - len += ACE_WString_Helper::encode ((void *) ((char *) buf + len), - this->url_); - - len += ::ace_array_encode ((void *) ((char *) buf + len), - this->prop_); - return len; -} - -size_t -ACE_URL_Offer::decode (void *buf) -{ - size_t len = sizeof (ACE_UINT32); - size_t a_size = (size_t) ntohl (*(ACE_UINT32 *) buf); - len += ACE_WString_Helper::decode ((void *) ((char *) buf + len)); - this->url ((ACE_USHORT16 *) ((char *) buf + len)); - - ACE_URL_Property_Seq prop_seq (a_size); - this->url_properties (prop_seq); - - len += ::ace_array_decode ((void *)((char *) buf + len), - this->prop_); - return len; -} - -void -ACE_URL_Offer::dump (void) const -{ - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - - if (this->url_.length () > 0) - ACE_DEBUG ((LM_DEBUG, "\n url_: \"%s\"\n", - ACE_Auto_Basic_Array_Ptr<char> (this->url_.char_rep ()).get ())); - else - ACE_DEBUG ((LM_DEBUG, "\n url_: \"\"\n")); - - for (size_t i = 0; i < this->prop_.size (); i++) - this->prop_[i].dump (); - - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Array_Base<ACE_URL_Property>; -template class ACE_Array<ACE_URL_Property>; -template class ACE_Array_Base<ACE_URL_Offer>; -template class ACE_Array<ACE_URL_Offer>; -template size_t ace_array_size (ACE_Array<ACE_URL_Property> &); -template size_t ace_array_encode (void *, ACE_Array<ACE_URL_Property> &); -template size_t ace_array_decode (void *, ACE_Array<ACE_URL_Property> &); -template size_t ace_array_size (ACE_Array<ACE_URL_Offer> &); -template size_t ace_array_encode (void *, ACE_Array<ACE_URL_Offer> &); -template size_t ace_array_decode (void *, ACE_Array<ACE_URL_Offer> &); -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Array_Base<ACE_URL_Property> -#pragma instantiate ACE_Array<ACE_URL_Property> -#pragma instantiate ACE_Array_Base<ACE_URL_Offer> -#pragma instantiate ACE_Array<ACE_URL_Offer> -#pragma instantiate size_t ace_array_size (ACE_Array<ACE_URL_Property> &) -#pragma instantiate size_t ace_array_encode (void *, ACE_Array<ACE_URL_Property> &) -#pragma instantiate size_t ace_array_decode (void *, ACE_Array<ACE_URL_Property> &) -#pragma instantiate size_t ace_array_size (ACE_Array<ACE_URL_Offer> &) -#pragma instantiate size_t ace_array_encode (void *, ACE_Array<ACE_URL_Offer> &) -#pragma instantiate size_t ace_array_decode (void *, ACE_Array<ACE_URL_Offer> &) -#endif /*ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* ACE_URL_PROPERTIES_C */ diff --git a/apps/JAWS/clients/Caching/URL_Properties.h b/apps/JAWS/clients/Caching/URL_Properties.h deleted file mode 100644 index 17e3c6df114..00000000000 --- a/apps/JAWS/clients/Caching/URL_Properties.h +++ /dev/null @@ -1,201 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// none -// -// = FILENAME -// URL_Locator.h -// -// = AUTHOR -// Nanbor Wang -// -// ============================================================================ - -#ifndef ACE_URL_PROPERTIES_H -#define ACE_URL_PROPERTIES_H - -#include "ace/SString.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Containers.h" - -class ACE_Svc_Export ACE_WString_Helper - // = TITLE - // Some helper functions for manipulate ACE_WString. - // - // = DESCRIPTION - // These functions simplify encoding/decoding of - // ACE_WString objects for network communication. -{ -public: - static size_t size (const ACE_WString &wstr); - // Returns the actual size (in bytes) required to contain the - // ACE_WString. - - static size_t encode (void *buf, const ACE_WString &wstr); - // Encode <wstr> into <buf> for network communication. - // Return total octets consumed. - - static size_t decode (void *buf); - // This function doesn't relate to ACE_WString directly. - // It converts an ACE_USHORT16 string from network - // byte order to host byte order. Returns size of the string. -}; - -class ACE_Svc_Export ACE_URL_Property - // = TITLE - // Defines a property of a URL. - // - // = DESCRIPTION - // A property contains a <name> and a <value>. - // A URL may contain some properties and we can "locate" - // the URL's we are looking for by examming URL for certain - // properties that match our need. -{ -public: - ACE_URL_Property (const char *name = 0, - const char *value=0); - // Create a new property. - - ACE_URL_Property (const ACE_USHORT16 *name, - const ACE_USHORT16 *value); - // Create a new property using wchar strings. This is mostly used - // to support DBCS or UNICODE. - - ACE_URL_Property (const ACE_URL_Property &p); - // Copy constructor. - - ~ACE_URL_Property (void); - // Destructor. - - ACE_URL_Property &operator= (const ACE_URL_Property &rhs); - // Assignment operator. - - int operator== (const ACE_URL_Property &rhs) const; - // Equals operator. - - int operator!= (const ACE_URL_Property &rhs) const; - // Inequality operator. - - // = Query property name. - ACE_WString &name_rep (void); - const ACE_WString &name (void) const; - - // = Set property name. - void name (const ACE_USHORT16 *n); - void name (const char *n); - - // = Query property value. - ACE_WString &value_rep (void); - const ACE_WString &value (void) const; - - // = Set property value. - void value (const ACE_USHORT16 *v); - void value (const char *v); - - // = Helper functions for encoding and decoding. - size_t size (void) const; - // Returns memory size (in bytes) required to encode this object. - - size_t encode (void *buf) const; - // Encodes this object into buf for network transmission. - - size_t decode (void *buf); - // Decodes buf and modifies this object, you should - // probably create this with default ctor. - - void dump (void) const; - // Dump out this object for debug. - -protected: - ACE_WString name_; - // Property name pointer. - - ACE_WString value_; - // Property value. -} ; - -typedef ACE_Array<ACE_URL_Property> ACE_URL_Property_Seq; -// type of URL_Property collections. - -class ACE_Svc_Export ACE_URL_Offer - // = TITLE - // Defines a URL offer. - // - // = DESCRIPTION - // A URL offer is defined by a <url> and an - // <ACE_URL_Property_Seq>. An offer is stored at server end - // thru registering or reported back to querying client from the - // sever. -{ -public: - ACE_URL_Offer (const size_t size = 1, const char *url = 0); - // Create an offer. - - ACE_URL_Offer (const ACE_URL_Offer &o); - // Copy ctor. - - ~ACE_URL_Offer (void); - // Default destructor. - - ACE_URL_Offer &operator= (const ACE_URL_Offer &rhs); - // Assignment operator. - - int operator== (const ACE_URL_Offer &rhs) const; - // Equality operator. - - int operator!= (const ACE_URL_Offer &rhs) const; - // Inequality operator. - - // = Get URL string. - ACE_WString &url_rep (void); - const ACE_WString &url (void) const; - - // = Set URL. - void url (const char *url); - void url (const ACE_USHORT16 *url); - - ACE_URL_Property_Seq &url_properties (void); - // Get properties of this offer. - - void url_properties (const ACE_URL_Property_Seq &prop); - // Set properties of this offer. This operation virtually get a - // copy of the passed in prop. - - // = Helper functions for encoding and decoding. - size_t size (void) const; - // Returns memory size (in bytes) required to encode this object. - - size_t encode (void *buf) const; - // Encodes this object into buf for network transmission. - - size_t decode (void *buf); - // Decodes buf into current object, you better use - // the default ctor. - - void dump (void) const; - // Dump this object for debug. - -protected: - ACE_WString url_; - // URL of this offer. - - ACE_URL_Property_Seq prop_; - // Properties associate with this offer. -}; - -typedef ACE_Array<ACE_URL_Offer> ACE_URL_Offer_Seq; -// type of URL offer collections. - -#if defined (__ACE_INLINE__) -#include "URL_Properties.i" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_WEB_PROPERTIES_H */ diff --git a/apps/JAWS/clients/Caching/URL_Properties.i b/apps/JAWS/clients/Caching/URL_Properties.i deleted file mode 100644 index 9e0cb59d03e..00000000000 --- a/apps/JAWS/clients/Caching/URL_Properties.i +++ /dev/null @@ -1,203 +0,0 @@ -/* -*- C++ -*- */ - -// $Id$ - -ACE_INLINE size_t -ACE_WString_Helper::size (const ACE_WString &wstr) -{ - return (wstr.length () + 1) * sizeof (ACE_USHORT16); -} - -ACE_INLINE -ACE_URL_Property::ACE_URL_Property (const char *name, const char *value) - : name_ (name), - value_ (value) -{ -} - -ACE_INLINE -ACE_URL_Property::ACE_URL_Property (const ACE_USHORT16 *name, - const ACE_USHORT16 *value) - : name_ (name), - value_ (value) -{ -} - -ACE_INLINE -ACE_URL_Property::ACE_URL_Property (const ACE_URL_Property &p) - : name_ (p.name_), - value_ (p.value_) -{ -} - -ACE_INLINE -ACE_URL_Property::~ACE_URL_Property (void) -{ -} - -ACE_INLINE ACE_URL_Property & -ACE_URL_Property::operator= (const ACE_URL_Property &rhs) -{ - if (this != &rhs) - { - this->name_ = rhs.name_; - this->value_ = rhs.value_; - } - return *this; -} - -ACE_INLINE int -ACE_URL_Property::operator== (const ACE_URL_Property &rhs) const -{ - if (this == &rhs || this->name_ != rhs.name_ || - this->value_ != rhs.value_) - return 1; - else - return 0; -} - -ACE_INLINE int -ACE_URL_Property::operator!= (const ACE_URL_Property &rhs) const -{ - return !(*this == rhs); -} - -ACE_INLINE ACE_WString & -ACE_URL_Property::name_rep (void) -{ - return this->name_; -} - -ACE_INLINE const ACE_WString & -ACE_URL_Property::name (void) const -{ - return this->name_; -} - -ACE_INLINE void -ACE_URL_Property::name (const char *n) -{ - this->name_ = ACE_WString (n); -} - -ACE_INLINE void -ACE_URL_Property::name (const ACE_USHORT16 *n) -{ - this->name_ = ACE_WString (n); -} - -ACE_INLINE ACE_WString & -ACE_URL_Property::value_rep (void) -{ - return this->value_; -} - -ACE_INLINE const ACE_WString & -ACE_URL_Property::value (void) const -{ - return this->value_; -} - -ACE_INLINE void -ACE_URL_Property::value (const char *v) -{ - this->value_ = ACE_WString (v); -} - -ACE_INLINE void -ACE_URL_Property::value (const ACE_USHORT16 *v) -{ - this->value_ = ACE_WString (v); -} - - -ACE_INLINE size_t -ACE_URL_Property::size (void) const -{ - size_t len = 2; - len += this->name_.length () + this->value_.length (); - return len * sizeof (ACE_USHORT16); -} - -ACE_INLINE -ACE_URL_Offer::ACE_URL_Offer (const size_t size, const char *url) - : url_ (url), - prop_ (size) -{ -} - -ACE_INLINE -ACE_URL_Offer::ACE_URL_Offer (const ACE_URL_Offer &o) - : url_ (o.url_), - prop_ (o.prop_) -{ -} - -ACE_INLINE -ACE_URL_Offer::~ACE_URL_Offer (void) -{ -} - -ACE_INLINE ACE_URL_Offer & -ACE_URL_Offer::operator= (const ACE_URL_Offer &rhs) -{ - if (this != &rhs) - { - this->url_ = rhs.url_; - this->prop_ = rhs.prop_; - } - return *this; -} - -ACE_INLINE int -ACE_URL_Offer::operator== (const ACE_URL_Offer &rhs) const -{ - if (this == &rhs - && this->url_ == rhs.url_ - && this->prop_ == rhs.prop_) - return 1; - else - return 0; -} - -ACE_INLINE int -ACE_URL_Offer::operator!= (const ACE_URL_Offer &rhs) const -{ - return !(*this == rhs); -} - -ACE_INLINE ACE_WString & -ACE_URL_Offer::url_rep (void) -{ - return this->url_; -} - -ACE_INLINE const ACE_WString & -ACE_URL_Offer::url (void) const -{ - return this->url_; -} - -ACE_INLINE void -ACE_URL_Offer::url (const ACE_USHORT16 *url) -{ - this->url_ = ACE_WString (url); -} - -ACE_INLINE void -ACE_URL_Offer::url (const char *url) -{ - this->url_ = ACE_WString (url); -} - -ACE_INLINE ACE_URL_Property_Seq & -ACE_URL_Offer::url_properties (void) -{ - return this->prop_; -} - -ACE_INLINE void -ACE_URL_Offer::url_properties (const ACE_URL_Property_Seq &prop) -{ - this->prop_ = prop; -} diff --git a/apps/JAWS/clients/Caching/http_client.cpp b/apps/JAWS/clients/Caching/http_client.cpp deleted file mode 100644 index 9238ace3194..00000000000 --- a/apps/JAWS/clients/Caching/http_client.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// apps/JAWS/clients/Caching -// -// = FILENAME -// http_client.cpp -// -// = DESCRIPTION -// This is a very simple client. It accepts URLs from a prompt, and -// will try to fetch them. Also accepts shell escapes. -// -// = AUTHOR -// James Hu -// -// ============================================================================ - -#include "http_handler.h" - -ACE_RCSID(Caching, http_client, "$Id$") - -int -main (int, char *[]) -{ - // Present a command line. - // * Accept a URL. - // Pass it to the HTTP_Connector. - // Connect. - // Report status. - // * Accept shell escape character. - - char buf[BUFSIZ]; - - ACE_DEBUG ((LM_DEBUG, "* ")); - - while (ACE_OS::fgets (buf, sizeof (buf), stdin) != NULL) - { - char *s = buf; - - while (isspace (*s)) - s++; - - if (*s == '!') - { - do - s++; - while (isspace (*s)); - - // Shell command. - if (ACE_OS::system (s) == -1) - ACE_ERROR ((LM_ERROR, " ! Error executing: %s\n", s)); - } - else if (ACE_OS::strncmp (s, "http://", 7) == 0) - { - // URL - HTTP_Connector connector; - connector.connect (s); - } - else - ACE_ERROR ((LM_ERROR, " ? I don't understand: %s\n", s)); - - ACE_ERROR ((LM_ERROR, "* ")); - } - - ACE_DEBUG ((LM_DEBUG, "\nBye!\n")); - - return 0; -} diff --git a/apps/JAWS/clients/Caching/http_handler.cpp b/apps/JAWS/clients/Caching/http_handler.cpp deleted file mode 100644 index 7a1ceafd086..00000000000 --- a/apps/JAWS/clients/Caching/http_handler.cpp +++ /dev/null @@ -1,255 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// apps/JAWS/clients/Caching -// -// = FILENAME -// http_handler.cpp -// -// = AUTHOR -// James Hu -// -// ============================================================================ - -#include "ace/Filecache.h" -#include "http_handler.h" - -ACE_RCSID(Caching, http_handler, "$Id$") - -HTTP_Handler::HTTP_Handler (void) -{ -} - -HTTP_Handler::HTTP_Handler (const char * path) -{ - // How long is the request going to be? - this->request_[0] = '\0'; - this->request_size_ = - ACE_OS::strlen ("GET ") - + ACE_OS::strlen (path) - + ACE_OS::strlen (" HTTP/1.0\r\nAccept: HTTP/1.0\r\n\r\n"); - - // Make the request. - if ((u_int) this->request_size_ < sizeof (this->request_)) - ACE_OS::sprintf (this->request_, - "GET %s HTTP/1.0\r\nAccept: HTTP/1.0\r\n\r\n", - path); - - // Find the filename. - const char *last = ACE_OS::strrchr (path, '/'); - - if (last == 0) - last = path; - else if (last[1] == '\0') - last = "index.html"; - else - last = last+1; - - ACE_OS::sprintf (this->filename_, "%s", last); -} - -int -HTTP_Handler::open (void *) -{ - // If you want threads, use the activate stuff. -#if 0 - if (this->activate () != 0) - { - ACE_ERROR_RETURN ((LM_ERROR, "HTTP_Handler::open, whups!\n"), -1); - } - - return 0; -#else - return this->svc (); -#endif /* 0 */ -} - -int -HTTP_Handler::svc (void) -{ - static char buf[BUFSIZ]; - int count = 0; - - ACE_DEBUG ((LM_DEBUG, "[%t] sending request --\n%s", this->request_)); - - this->peer ().send_n (this->request_, this->request_size_); - - // Read in characters until encounter \r\n\r\n - int done = 0; - char *contentlength; - - do - { - while (((count += this->peer ().recv_n (buf + count, 1)) > 0) - && ((u_int) count < sizeof (buf))) - { - buf[count] = '\0'; - - if (count < 2) - continue; - done = ACE_OS::strcmp (buf + count - 4, "\n\n") == 0; - - if (done) - break; - - if (count < 4) - continue; - - done = ACE_OS::strcmp (buf + count - 4, "\r\n\r\n") == 0; - - if (done) - break; - } - - if (!done) - { - char *last = ACE_OS::strrchr (buf, '\n'); - last[0] = '\0'; - - if ((contentlength = ACE_OS::strstr (buf, "\nContent-length:")) - || (contentlength = ACE_OS::strstr (buf, "\nContent-Length:"))) - done = 1; - else - { - last[0] = '\n'; - count = ACE_OS::strlen (last); - ACE_OS::memmove (buf, last, count + 1); - } - } - else - { - contentlength = ACE_OS::strstr (buf, "\nContent-length:"); - - if (!contentlength) - contentlength = - ACE_OS::strstr (buf, "\nContent-Length:"); - } - - } - while (!done); - - // ASSERT (contentlength != 0) - if (contentlength - && (::sscanf (contentlength, "\nContent-%*[lL]ength: %d ", - &this->response_size_) == 1)) - { - ACE_Filecache_Handle afh (this->filename_, - this->response_size_); - - this->peer ().recv_n (afh.address (), this->response_size_); - - ACE_DEBUG ((LM_DEBUG, - " ``%s'' is now cached.\n", - this->filename_)); - } - else - { - // Maybe we should do something more clever here, such as extend - // ACE_Filecache_Handle to allow the creation of cache objects - // whose size is unknown? - - // Another possibility is to write the contents out to a file, - // and then cache it. - - // Perhaps make ACE_Filecache_Handle more savvy, and allow a - // constructor which accepts a PEER as a parameter. - ACE_DEBUG ((LM_DEBUG, - "HTTP_Handler, no content-length header!\n")); - } - - return 0; -} - -const char * -HTTP_Handler::filename (void) const -{ - return this->filename_; -} - -int -HTTP_Connector::connect (const char * url) -{ - char host[BUFSIZ]; - u_short port; - char path[BUFSIZ]; - - if (this->parseurl (url, host, &port, path) == -1) - { - ACE_DEBUG ((LM_DEBUG, - "HTTP_Connector, error parsing url: %s\n", - url)); - return -1; - } - - HTTP_Handler hh (path); - HTTP_Handler *hhptr = &hh; - - // First check the cache. - if (ACE_Filecache::instance ()->find (hh.filename ()) == 0) - { - ACE_DEBUG ((LM_DEBUG, " ``%s'' is already cached.\n", - hh.filename ())); - return 0; - } - - return this->connector_.connect (hhptr, ACE_INET_Addr (port, host)); -} - -#define DEFAULT_SERVER_PORT 80 - -// extract the main components of a URL -int -HTTP_Connector::parseurl (const char *url, - char *host, - u_short *port, - char *path) -{ - int status = 0; - - // hackish, but useful - if (3 != ::sscanf (url, "http://%[^:/]:%hu%s", host, port, path)) - { - if (2 != ::sscanf (url, "http://%[^:/]:%hu", host, port)) - { - if (2 != ::sscanf (url, "http://%[^:/]%s", host, path)) - { - if (1 != ::sscanf (url, "http://%[^:/]", host)) - status = -1; - else - { - *port = DEFAULT_SERVER_PORT; - ACE_OS::strcpy (path, "/"); - } - } - else - *port = DEFAULT_SERVER_PORT; - } - else ACE_OS::strcpy (path, "/"); - } - - // 0 => success - // -1 => error - return status; -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Connector<HTTP_Handler, ACE_SOCK_CONNECTOR>; -template class ACE_Svc_Tuple<HTTP_Handler>; -template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; -template class ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<HTTP_Handler>*>; -template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<HTTP_Handler>*, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<HTTP_Handler>*, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<HTTP_Handler>*, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<HTTP_Handler>*, ACE_SYNCH_RW_MUTEX>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Connector<HTTP_Handler, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Svc_Tuple<HTTP_Handler> -#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> -#pragma instantiate ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<HTTP_Handler>*> -#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<HTTP_Handler>*, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<HTTP_Handler>*, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<HTTP_Handler>*, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<HTTP_Handler>*, ACE_SYNCH_RW_MUTEX> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/apps/JAWS/clients/Caching/http_handler.h b/apps/JAWS/clients/Caching/http_handler.h deleted file mode 100644 index ec736312c0e..00000000000 --- a/apps/JAWS/clients/Caching/http_handler.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- c++ -*- */ -// Hey, Emacs! This is a C++ file. -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// apps/JAWS/clients/Caching -// -// = FILENAME -// http_handler.h -// -// = AUTHOR -// James Hu -// -// ============================================================================ - -#include "ace/Connector.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SOCK_Connector.h" - -class HTTP_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> - // = TITLE - // A simple HTTP protocol handler for clients. - // - // = DESCRIPTION - // Checks to see if the requested file is already cached. If - // so, it says so. If not, the request is issued to the - // connection. The fetched file is cached. -{ -public: - // = Initialization methods. - HTTP_Handler (void); - HTTP_Handler (const char * path); - - virtual int open (void *); - // Open hook. - - virtual int svc (void); - // Entry points defined by the abstract Svc_Handler. - - const char *filename (void) const; - // Accessor to the file being fetched. - -private: - char request_[BUFSIZ]; - int request_size_; - - char filename_[BUFSIZ]; - int response_size_; -}; - -class HTTP_Connector - // = TITLE - // A simple HTTP connector. - // - // = DESCRIPTION - // Creates an HTTP Handler based on the URL, and then delegates - // to to the SOCK_CONNECTOR. Adapter pattern. -{ -public: - int connect (const char * url); - // User entry point into the HTTP connector. - -private: - int parseurl (const char *url, - char *host, - u_short *port, - char *path); - // Helper function. - -private: - ACE_Connector<HTTP_Handler, ACE_SOCK_CONNECTOR> connector_; - // Factory that actively establishes a connection with an HTTP - // server. -}; - diff --git a/apps/JAWS/clients/Caching/test_URL.cpp b/apps/JAWS/clients/Caching/test_URL.cpp deleted file mode 100644 index fdf7a632daa..00000000000 --- a/apps/JAWS/clients/Caching/test_URL.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// $Id$ - -#include "ace/streams.h" -#include "Locator_Request_Reply.h" - -ACE_RCSID(Caching, test_URL, "$Id$") - -int main (int argc, char *argv[]) -{ - ACE_UNUSED_ARG (argc); - ACE_UNUSED_ARG (argv); - - ACE_URL_Locator_Request original, derived; - - ACE_URL_Property_Seq ouch1(3); - ouch1[0].name ("name 1"); - ouch1[0].value ("value 1"); - ouch1[1].name ("name 2"); - ouch1[1].value ("value 2"); - ouch1[2].name ("name 3"); - ouch1[2].value ("value 3"); - - original.url_query (1, ouch1, 3); - - original.dump (); - derived.dump (); - - original.encode (); - - derived.decode ((void*) original.buffer ()); - - derived.dump (); - - return 0; -} diff --git a/apps/JAWS/clients/Caching/testing.dsp b/apps/JAWS/clients/Caching/testing.dsp deleted file mode 100644 index f50189194cd..00000000000 --- a/apps/JAWS/clients/Caching/testing.dsp +++ /dev/null @@ -1,121 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testing" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=testing - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "testing.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "testing.mak" CFG="testing - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "testing - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\testing\Debug"
-# PROP BASE Intermediate_Dir ".\testing\Debug"
-# PROP BASE Target_Dir ".\testing"
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "."
-# PROP Intermediate_Dir ".\Debug"
-# PROP Target_Dir ".\testing"
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-# ADD LINK32 aced.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-# Begin Target
-
-# Name "testing - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\ID_Generator.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Local_Locator.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\URL_Locator.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\URL_Properties.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=.\ID_Generator.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Local_Locator.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\URL_Array_Helper.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\URL_Locator.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\URL_Properties.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Source File
-
-SOURCE=.\Local_Locator.i
-# End Source File
-# Begin Source File
-
-SOURCE=.\URL_Array_Helper.cpp
-# PROP BASE Exclude_From_Build 1
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=.\URL_Locator.i
-# End Source File
-# Begin Source File
-
-SOURCE=.\URL_Properties.i
-# End Source File
-# End Target
-# End Project
|