From 520ba0e779a775127ec47ab4d6858a135ea6e9a5 Mon Sep 17 00:00:00 2001 From: stanleyk Date: Tue, 5 Feb 2013 17:06:29 +0000 Subject: Merged changes from trunk. --- ACE/ChangeLog | 27 ++ ACE/OCI_RE_ChangeLog | 13 + ACE/ace/Auto_Event.h | 10 +- ACE/bin/valgrind.supp | 9 + ACE/protocols/ace/INet/FTP_Simple_exec.cpp | 203 -------------- ACE/protocols/ace/INet/HTTP_Simple_exec.cpp | 300 --------------------- ACE/protocols/ace/INet/inet.mpc | 41 --- ACE/protocols/examples/INet/FTP_Simple_exec.cpp | 203 ++++++++++++++ ACE/protocols/examples/INet/HTTP_Simple_exec.cpp | 300 +++++++++++++++++++++ ACE/protocols/examples/INet/inet.mpc | 42 +++ ACE/tests/CDR_Test.cpp | 3 + CIAO/ChangeLog | 19 ++ CIAO/bin/ciao_tests.lst | 2 +- .../dds4ccm/impl/DDS_Base_Connector_T.cpp | 21 +- CIAO/tests/Bug_4087_Regression/test.idl | 2 + TAO/ChangeLog | 32 +++ TAO/OCI_RE_ChangeLog | 13 + TAO/bin/tao_orb_tests.lst | 2 +- TAO/docs/Options.html | 72 ++--- .../PortableGroup/UIPMC_Mcast_Transport.cpp | 14 +- TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp | 68 +++-- TAO/tao/AnyTypeCode/Any_Dual_Impl_T.h | 7 + TAO/tao/GIOP_Message_Base.cpp | 26 ++ TAO/tests/Bug_4082_Regression/run_test.pl | 20 ++ 24 files changed, 826 insertions(+), 623 deletions(-) delete mode 100644 ACE/protocols/ace/INet/FTP_Simple_exec.cpp delete mode 100644 ACE/protocols/ace/INet/HTTP_Simple_exec.cpp create mode 100644 ACE/protocols/examples/INet/FTP_Simple_exec.cpp create mode 100644 ACE/protocols/examples/INet/HTTP_Simple_exec.cpp create mode 100644 ACE/protocols/examples/INet/inet.mpc create mode 100755 TAO/tests/Bug_4082_Regression/run_test.pl diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 972a9ddac2a..3db1bdf1e4b 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,30 @@ +Mon Feb 4 08:58:35 UTC 2013 Johnny Willemsen + + * protocols/ace/INet/inet.mpc: + * protocols/ace/INet/FTP_Simple_exec.cpp: + * protocols/ace/INet/HTTP_Simple_exec.cpp: + * protocols/examples/INet/FTP_Simple_exec.cpp: + * protocols/examples/INet/HTTP_Simple_exec.cpp: + * protocols/examples/INet/inet.mpc: + Moved INet examples out of the ace/INet directory and into + a new example directory + +Sat Feb 2 19:08:18 UTC 2013 Johnny Willemsen + + * ace/Auto_Event.h: + Layout changes + +Thu Jan 31 19:21:31 UTC 2013 Johnny Willemsen + + * tests/CDR_Test.cpp: + Test CDR_Size::write_boolean_array, according to Coverity + this method was not tested + +Wed Jan 30 11:58:00 UTC 2013 Simon Massey + + * bin/valgrind.supp: + Add a supression for a faulty system zlib. + Mon Jan 28 23:33:25 UTC 2013 Adam Mitz * include/makeinclude/platform_sunos5_g++.GNU: diff --git a/ACE/OCI_RE_ChangeLog b/ACE/OCI_RE_ChangeLog index 1b36813ade6..f9290fcb4d8 100644 --- a/ACE/OCI_RE_ChangeLog +++ b/ACE/OCI_RE_ChangeLog @@ -1,3 +1,16 @@ +Tue Feb 5 17:01:48 UTC 2013 "Kevin Stanley" + + * ace/Auto_Event.h: + * bin/valgrind.supp: + * protocols/ace/INet/inet.mpc: + * protocols/examples/INet: + * tests/CDR_Test.cpp: + * protocols/ace/INet/FTP_Simple_exec.cpp: + * protocols/ace/INet/HTTP_Simple_exec.cpp: + + Merged changes from trunk in preparation for merge. The + above files had changes. + Thu Jan 31 22:39:53 UTC 2013 Phillip LaBanca * ace/Message_Block.cpp: diff --git a/ACE/ace/Auto_Event.h b/ACE/ace/Auto_Event.h index 3cf0aaf889d..5e62ca242f8 100644 --- a/ACE/ace/Auto_Event.h +++ b/ACE/ace/Auto_Event.h @@ -74,7 +74,8 @@ public: const char *name = 0, void *arg = 0) : ACE_Auto_Event_T (initial_state, type, name, arg) - {} + { + } #if defined (ACE_HAS_WCHAR) /// Constructor which will create auto event (wchar_t version) @@ -83,11 +84,14 @@ public: const wchar_t *name, void *arg = 0) : ACE_Auto_Event_T (initial_state, type, name, arg) - {} + { + } #endif /* ACE_HAS_WCHAR */ /// Default dtor. - virtual ~ACE_Auto_Event (void) {} + virtual ~ACE_Auto_Event (void) + { + } }; ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/ACE/bin/valgrind.supp b/ACE/bin/valgrind.supp index f5965b6903b..ced872249fe 100644 --- a/ACE/bin/valgrind.supp +++ b/ACE/bin/valgrind.supp @@ -304,3 +304,12 @@ fun:_ZN3ACE10nibble2hexEj fun:_ZN5CORBA3ORB16object_to_stringEPNS_6ObjectE } + +{ + + Memcheck:Cond + obj:/usr/lib/libz.so.1.2.3 + obj:/usr/lib/libz.so.1.2.3 + fun:deflate + fun:compress2 +} \ No newline at end of file diff --git a/ACE/protocols/ace/INet/FTP_Simple_exec.cpp b/ACE/protocols/ace/INet/FTP_Simple_exec.cpp deleted file mode 100644 index 8381f2aaf45..00000000000 --- a/ACE/protocols/ace/INet/FTP_Simple_exec.cpp +++ /dev/null @@ -1,203 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" -#include "ace/OS_NS_errno.h" -#include "FTP_URL.h" -#include "FTP_ClientRequestHandler.h" -#include -#include - -ACE_CString url; -ACE_CString outfile; -bool do_login = false; -ACE_CString password; -bool do_active = false; - -void -usage (void) -{ - std::cout << "usage: ftp_simple_wget [options] \n"; - std::cout << "Executes an FTP download request and sends the result to STDOUT or file\n"; - std::cout << "\t-a\t\tuse active mode for data connections\n"; - std::cout << "\t-o \t\tfile to write output to\n"; - std::cout << "\t-l\t\task for password at login\n"; - std::cout << "\t-p \t\tuse for login\n"; -} - -bool -parse_args (int argc, ACE_TCHAR *argv []) -{ - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("ao:lp:h"), 0, 0, ACE_Get_Opt::RETURN_IN_ORDER); - - int c; - ACE_CString s; - while ((c = get_opt ()) != EOF) - { - switch (c) - { - case 1: - url = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); - break; - - case 'a': - do_active = true; - break; - - case 'o': - outfile = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); - break; - - case 'l': - do_login = true; - break; - - case 'p': - password = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); - break; - - case 'h': - default: - usage (); - return false; - } - } - - return true; -} - -class My_Authenticator - : public ACE::INet::AuthenticatorBase -{ - public: - My_Authenticator () {} - ~My_Authenticator () {} - - virtual bool authenticate(ACE::INet::AuthenticationBase& auth) const - { - if (!password.empty ()) auth.password (password); - if (do_login) - { - std::cout << "Authentication (" << auth.scheme() << ") required." << std::endl; - std::cout << "Realm : " << auth.realm () << std::endl - << "User: " << auth.user() << std::endl - << "Password: \t\t\t (Enter password or press enter for default)\rPassword: "; - char buf[80] = {0}; - u_int n = 0; - int ch = 0; - while (n < (sizeof(buf)-1) && (ch = std::cin.get ()) != '\n' && ch != std::char_traits::eof ()) - { - buf[n++] = char(ch); - } - if (n>0) - auth.password (buf); - } - return true; - } -}; - -class My_FTP_RequestHandler - : public ACE::FTP::ClientRequestHandler -{ - public: - My_FTP_RequestHandler () : read_length_ (0) {} - virtual ~My_FTP_RequestHandler () {} - - protected: - virtual void handle_request_error (const ACE::FTP::URL& url) - { - std::cout << "ERROR" << std::endl; - std::cerr << "Failed to handle download for " << url.to_string ().c_str () << std::endl; - } - - virtual void handle_connection_error (const ACE::FTP::URL& url) - { - std::cout << "ERROR" << std::endl; - std::cerr << "Failed to set up connection for " << url.to_string ().c_str () << std::endl; - } - - virtual void after_read (const char_type* /*buffer*/, int length_read) - { - this->read_length_ += length_read; - std::cout << "\r [" << this->read_length_ << "/???]"; - } - - virtual void on_eof () - { - ACE::FTP::ClientRequestHandler::on_eof (); - std::cout << std::endl; - } - - private: - int read_length_; -}; - -int -ACE_TMAIN (int argc, ACE_TCHAR *argv []) -{ - ACE_Auto_Ptr fout; - std::ostream* sout = &std::cout; - - if (!parse_args (argc, argv)) - { - return 1; - } - - ACE::INet::URL_INetAuthBase::add_authenticator ("my_auth", - new My_Authenticator); - - std::cout << "Starting..." << std::endl; - - if (!url.empty ()) - { - if (!outfile.empty ()) - { - fout.reset (new std::ofstream (outfile.c_str (), std::ios_base::binary|std::ios_base::out)); - - if (!*fout) - { - std::cerr << "Failed to open output file : " << outfile.c_str () << std::endl; - return 1; - } - - sout = fout.get (); - } - - ACE::FTP::URL ftp_url; - - std::cout << "Parsing url [" << url.c_str () << "]" << std::endl; - - if (!ftp_url.parse (url)) - { - std::cerr << "Failed parsing url [" << url << "]" << std::endl; - std::cerr << "\tresult = " << ftp_url.to_string ().c_str (); - return 1; - } - - std::cout << "Opening url..." << std::endl; - My_FTP_RequestHandler my_rh; - if (do_active) my_rh.use_active_mode (); - ACE::INet::URLStream urlin = ftp_url.open (my_rh); - if (urlin) - { - std::cout << "Saving to: "; - if (!outfile.empty ()) - std::cout << '\'' << outfile.c_str () << '\'' << std::endl; - else - std::cout << "(stdout)" << std::endl; - - (*sout) << urlin->rdbuf (); - sout->flush (); - } - } - else - { - std::cerr << "ERROR: No URL specified!" << std::endl; - usage (); - return 1; - } - - std::cout << "Done" << std::endl; - - return 0; -} diff --git a/ACE/protocols/ace/INet/HTTP_Simple_exec.cpp b/ACE/protocols/ace/INet/HTTP_Simple_exec.cpp deleted file mode 100644 index 9dda462b99a..00000000000 --- a/ACE/protocols/ace/INet/HTTP_Simple_exec.cpp +++ /dev/null @@ -1,300 +0,0 @@ -// $Id$ - -#include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" -#include "ace/OS_NS_errno.h" -#include "ace/INet/HTTP_URL.h" -#include "ace/INet/HTTP_ClientRequestHandler.h" -#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 -# include "ace/INet/SSL_CallbackManager.h" -# include "ace/INet/HTTPS_Context.h" -#endif -#include "ace/INet/INet_Log.h" -#include -#include - -ACE_CString proxy_hostname; -u_short proxy_port = ACE::HTTP::URL::HTTP_PROXY_PORT; -ACE_CString url; -ACE_CString outfile; -#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 -int ssl_mode = ACE_SSL_Context::SSLv3; -bool verify_peer = true; -bool ignore_verify = false; -ACE_CString certificate; -ACE_CString private_key; -ACE_CString ca_location; -#endif - -void -usage (void) -{ - std::cout << "usage: http_simple_wget [options] \n"; - std::cout << "Executes an HTTP GET request and sends the result to STDOUT or file\n"; - std::cout << "\t-H \t\tproxy host to connect to\n"; - std::cout << "\t-p \t\tproxy port to connect to\n"; - std::cout << "\t-o \t\tfile to write output to\n"; -#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 - std::cout << "\t-v \t\tSSL version to use: "; -#if !defined (OPENSSL_NO_SSL2) - std::cout << "2, "; -#endif /* OPENSSL_NO_SSL2 */ - std::cout << "23, 3\n"; - std::cout << "\t-n \t\tno peer certificate verification\n"; - std::cout << "\t-i \t\tignore peer certificate verification failures\n"; - std::cout << "\t-c \t\tcertificate file (PEM format)\n"; - std::cout << "\t-k \t\tprivate key file (PEM format); requires -c\n"; - std::cout << "\t-C \t\ttrusted CA file or directory\n"; -#endif -} - -bool -parse_args (int argc, ACE_TCHAR *argv []) -{ -#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("H:p:o:hv:nic:k:C:"), 0, 0, ACE_Get_Opt::RETURN_IN_ORDER); -#else - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("H:p:o:h"), 0, 0, ACE_Get_Opt::RETURN_IN_ORDER); -#endif - - int c; - ACE_CString s; - while ((c = get_opt ()) != EOF) - { - switch (c) - { - case 1: - url = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); - break; - case 'H': - proxy_hostname = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); - break; - - case 'p': - proxy_port = (u_short)ACE_OS::atoi (ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ())); - break; - - case 'o': - outfile = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); - break; - -#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 - case 'v': - { - ACE_CString ver = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); - if (ver == "23") - ssl_mode = ACE_SSL_Context::SSLv23; -#if !defined (OPENSSL_NO_SSL2) - else if (ver == "2") - ssl_mode = ACE_SSL_Context::SSLv2; -#endif /* ! OPENSSL_NO_SSL2*/ - else if (ver != "3") // default mode - { - std::cerr << "ERROR: Invalid SSL mode [" << ver << "] specfied!" << std::endl; - return false; - } - } - break; - - case 'n': - verify_peer = false; - break; - - case 'i': - ignore_verify = true; - break; - - case 'c': - certificate = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); - break; - - case 'k': - private_key = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); - break; - - case 'C': - ca_location = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); - break; -#endif - case 'h': - default: - usage (); - return false; - } - } - - return true; -} - -class My_HTTP_RequestHandler - : public ACE::HTTP::ClientRequestHandler -{ - public: - My_HTTP_RequestHandler () : in_length_ (0), read_length_ (0) {} - virtual ~My_HTTP_RequestHandler () {} - - protected: - virtual void handle_request_error (const ACE::HTTP::URL& url) - { - std::cout << "ERROR" << std::endl; - std::cerr << "Failed to handle request for " << url.to_string ().c_str () << std::endl; - } - - virtual void handle_connection_error (const ACE::HTTP::URL& url) - { - std::cout << "ERROR" << std::endl; - std::cerr << "Failed to set up connection for " << url.to_string ().c_str () << std::endl; - } - - virtual void after_read (const char_type* /*buffer*/, int length_read) - { - if (this->read_length_ == 0) - { - this->in_length_ = this->response ().get_content_length (); - } - this->read_length_ += length_read; - std::cout << "\r [" << this->read_length_ << '/'; - if (this->in_length_ != ACE::HTTP::Response::UNKNOWN_CONTENT_LENGTH) - { - std::cout << this->in_length_ << "] " << ((this->read_length_ * 100) / this->in_length_) << "%"; - } - else - std::cout << "???]"; - std::cout.flush (); - } - - virtual void on_eof () - { - ACE::HTTP::ClientRequestHandler::on_eof (); - std::cout << std::endl; - this->read_length_ = 0; - } - - private: - int in_length_; - int read_length_; -}; - -int -ACE_TMAIN (int argc, ACE_TCHAR *argv []) -{ - ACE_Auto_Ptr fout; - std::ostream* sout = &std::cout; - - if (!parse_args (argc, argv)) - { - return 1; - } - -#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 - ACE::HTTPS::Context::set_default_ssl_mode (ssl_mode); - ACE::HTTPS::Context::set_default_verify_mode (verify_peer); - ACE::HTTPS::Context::instance ().use_default_ca (); - if (!private_key.empty ()) - { - if (certificate.empty ()) - { - std::cerr << "ERROR: private key file [" << private_key << "] requires certificate file to be specified." << std::endl; - return 1; - } - if (!ACE::HTTPS::Context::instance ().set_key_files (private_key.c_str (), certificate.c_str ())) - { - std::cerr << "ERROR: failed to set private key [" << private_key << "]." << std::endl; - return 1; - } - } - if (!ca_location.empty ()) - { - INET_DEBUG (6, (LM_INFO, DLINFO ACE_TEXT ("loading trusted CA [%C]\n"), ca_location.c_str ())); - if (!ACE::HTTPS::Context::instance ().load_trusted_ca (ca_location.c_str ())) - { - std::cerr << "ERROR: failed to load trusted CA from [" << ca_location << "]." << std::endl; - return 1; - } - INET_DEBUG (6, (LM_INFO, DLINFO ACE_TEXT ("loaded [%d] trusted CA\n"), ACE::HTTPS::Context::instance ().has_trusted_ca ())); - } - if (ignore_verify) - ACE::INet::SSL_CallbackManager::instance ()->set_certificate_callback (new ACE::INet::SSL_CertificateAcceptor); -#endif - - std::cout << "Starting..." << std::endl; - - if (!url.empty ()) - { - if (!outfile.empty ()) - { - fout.reset (new std::ofstream (outfile.c_str (), std::ios_base::binary|std::ios_base::out)); - - if (!*fout) - { - std::cerr << "Failed to open output file : " << outfile.c_str () << std::endl; - return 1; - } - - sout = fout.get (); - } - - std::cout << "Parsing url [" << url.c_str () << "]" << std::endl; - - ACE_Auto_Ptr url_safe (ACE::INet::URL_Base::create_from_string (url)); - - if (url_safe.get () == 0 || url != url_safe->to_string ()) - { - std::cerr << "Failed parsing url [" << url << "]" << std::endl; - std::cerr << "\tresult = " << (url_safe.get () == 0 ? "(null)" : url_safe->to_string ().c_str ()) << std::endl; - return 1; - } - - ACE::HTTP::URL& http_url = *dynamic_cast (url_safe.get ()); - - if (!proxy_hostname.empty ()) - { - std::cout << "Setting proxy: " << proxy_hostname.c_str () << ':' << proxy_port << std::endl; - http_url.set_proxy (proxy_hostname, proxy_port); - } - - std::cout << "Opening url..."; - My_HTTP_RequestHandler my_rh; - ACE::INet::URLStream urlin = http_url.open (my_rh); - if (urlin) - { - std::cout << "Received response " - << (int)my_rh.response ().get_status ().get_status () - << " " - << my_rh.response ().get_status ().get_reason ().c_str () - << std::endl; - if (my_rh.response ().get_status ().is_ok ()) - { - std::cout << "Length: "; - if (my_rh.response ().get_content_length () != ACE::HTTP::Response::UNKNOWN_CONTENT_LENGTH) - std::cout << my_rh.response ().get_content_length () << " ["; - else - std::cout << "(unknown) ["; - if (my_rh.response ().get_content_type () != ACE::HTTP::Response::UNKNOWN_CONTENT_TYPE) - std::cout << my_rh.response ().get_content_type ().c_str (); - else - std::cout << "(unknown)"; - std::cout << "]" << std::endl; - } - - std::cout << "Saving to: "; - if (!outfile.empty ()) - std::cout << '\'' << outfile.c_str () << '\'' << std::endl; - else - std::cout << "(stdout)" << std::endl; - - (*sout) << urlin->rdbuf (); - sout->flush (); - } - } - else - { - std::cerr << "ERROR: No URL specified!" << std::endl; - usage (); - return 1; - } - - std::cout << "Done" << std::endl; - - return 0; -} diff --git a/ACE/protocols/ace/INet/inet.mpc b/ACE/protocols/ace/INet/inet.mpc index d7b676a4b76..9f7efdbd89c 100644 --- a/ACE/protocols/ace/INet/inet.mpc +++ b/ACE/protocols/ace/INet/inet.mpc @@ -9,7 +9,6 @@ project(INet) : acelib, ace_output, install { avoids += old_stdstream avoids += exclude_inet avoids += ace_for_tao - avoids += corba_e_compact Source_Files { IOS_util.cpp INet_Log.cpp @@ -60,43 +59,3 @@ project(INet) : acelib, ace_output, install { } } - -// This project will be generated with and without ssl=1 feature -// but will only build when the ssl macro != 1 (i.e. ssl off) -project(HTTP_Simple_exec) : aceexe, inet { - exename = http_simple_wget - Source_Files { - HTTP_Simple_exec.cpp - } - verbatim(gnuace, circuit) { - "ifeq ($(ssl),1)" - "override BIN:=" - "ifdef ARCH" - "override ARCH_BIN:=" - "endif #ARCH" - "all: avoid_warning" - "endif" - } - - verbatim(gnuace, local) { - "ifeq ($(ssl),1)" - "avoids_enabled_macros += ssl" - "endif" - } -} - -// This project will only be generated with the ssl=1 feature -// and will only build when the ssl macro = 1 (i.e. ssl on) -project(HTTPS_Simple_exec) : aceexe, inet, inetssl { - exename = https_simple_wget - Source_Files { - HTTP_Simple_exec.cpp - } -} - -project(FTP_Simple_exec) : aceexe, inet { - exename = ftp_simple_wget - Source_Files { - FTP_Simple_exec.cpp - } -} diff --git a/ACE/protocols/examples/INet/FTP_Simple_exec.cpp b/ACE/protocols/examples/INet/FTP_Simple_exec.cpp new file mode 100644 index 00000000000..48838fe3a8a --- /dev/null +++ b/ACE/protocols/examples/INet/FTP_Simple_exec.cpp @@ -0,0 +1,203 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "ace/Auto_Ptr.h" +#include "ace/OS_NS_errno.h" +#include "ace/INet/FTP_URL.h" +#include "ace/INet/FTP_ClientRequestHandler.h" +#include +#include + +ACE_CString url; +ACE_CString outfile; +bool do_login = false; +ACE_CString password; +bool do_active = false; + +void +usage (void) +{ + std::cout << "usage: ftp_simple_wget [options] \n"; + std::cout << "Executes an FTP download request and sends the result to STDOUT or file\n"; + std::cout << "\t-a\t\tuse active mode for data connections\n"; + std::cout << "\t-o \t\tfile to write output to\n"; + std::cout << "\t-l\t\task for password at login\n"; + std::cout << "\t-p \t\tuse for login\n"; +} + +bool +parse_args (int argc, ACE_TCHAR *argv []) +{ + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("ao:lp:h"), 0, 0, ACE_Get_Opt::RETURN_IN_ORDER); + + int c; + ACE_CString s; + while ((c = get_opt ()) != EOF) + { + switch (c) + { + case 1: + url = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); + break; + + case 'a': + do_active = true; + break; + + case 'o': + outfile = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); + break; + + case 'l': + do_login = true; + break; + + case 'p': + password = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); + break; + + case 'h': + default: + usage (); + return false; + } + } + + return true; +} + +class My_Authenticator + : public ACE::INet::AuthenticatorBase +{ + public: + My_Authenticator () {} + ~My_Authenticator () {} + + virtual bool authenticate(ACE::INet::AuthenticationBase& auth) const + { + if (!password.empty ()) auth.password (password); + if (do_login) + { + std::cout << "Authentication (" << auth.scheme() << ") required." << std::endl; + std::cout << "Realm : " << auth.realm () << std::endl + << "User: " << auth.user() << std::endl + << "Password: \t\t\t (Enter password or press enter for default)\rPassword: "; + char buf[80] = {0}; + u_int n = 0; + int ch = 0; + while (n < (sizeof(buf)-1) && (ch = std::cin.get ()) != '\n' && ch != std::char_traits::eof ()) + { + buf[n++] = char(ch); + } + if (n>0) + auth.password (buf); + } + return true; + } +}; + +class My_FTP_RequestHandler + : public ACE::FTP::ClientRequestHandler +{ + public: + My_FTP_RequestHandler () : read_length_ (0) {} + virtual ~My_FTP_RequestHandler () {} + + protected: + virtual void handle_request_error (const ACE::FTP::URL& url) + { + std::cout << "ERROR" << std::endl; + std::cerr << "Failed to handle download for " << url.to_string ().c_str () << std::endl; + } + + virtual void handle_connection_error (const ACE::FTP::URL& url) + { + std::cout << "ERROR" << std::endl; + std::cerr << "Failed to set up connection for " << url.to_string ().c_str () << std::endl; + } + + virtual void after_read (const char_type* /*buffer*/, int length_read) + { + this->read_length_ += length_read; + std::cout << "\r [" << this->read_length_ << "/???]"; + } + + virtual void on_eof () + { + ACE::FTP::ClientRequestHandler::on_eof (); + std::cout << std::endl; + } + + private: + int read_length_; +}; + +int +ACE_TMAIN (int argc, ACE_TCHAR *argv []) +{ + ACE_Auto_Ptr fout; + std::ostream* sout = &std::cout; + + if (!parse_args (argc, argv)) + { + return 1; + } + + ACE::INet::URL_INetAuthBase::add_authenticator ("my_auth", + new My_Authenticator); + + std::cout << "Starting..." << std::endl; + + if (!url.empty ()) + { + if (!outfile.empty ()) + { + fout.reset (new std::ofstream (outfile.c_str (), std::ios_base::binary|std::ios_base::out)); + + if (!*fout) + { + std::cerr << "Failed to open output file : " << outfile.c_str () << std::endl; + return 1; + } + + sout = fout.get (); + } + + ACE::FTP::URL ftp_url; + + std::cout << "Parsing url [" << url.c_str () << "]" << std::endl; + + if (!ftp_url.parse (url)) + { + std::cerr << "Failed parsing url [" << url << "]" << std::endl; + std::cerr << "\tresult = " << ftp_url.to_string ().c_str (); + return 1; + } + + std::cout << "Opening url..." << std::endl; + My_FTP_RequestHandler my_rh; + if (do_active) my_rh.use_active_mode (); + ACE::INet::URLStream urlin = ftp_url.open (my_rh); + if (urlin) + { + std::cout << "Saving to: "; + if (!outfile.empty ()) + std::cout << '\'' << outfile.c_str () << '\'' << std::endl; + else + std::cout << "(stdout)" << std::endl; + + (*sout) << urlin->rdbuf (); + sout->flush (); + } + } + else + { + std::cerr << "ERROR: No URL specified!" << std::endl; + usage (); + return 1; + } + + std::cout << "Done" << std::endl; + + return 0; +} diff --git a/ACE/protocols/examples/INet/HTTP_Simple_exec.cpp b/ACE/protocols/examples/INet/HTTP_Simple_exec.cpp new file mode 100644 index 00000000000..9dda462b99a --- /dev/null +++ b/ACE/protocols/examples/INet/HTTP_Simple_exec.cpp @@ -0,0 +1,300 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "ace/Auto_Ptr.h" +#include "ace/OS_NS_errno.h" +#include "ace/INet/HTTP_URL.h" +#include "ace/INet/HTTP_ClientRequestHandler.h" +#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 +# include "ace/INet/SSL_CallbackManager.h" +# include "ace/INet/HTTPS_Context.h" +#endif +#include "ace/INet/INet_Log.h" +#include +#include + +ACE_CString proxy_hostname; +u_short proxy_port = ACE::HTTP::URL::HTTP_PROXY_PORT; +ACE_CString url; +ACE_CString outfile; +#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 +int ssl_mode = ACE_SSL_Context::SSLv3; +bool verify_peer = true; +bool ignore_verify = false; +ACE_CString certificate; +ACE_CString private_key; +ACE_CString ca_location; +#endif + +void +usage (void) +{ + std::cout << "usage: http_simple_wget [options] \n"; + std::cout << "Executes an HTTP GET request and sends the result to STDOUT or file\n"; + std::cout << "\t-H \t\tproxy host to connect to\n"; + std::cout << "\t-p \t\tproxy port to connect to\n"; + std::cout << "\t-o \t\tfile to write output to\n"; +#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 + std::cout << "\t-v \t\tSSL version to use: "; +#if !defined (OPENSSL_NO_SSL2) + std::cout << "2, "; +#endif /* OPENSSL_NO_SSL2 */ + std::cout << "23, 3\n"; + std::cout << "\t-n \t\tno peer certificate verification\n"; + std::cout << "\t-i \t\tignore peer certificate verification failures\n"; + std::cout << "\t-c \t\tcertificate file (PEM format)\n"; + std::cout << "\t-k \t\tprivate key file (PEM format); requires -c\n"; + std::cout << "\t-C \t\ttrusted CA file or directory\n"; +#endif +} + +bool +parse_args (int argc, ACE_TCHAR *argv []) +{ +#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("H:p:o:hv:nic:k:C:"), 0, 0, ACE_Get_Opt::RETURN_IN_ORDER); +#else + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("H:p:o:h"), 0, 0, ACE_Get_Opt::RETURN_IN_ORDER); +#endif + + int c; + ACE_CString s; + while ((c = get_opt ()) != EOF) + { + switch (c) + { + case 1: + url = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); + break; + case 'H': + proxy_hostname = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); + break; + + case 'p': + proxy_port = (u_short)ACE_OS::atoi (ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ())); + break; + + case 'o': + outfile = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); + break; + +#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 + case 'v': + { + ACE_CString ver = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); + if (ver == "23") + ssl_mode = ACE_SSL_Context::SSLv23; +#if !defined (OPENSSL_NO_SSL2) + else if (ver == "2") + ssl_mode = ACE_SSL_Context::SSLv2; +#endif /* ! OPENSSL_NO_SSL2*/ + else if (ver != "3") // default mode + { + std::cerr << "ERROR: Invalid SSL mode [" << ver << "] specfied!" << std::endl; + return false; + } + } + break; + + case 'n': + verify_peer = false; + break; + + case 'i': + ignore_verify = true; + break; + + case 'c': + certificate = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); + break; + + case 'k': + private_key = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); + break; + + case 'C': + ca_location = ACE_TEXT_ALWAYS_CHAR (get_opt.opt_arg ()); + break; +#endif + case 'h': + default: + usage (); + return false; + } + } + + return true; +} + +class My_HTTP_RequestHandler + : public ACE::HTTP::ClientRequestHandler +{ + public: + My_HTTP_RequestHandler () : in_length_ (0), read_length_ (0) {} + virtual ~My_HTTP_RequestHandler () {} + + protected: + virtual void handle_request_error (const ACE::HTTP::URL& url) + { + std::cout << "ERROR" << std::endl; + std::cerr << "Failed to handle request for " << url.to_string ().c_str () << std::endl; + } + + virtual void handle_connection_error (const ACE::HTTP::URL& url) + { + std::cout << "ERROR" << std::endl; + std::cerr << "Failed to set up connection for " << url.to_string ().c_str () << std::endl; + } + + virtual void after_read (const char_type* /*buffer*/, int length_read) + { + if (this->read_length_ == 0) + { + this->in_length_ = this->response ().get_content_length (); + } + this->read_length_ += length_read; + std::cout << "\r [" << this->read_length_ << '/'; + if (this->in_length_ != ACE::HTTP::Response::UNKNOWN_CONTENT_LENGTH) + { + std::cout << this->in_length_ << "] " << ((this->read_length_ * 100) / this->in_length_) << "%"; + } + else + std::cout << "???]"; + std::cout.flush (); + } + + virtual void on_eof () + { + ACE::HTTP::ClientRequestHandler::on_eof (); + std::cout << std::endl; + this->read_length_ = 0; + } + + private: + int in_length_; + int read_length_; +}; + +int +ACE_TMAIN (int argc, ACE_TCHAR *argv []) +{ + ACE_Auto_Ptr fout; + std::ostream* sout = &std::cout; + + if (!parse_args (argc, argv)) + { + return 1; + } + +#if defined (ACE_HAS_SSL) && ACE_HAS_SSL == 1 + ACE::HTTPS::Context::set_default_ssl_mode (ssl_mode); + ACE::HTTPS::Context::set_default_verify_mode (verify_peer); + ACE::HTTPS::Context::instance ().use_default_ca (); + if (!private_key.empty ()) + { + if (certificate.empty ()) + { + std::cerr << "ERROR: private key file [" << private_key << "] requires certificate file to be specified." << std::endl; + return 1; + } + if (!ACE::HTTPS::Context::instance ().set_key_files (private_key.c_str (), certificate.c_str ())) + { + std::cerr << "ERROR: failed to set private key [" << private_key << "]." << std::endl; + return 1; + } + } + if (!ca_location.empty ()) + { + INET_DEBUG (6, (LM_INFO, DLINFO ACE_TEXT ("loading trusted CA [%C]\n"), ca_location.c_str ())); + if (!ACE::HTTPS::Context::instance ().load_trusted_ca (ca_location.c_str ())) + { + std::cerr << "ERROR: failed to load trusted CA from [" << ca_location << "]." << std::endl; + return 1; + } + INET_DEBUG (6, (LM_INFO, DLINFO ACE_TEXT ("loaded [%d] trusted CA\n"), ACE::HTTPS::Context::instance ().has_trusted_ca ())); + } + if (ignore_verify) + ACE::INet::SSL_CallbackManager::instance ()->set_certificate_callback (new ACE::INet::SSL_CertificateAcceptor); +#endif + + std::cout << "Starting..." << std::endl; + + if (!url.empty ()) + { + if (!outfile.empty ()) + { + fout.reset (new std::ofstream (outfile.c_str (), std::ios_base::binary|std::ios_base::out)); + + if (!*fout) + { + std::cerr << "Failed to open output file : " << outfile.c_str () << std::endl; + return 1; + } + + sout = fout.get (); + } + + std::cout << "Parsing url [" << url.c_str () << "]" << std::endl; + + ACE_Auto_Ptr url_safe (ACE::INet::URL_Base::create_from_string (url)); + + if (url_safe.get () == 0 || url != url_safe->to_string ()) + { + std::cerr << "Failed parsing url [" << url << "]" << std::endl; + std::cerr << "\tresult = " << (url_safe.get () == 0 ? "(null)" : url_safe->to_string ().c_str ()) << std::endl; + return 1; + } + + ACE::HTTP::URL& http_url = *dynamic_cast (url_safe.get ()); + + if (!proxy_hostname.empty ()) + { + std::cout << "Setting proxy: " << proxy_hostname.c_str () << ':' << proxy_port << std::endl; + http_url.set_proxy (proxy_hostname, proxy_port); + } + + std::cout << "Opening url..."; + My_HTTP_RequestHandler my_rh; + ACE::INet::URLStream urlin = http_url.open (my_rh); + if (urlin) + { + std::cout << "Received response " + << (int)my_rh.response ().get_status ().get_status () + << " " + << my_rh.response ().get_status ().get_reason ().c_str () + << std::endl; + if (my_rh.response ().get_status ().is_ok ()) + { + std::cout << "Length: "; + if (my_rh.response ().get_content_length () != ACE::HTTP::Response::UNKNOWN_CONTENT_LENGTH) + std::cout << my_rh.response ().get_content_length () << " ["; + else + std::cout << "(unknown) ["; + if (my_rh.response ().get_content_type () != ACE::HTTP::Response::UNKNOWN_CONTENT_TYPE) + std::cout << my_rh.response ().get_content_type ().c_str (); + else + std::cout << "(unknown)"; + std::cout << "]" << std::endl; + } + + std::cout << "Saving to: "; + if (!outfile.empty ()) + std::cout << '\'' << outfile.c_str () << '\'' << std::endl; + else + std::cout << "(stdout)" << std::endl; + + (*sout) << urlin->rdbuf (); + sout->flush (); + } + } + else + { + std::cerr << "ERROR: No URL specified!" << std::endl; + usage (); + return 1; + } + + std::cout << "Done" << std::endl; + + return 0; +} diff --git a/ACE/protocols/examples/INet/inet.mpc b/ACE/protocols/examples/INet/inet.mpc new file mode 100644 index 00000000000..16f42462566 --- /dev/null +++ b/ACE/protocols/examples/INet/inet.mpc @@ -0,0 +1,42 @@ +// -*- MPC -*- +// $Id$ + +// This project will be generated with and without ssl=1 feature +// but will only build when the ssl macro != 1 (i.e. ssl off) +project(HTTP_Simple_exec) : aceexe, inet { + exename = http_simple_wget + Source_Files { + HTTP_Simple_exec.cpp + } + verbatim(gnuace, circuit) { + "ifeq ($(ssl),1)" + "override BIN:=" + "ifdef ARCH" + "override ARCH_BIN:=" + "endif #ARCH" + "all: avoid_warning" + "endif" + } + + verbatim(gnuace, local) { + "ifeq ($(ssl),1)" + "avoids_enabled_macros += ssl" + "endif" + } +} + +// This project will only be generated with the ssl=1 feature +// and will only build when the ssl macro = 1 (i.e. ssl on) +project(HTTPS_Simple_exec) : aceexe, inet, inetssl { + exename = https_simple_wget + Source_Files { + HTTP_Simple_exec.cpp + } +} + +project(FTP_Simple_exec) : aceexe, inet { + exename = ftp_simple_wget + Source_Files { + FTP_Simple_exec.cpp + } +} diff --git a/ACE/tests/CDR_Test.cpp b/ACE/tests/CDR_Test.cpp index 0fc27ae2fc8..a9ff114e94f 100644 --- a/ACE/tests/CDR_Test.cpp +++ b/ACE/tests/CDR_Test.cpp @@ -118,6 +118,7 @@ short_stream (void) ACE_CDR::Long l_array[3] = { -345678, 0, 345678 }; ACE_CDR::Float f_array[3] = { -1.23f, 0.0f, 1.23f }; ACE_CDR::Double d_array[3] = { -123.456789, 0.0, 123.456789 }; + ACE_CDR::Boolean b_array[3] = { false, true, false }; ACE_OutputCDR::from_char fc (ch); ACE_OutputCDR::from_wchar fwc (wch); @@ -135,6 +136,7 @@ short_stream (void) os.write_long_array (l_array, 3); os.write_float_array (f_array, 3); os.write_double_array (d_array, 3); + os.write_boolean_array (b_array, 3); // Do the same for size stream. ss << fc; @@ -151,6 +153,7 @@ short_stream (void) ss.write_long_array (l_array, 3); ss.write_float_array (f_array, 3); ss.write_double_array (d_array, 3); + ss.write_boolean_array (b_array, 3); // Check the size. if (ss.total_length () != os.total_length ()) diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 4ca44a9819d..a78145e88b7 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,22 @@ +Mon Feb 4 08:11:50 UTC 2013 Johnny Willemsen + + * connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp (activate_topic): + Fixed logic error, when no listener is passed in we create + the default one, but always install a listener. Thanks to + Jiang Wei for + reporting this problem. This fixes bugzilla 4089 + +Sun Feb 3 18:37:32 UTC 2013 Johnny Willemsen + + * bin/ciao_tests.lst: + Added !NO_IDL3_TO_IDL2 to Bug_4087_Regression, invoking idl3_to_idl2 + means we need gcc which we don't have on all targets + +Thu Jan 31 11:33:37 UTC 2013 Johnny Willemsen + + * bin/ciao_tests.lst: + Fixed path 4087 test + Tue Jan 29 12:20:08 UTC 2013 Johnny Willemsen * tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp: diff --git a/CIAO/bin/ciao_tests.lst b/CIAO/bin/ciao_tests.lst index ea9272eb5a5..588d5ae77e9 100644 --- a/CIAO/bin/ciao_tests.lst +++ b/CIAO/bin/ciao_tests.lst @@ -41,7 +41,7 @@ TAO/CIAO/tests/Bug_3937_Regression/run_test.pl TAO/CIAO/tests/Bug_3944_Regression/run_test.pl TAO/CIAO/tests/Bug_4086_Regression/descriptors/run_test.pl: TAO/CIAO/tests/Bug_4086_Regression/descriptors/run_test_cdr.pl: -TAO/CIAO/tests/Bug_4087_Regression/descriptors/run_test.pl: +TAO/CIAO/tests/Bug_4087_Regression/run_test.pl: !NO_IDL3_TO_IDL2 TAO/CIAO/tests/IDL_Test/Cornucopia/run_test.pl: DOXYGEN TAO/CIAO/tests/Cookies/run_test.pl TAO/CIAO/tests/TTSCTest/descriptors/run_test.pl: diff --git a/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp b/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp index 68bc90fd0ae..3bddcee0e7d 100644 --- a/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp @@ -779,6 +779,8 @@ DDS_Base_Connector_T::activate_topic ( if (mask != 0) { + // If no listener has been passed in we create the default + // topic listener if (::CORBA::is_nil (listener)) { ACE_NEW_THROW_EX (listener, @@ -786,18 +788,17 @@ DDS_Base_Connector_T::activate_topic ( error_listener.in (), reactor), ::CORBA::NO_MEMORY ()); + } - DDS::ReturnCode_t const retcode = topic->set_listener (listener, - mask); + DDS::ReturnCode_t const retcode = topic->set_listener (listener, mask); - if (retcode != ::DDS::RETCODE_OK) - { - DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO - "DDS_Base_Connector_T::activate_topic - " - "Error while setting the listener on the topic - <%C>\n", - ::CIAO::DDS4CCM::translate_retcode (retcode))); - throw ::CORBA::INTERNAL (); - } + if (retcode != ::DDS::RETCODE_OK) + { + DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO + "DDS_Base_Connector_T::activate_topic - " + "Error while setting the listener on the topic - <%C>\n", + ::CIAO::DDS4CCM::translate_retcode (retcode))); + throw ::CORBA::INTERNAL (); } } } diff --git a/CIAO/tests/Bug_4087_Regression/test.idl b/CIAO/tests/Bug_4087_Regression/test.idl index e0c2aa1956d..56b0b6feea5 100644 --- a/CIAO/tests/Bug_4087_Regression/test.idl +++ b/CIAO/tests/Bug_4087_Regression/test.idl @@ -1,3 +1,5 @@ +// $Id$ + #ifndef FOO_IDL #define FOO_IDL diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 4717ec4755a..32f48c32aba 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,35 @@ +Tue Feb 5 13:46:00 UTC 2013 Simon Massey + + * docs/Options.html: + + Typo corrections. + +Fri Feb 1 15:13:31 UTC 2013 Adam Mitz + + * tao/AnyTypeCode/Any_Dual_Impl_T.h: + * tao/AnyTypeCode/Any_Dual_Impl_T.cpp: + + Fixed bug 4082: allows extraction to type that's equivalent + but not equal, as required by the spec. The common example + is different sequences with the same base type. + + * bin/tao_orb_tests.lst: + * tests/Bug_4082_Regression/run_test.pl: + + Added test script and removed condition for !FIXED_BUGS_ONLY. + +Thu Jan 31 17:46:00 UTC 2013 Simon Massey + + * orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Transport.cpp: + Remove any unprocessed but dequeued/completed messages at shutdown. + +Wed Jan 30 12:44:00 UTC 2013 Simon Massey + + * tao/GIOP_Message_Base.cpp: + Fix a memory leak of a datablock due to ZIOP decompression (possiably) + replacing it. If replaced the original db may need to be released and + the new db always does. + Tue Jan 29 11:00:00 UTC 2013 Simon Massey * orbsvcs/tests/Miop/McastFragmentation/run_test.pl: diff --git a/TAO/OCI_RE_ChangeLog b/TAO/OCI_RE_ChangeLog index 82a3f384b0a..09887403796 100644 --- a/TAO/OCI_RE_ChangeLog +++ b/TAO/OCI_RE_ChangeLog @@ -1,3 +1,16 @@ +Tue Feb 5 17:00:14 UTC 2013 "Kevin Stanley" + + * bin/tao_orb_tests.lst: + * docs/Options.html: + * orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Transport.cpp: + * tao/AnyTypeCode/Any_Dual_Impl_T.h: + * tao/AnyTypeCode/Any_Dual_Impl_T.cpp: + * tao/GIOP_Message_Base.cpp: + * tests/Bug_4082_Regression/run_test.pl: + + Merged changes from trunk in preparation for merge. The + above files had changes. + Mon Feb 4 22:57:48 UTC 2013 Kevin Stanley * orbsvcs/Naming_Service/FT_Naming_Service.h: diff --git a/TAO/bin/tao_orb_tests.lst b/TAO/bin/tao_orb_tests.lst index 2723abe0daa..307d82c9491 100644 --- a/TAO/bin/tao_orb_tests.lst +++ b/TAO/bin/tao_orb_tests.lst @@ -207,7 +207,7 @@ TAO/tests/Bug_3942_Regression/run_test.pl: !FIXED_BUGS_ONLY TAO/tests/Bug_3953_Regression/run_test.pl: !CORBA_E_MICRO TAO/tests/Bug_3954_Regression/run_test.pl: TAO/tests/Bug_4010_Regression/run_test.pl: -TAO/tests/Bug_4082_Regression/run_test.pl: !FIXED_BUGS_ONLY !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO +TAO/tests/Bug_4082_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO TAO/tests/DIOP/run_test.pl: !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO TAO/tests/DIOP/run_test_ipv6.pl: IPV6 !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO TAO/tests/RTCORBA/Activate_Object_Multiple_ORBs/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html index ecdae650c43..0161ad646bc 100644 --- a/TAO/docs/Options.html +++ b/TAO/docs/Options.html @@ -1806,7 +1806,7 @@ strategy. service configurator directive of the form (all on one line):

dynamic MIOP_Resource_Factory Service_Object * TAO_PortableGroup:_make_TAO_MIOP_Resource_Factory () ""

- Normally in order to setup the MIOP implementation correctly, the application + Normally in order to set up the MIOP implementation correctly, the application will have to use other service configurator directives as well (for example):

dynamic UIPMC_Factory Service_Object * TAO_PortableGroup:_make_TAO_UIPMC_Protocol_Factory() ""
@@ -1817,14 +1817,14 @@ strategy. dynamic MIOP_Resource_Factory Service_Object * TAO_PortableGroup:_make_TAO_MIOP_Resource_Factory () ""

Any options required to be given to the MIOP_Resource_Factory should be - specified between the two double-quotes shown above as a space seporated list; + specified between the two double-quotes shown above as a space separated list; however none are required as all options take default values if not specified. Since MIOP uses UDP sockets (which is not a "reliable" transport unlike tcp/ip) it is easy to configure MIOP in such a way that messages will not actually reach the servant. The options below are intended to maximize MIOP reliability - but they must be used with care, users of MIOP must understand that large + but they must be used with care; users of MIOP must understand that large messages are sent in fragments and they have to be reassembled by the server in - their entirety to be useable by the servant. If even a single data + their entirety to be usable by the servant. If even a single data fragment/packet is lost, the whole message cannot be reconstructed and will be unusable. There is no way for the servant to even know it has missed such a MIOP message, and being a one-way protocol, neither will the client be aware @@ -1838,7 +1838,7 @@ strategy. client-side OS simply ignores the excess send requests and some of the fragments are not actually sent on the wire.)
  • - The server socket's receive buffer became too full to aquire the fragments off + The server socket's receive buffer became too full to acquire the fragments off the wire. (In this case the client is again sending messages too fast, but this time it is the servant that is too slow to process the messages it has already received.) @@ -1849,7 +1849,7 @@ strategy.

    In the first two cases above, the loss can be mitigated by the client adapting/throttling its sending rate so as to not overflow the - capacity of the clients operating system sending buffer and the receiving + capacity of the client's operating system sending buffer and the receiving buffer of the server socket. If there are multiple clients all sending to the same server, all of these clients must be configured to slow down their sending rate (as a software system design descision) as otherwise the server's receive @@ -1870,13 +1870,13 @@ strategy. fragments that a client can break the outgoing message up into. The limit must be a positive number or zero (indicating an unlimited number). The default is normally 0 (i.e. unlimited), but this default can be overriden when - the TAO libraries are built in the ace/config.h, by specifying the + the TAO libraries are built in ace/config.h, by specifying the new default limit such as #define TAO_DEFAULT_MIOP_MAX_FRAGMENTS 1 which in this case would turn off fragmentation by default (as only a single fragment would be allowed), unless a new limit is specified in the service file. Any messages that are too large and require more fragments than allowed by this setting are simply not transmitted by the client (the message is - effectly lost without any error indication, other than possiably a debug + effectly lost without any error indication, other than possibly a debug message). This setting can be used as a safety setting to stop swamping the network and servants with abnormally large messages, or during testing to "lose" large messages for whatever reason. @@ -1896,7 +1896,7 @@ strategy. the system, but this can be overridden in the ace/config.h by giving a new value for #define TAO_DEFAULT_MIOP_FRAGMENT_SIZE 65507 when the TAO libraries are built. Note: most gateways and routing networks - define an MTU of around 1458-1500, it is therefore advisable to + define an MTU of around 1458-1500; it is therefore advisable to specify the correct ‑ORBMaxFragmentSize value otherwise some fragments may be lost. See also the ‑ORBSndSock option below. Note also if this value is changed (during development) and the ‑ORBMaxFragmentRate @@ -1970,7 +1970,7 @@ strategy. limits the maximum size of an individual message fragment, larger fragments can be simply ignored (i.e. packet loss) by the client's socket without any error indication; this value and the ‑ORBMaxFragmentSize should be - set with care. For a linux type OS, the systems SndSock is usually defaulted to + set with care. For a Linux type OS, the system's SndSock is usually defaulted to about 65535 bytes, but whatever value is actually specified it is normally doubled internally to take account of the control structures required to track the messages themselves and so it is not a hard limit. @@ -1978,19 +1978,19 @@ strategy. ‑ORBRcvSock bytes - This server-side option is the size of the incoming socket's - message buffer, i.e how much data can be received directly off the wire by the - server and queued for processing by the servant whilst it is busy. If specified - in the service configuration file, this value will override (for MIOP only) the - value specified by the corresponding ORB_init parameter. If NOT specified in - either place, the default value for the system itself will be used. Again for a - linux type OS, the systems RcvSock is usually about 65535 bytes, but - whatever value is actually specified it is normally doubled internally to take - account of the control structures required to track the messages themselves and - so it is not a hard limit. Specifying as large a value as possible (i.e. + This server-side option is the size of the incoming socket's + message buffer, i.e., how much data can be received directly off the wire by the + server and queued for processing by the servant whilst it is busy. If specified + in the service configuration file, this value will override (for MIOP only) the + value specified by the corresponding ORB_init parameter. If NOT specified in + either place, the default value for the system itself will be used. Again for a + Linux type OS, the systems RcvSock is usually about 65535 bytes, but + whatever value is actually specified it is normally doubled internally to take + account of the control structures required to track the messages themselves and + so it is not a hard limit. Specifying as large a value as possible (i.e. whatever upper limit the OS will allow) with the MIOP ‑ORBRcvSock - option is advisable to maximize the available sockets receive buffer space, but - obviosuly this is a trade off between available memory and other OS non-paged + option is advisable to maximize the available socket's receive buffer space, but + obviously this is a trade off between available memory and other OS non-paged memory uses. @@ -1999,20 +1999,20 @@ strategy. This is a server-side option that is enabled by default; although this default can be overriden when the TAO libraries are built in the ace/config.h, by specifying the new default such as #define TAO_DEFAULT_MIOP_EAGER_DEQUEUEING false - which in this case would turn this off by default, unless specified in the - service file. If disabled (0) each thread servicing the MIOP listener will only - dequeue enough MIOP message fragments from the socket receive buffer to - complete a single full MIOP message which it will then process. This action - reduces the amount of user memory consumed by the server process, but it also - increases the likelyhood of the OS sockets receive buffer overflowing (as - whilst processing each message, the thread cannot dequeue other incomming - message fragments). If enabled (1) it specifies that each server thread will - attempt to dequeue all available MIOP messages from the receiver's socket and - queue these up in a user memory FIFO queue, before attempting to process a - single MIOP message from the head of this FIFO queue. This action attempts to - speed up the dequeueing of MIOP messages from the OS socket receive buffer - (with a corresponding increase in the amount of user memory consumed by the - server process) so as to limit the number of MIOP messages that the server may + which in this case would turn this off by default, unless specified in the + service file. If disabled (0) each thread servicing the MIOP listener will only + dequeue enough MIOP message fragments from the socket receive buffer to + complete a single full MIOP message which it will then process. This action + reduces the amount of user memory consumed by the server process, but it also + increases the likelihood of the OS sockets receive buffer overflowing (as + whilst processing each message, the thread cannot dequeue other incomming + message fragments). If enabled (1) it specifies that each server thread will + attempt to dequeue all available MIOP messages from the receiver's socket and + queue these up in a user memory FIFO queue, before attempting to process a + single MIOP message from the head of this FIFO queue. This action attempts to + speed up the dequeueing of MIOP messages from the OS socket receive buffer + (with a corresponding increase in the amount of user memory consumed by the + server process) so as to limit the number of MIOP messages that the server may miss due to the OS sockets receive buffer becoming full. diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Transport.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Transport.cpp index 22459eb5b44..8c11cccec13 100644 --- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Transport.cpp +++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Transport.cpp @@ -34,6 +34,18 @@ TAO_UIPMC_Mcast_Transport::~TAO_UIPMC_Mcast_Transport (void) { // Cleanup all packets. this->cleanup_packets (false); + + // Remove any unprocessed completed messages + if (!this->complete_.is_empty ()) + { + ACE_GUARD (TAO_SYNCH_MUTEX, complete_guard, this->complete_lock_); + while (!this->complete_.is_empty ()) + { + TAO_PG::UIPMC_Recv_Packet *packet = 0; + this->complete_.dequeue_head (packet); + delete packet; + } + } } void @@ -54,7 +66,7 @@ TAO_UIPMC_Mcast_Transport::cleanup_packets (bool expired_only) else { for (Packets_Map::iterator iter = this->incomplete_.begin (); - iter != this->incomplete_.end ();) + !iter.done ();) { // Move forward iter because what it was pointing to could be // unbound at the end of the loop leaving the iterator pointing diff --git a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp index e43cfaffc26..9c743e8f007 100644 --- a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp +++ b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.cpp @@ -118,26 +118,16 @@ TAO::Any_Dual_Impl_T::extract (const CORBA::Any & any, if (narrow_impl == 0) { - return false; + TAO_OutputCDR ocdr; + impl->marshal_value (ocdr); + TAO_InputCDR icdr (ocdr); + return replace (icdr, any, destructor, any_tc, _tao_elem); } _tao_elem = narrow_impl->value_; return true; } - T *empty_value = 0; - ACE_NEW_RETURN (empty_value, - T, - false); - TAO::Any_Dual_Impl_T *replacement = 0; - ACE_NEW_RETURN (replacement, - TAO::Any_Dual_Impl_T (destructor, - any_tc, - empty_value), - false); - - auto_ptr > replacement_safety (replacement); - // We know this will work since the unencoded case is covered above. TAO::Unknown_IDL_Type * const unk = dynamic_cast (impl); @@ -149,19 +139,7 @@ TAO::Any_Dual_Impl_T::extract (const CORBA::Any & any, // shared by another Any. This copies the state, not the buffer. TAO_InputCDR for_reading (unk->_tao_get_cdr ()); - CORBA::Boolean const good_decode = - replacement->demarshal_value (for_reading); - - if (good_decode) - { - _tao_elem = replacement->value_; - const_cast (any).replace (replacement); - replacement_safety.release (); - return true; - } - - // Duplicated by Any_Impl base class constructor. - ::CORBA::release (any_tc); + return replace (for_reading, any, destructor, any_tc, _tao_elem); } catch (const ::CORBA::Exception&) { @@ -170,6 +148,42 @@ TAO::Any_Dual_Impl_T::extract (const CORBA::Any & any, return false; } +template +CORBA::Boolean +TAO::Any_Dual_Impl_T::replace (TAO_InputCDR &cdr, + const CORBA::Any &any, + _tao_destructor destructor, + CORBA::TypeCode_ptr any_tc, + const T *&_tao_elem) +{ + T *empty_value = 0; + ACE_NEW_RETURN (empty_value, + T, + false); + TAO::Any_Dual_Impl_T *replacement = 0; + ACE_NEW_RETURN (replacement, + TAO::Any_Dual_Impl_T (destructor, + any_tc, + empty_value), + false); + + auto_ptr > replacement_safety (replacement); + + CORBA::Boolean const good_decode = replacement->demarshal_value (cdr); + + if (good_decode) + { + _tao_elem = replacement->value_; + const_cast (any).replace (replacement); + replacement_safety.release (); + return true; + } + + // Duplicated by Any_Impl base class constructor. + ::CORBA::release (any_tc); + return false; +} + template CORBA::Boolean TAO::Any_Dual_Impl_T::marshal_value (TAO_OutputCDR &cdr) diff --git a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.h b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.h index be40f181aed..4a6c8f24125 100644 --- a/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.h +++ b/TAO/tao/AnyTypeCode/Any_Dual_Impl_T.h @@ -73,6 +73,13 @@ namespace TAO void value (const T &); T * value_; + + private: + static CORBA::Boolean replace (TAO_InputCDR &, + const CORBA::Any &, + _tao_destructor, + CORBA::TypeCode_ptr, + const T *&); }; } diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index f4ddd3473d5..75191cd5645 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -679,8 +679,21 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, #if defined (TAO_HAS_ZIOP) && TAO_HAS_ZIOP ==1 if (qd->state ().compressed ()) { + ACE_Data_Block *const orig_db = db; if (!this->decompress (&db, *qd, rd_pos, wr_pos)) return -1; + if (orig_db != db) + { + // Since the decompression has replaced our original datablock, + // if we were supposed to delete it, do so now. + if (ACE_BIT_DISABLED (flg, ACE_Message_Block::DONT_DELETE)) + static_cast (orig_db->release ()); + else + // and make sure that the new datablock is always deleted by + // the upcomming input_cdr going out of scope as we have been + // given ownership of it. + ACE_CLR_BITS (flg, ACE_Message_Block::DONT_DELETE); + } } #endif if (TAO_debug_level > 9) @@ -794,8 +807,21 @@ TAO_GIOP_Message_Base::process_reply_message ( #if defined (TAO_HAS_ZIOP) && TAO_HAS_ZIOP ==1 if (qd->state ().compressed ()) { + ACE_Data_Block *const orig_db = db; if (!this->decompress (&db, *qd, rd_pos, wr_pos)) return -1; + if (orig_db != db) + { + // Since the decompression has replaced our original datablock, + // if we were supposed to delete it, do so now. + if (ACE_BIT_DISABLED (flg, ACE_Message_Block::DONT_DELETE)) + static_cast (orig_db->release ()); + else + // and make sure that the new datablock is always deleted by + // the upcomming input_cdr going out of scope as we have been + // given ownership of it. + ACE_CLR_BITS (flg, ACE_Message_Block::DONT_DELETE); + } } #endif if (TAO_debug_level > 9) diff --git a/TAO/tests/Bug_4082_Regression/run_test.pl b/TAO/tests/Bug_4082_Regression/run_test.pl new file mode 100755 index 00000000000..07d3e7640cd --- /dev/null +++ b/TAO/tests/Bug_4082_Regression/run_test.pl @@ -0,0 +1,20 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::TestTarget; +use strict; + +my $target = PerlACE::TestTarget::create_target(1) + or die "Create target failed\n"; +my $test = $target->CreateProcess("client"); +my $result = $test->SpawnWaitKill($target->ProcessStartWaitInterval()); +if ($result != 0) { + print STDERR "ERROR: test returned $result\n"; + exit 1; +} +exit 0; -- cgit v1.2.1