diff options
author | Steve Huston <shuston@riverace.com> | 2006-12-28 22:58:26 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2006-12-28 22:58:26 +0000 |
commit | 452570e85ad2f7724b51107bc77b05982c804a10 (patch) | |
tree | b3b2b831d8a62a05831c4bc9207149e68192e926 /ACE | |
parent | c488ca8806ee434911ba24a22c14a2bbc0889b61 (diff) | |
download | ATCD-452570e85ad2f7724b51107bc77b05982c804a10.tar.gz |
ChangeLogTag:Thu Dec 28 22:47:05 UTC 2006 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE')
-rw-r--r-- | ACE/ChangeLog | 44 | ||||
-rw-r--r-- | ACE/NEWS | 27 | ||||
-rw-r--r-- | ACE/ace/Msg_WFMO_Reactor.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/SOCK_Dgram.cpp | 16 | ||||
-rw-r--r-- | ACE/ace/SOCK_IO.h | 30 | ||||
-rw-r--r-- | ACE/ace/SOCK_IO.inl | 40 | ||||
-rw-r--r-- | ACE/ace/Service_Gestalt.cpp | 5 | ||||
-rw-r--r-- | ACE/ace/Service_Repository.cpp | 44 | ||||
-rw-r--r-- | ACE/ace/Service_Repository.h | 50 |
9 files changed, 153 insertions, 105 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index bb954ccf6a6..086a915c9bc 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,47 @@ +Thu Dec 28 22:47:05 UTC 2006 Steve Huston <shuston@riverace.com> + + * ace/SOCK_IO.{h, inl}: Changed the + recvv(iovec[], size_t, const ACE_Time_Value* = 0) and + sendv (const iovec[], size_t, const ACE_Time_Value*=0) methods + to specify the iovec count argument as int instead of size_t + since it gets reduced to int in the underlying OS calls (usually). + Removed the following deprecated methods: + + ssize_t recv (iovec iov[], + size_t n, + const ACE_Time_Value *timeout = 0) const; + + ssize_t recv (iovec *io_vec, + const ACE_Time_Value *timeout = 0) const; + + ssize_t send (const iovec iov[], + size_t n, + const ACE_Time_Value *timeout = 0) const; + + These were previously replaced with more specific ...v() methods. + + * ace/SOCK_Dgram.cpp (recv): Resolved ssize_t to u_long truncation + warning. + + * ace/Service_Repository.{h cpp} (find, find_i): Changed the + ignore_suspended argument from int to bool to reflect it's true/false + nature. + Changed find_i() to return the located name's index in a size_t + argument when located - this allows it to pass indices as big as the + table can hold. The return value -1, -2 is not changed, but >= 0 + is no longer returned; it's == 0 for success, and the caller needs + to get the index from the 'slot' argument. This should cause no + issues since find_i() is private and internal use has been adjusted + to match; callers of find() have no use for an index value for a + table internal to ACE_Service_Repository. + + * ace/Service_Gestalt.cpp (~ACE_Service_Type_Dynamic_Guard): Use of + ACE_Service_Repository::find_i() adjusted per above. + + * ace/Msg_WFMO_Reactor.cpp: Resolve truncation warning for 64-bit. + + * NEWS: Updated with API changes noted above. + Thu Dec 28 20:56:28 UTC 2006 Iliyan Jeliazkov <iliyan@ociweb.com> * bin/tao_orb_tests.lst: @@ -17,6 +17,33 @@ PLANNED CHANGES FOR "ACE-5.5.5" USER VISIBLE CHANGES BETWEEN ACE-5.5.4 and ACE-5.5.5 ==================================================== +. ACE_SOCK_IO::recvv(iovec[], size_t, const ACE_Time_Value* = 0) and + ACE_SOCK_IO::sendv (const iovec[], size_t, const ACE_Time_Value* = 0) methods + were changed to specify the iovec count argument as int instead of size_t + since it gets reduced to int in the underlying OS calls (usually). + +. The following deprecated methods were removed: + + ssize_t ACE_SOCK_IO::recv (iovec iov[], + size_t n, + const ACE_Time_Value *timeout = 0) const; + + ssize_t ACE_SOCK_IO::recv (iovec *io_vec, + const ACE_Time_Value *timeout = 0) const; + + ssize_t ACE_SOCK_IO::send (const iovec iov[], + size_t n, + const ACE_Time_Value *timeout = 0) const; + + These were previously replaced with more specific recvv() and sendv() + methods. + +. The ACE_Service_Repository::find(const ACE_TCHAR name[], + const ACE_Service_Type **srp = 0, + int ignore_suspended = true) const + method's 'ignore_suspended' parameter was changed from int to bool to + reflect it's purpose as a yes/no indicator. + . Added --enable-ace-reactor-notification-queue configure script option to the autoconf build for enabling the Reactor's userspace notification queue (defines ACE_HAS_REACTOR_NOTIFICATION_QUEUE in diff --git a/ACE/ace/Msg_WFMO_Reactor.cpp b/ACE/ace/Msg_WFMO_Reactor.cpp index aaedb391b51..868c631c53b 100644 --- a/ACE/ace/Msg_WFMO_Reactor.cpp +++ b/ACE/ace/Msg_WFMO_Reactor.cpp @@ -68,7 +68,7 @@ ACE_Msg_WFMO_Reactor::dispatch_window_messages (void) if (msg.message == WM_QUIT) { // Should inform the main thread - ::PostQuitMessage (msg.wParam); + ::PostQuitMessage (LOWORD (msg.wParam)); return -1; } diff --git a/ACE/ace/SOCK_Dgram.cpp b/ACE/ace/SOCK_Dgram.cpp index 8943d0a8871..d406e0e4f5e 100644 --- a/ACE/ace/SOCK_Dgram.cpp +++ b/ACE/ace/SOCK_Dgram.cpp @@ -9,6 +9,7 @@ #include "ace/OS_NS_sys_select.h" #include "ace/OS_NS_ctype.h" #include "ace/os_include/net/os_if.h" +#include "ace/Truncate.h" #if !defined (__ACE_INLINE__) # include "ace/SOCK_Dgram.inl" @@ -97,14 +98,23 @@ ACE_SOCK_Dgram::recv (iovec *io_vec, ACE_NEW_RETURN (io_vec->iov_base, char[inlen], -1); - io_vec->iov_len = ACE_OS::recvfrom (this->get_handle (), + ssize_t rcv_len = ACE_OS::recvfrom (this->get_handle (), (char *) io_vec->iov_base, inlen, flags, (sockaddr *) saddr, &addr_len); - addr.set_size (addr_len); - return io_vec->iov_len; + if (rcv_len < 0) + { + delete [] io_vec->iov_base; + io_vec->iov_base = 0; + } + else + { + io_vec->iov_len = ACE_Utils::Truncate<size_t> (rcv_len); + addr.set_size (addr_len); + } + return rcv_len; } else return 0; diff --git a/ACE/ace/SOCK_IO.h b/ACE/ace/SOCK_IO.h index b59421602ac..252ec68d0cd 100644 --- a/ACE/ace/SOCK_IO.h +++ b/ACE/ace/SOCK_IO.h @@ -70,21 +70,10 @@ public: const ACE_Time_Value *timeout = 0) const; /// Recv an <iovec> of size <n> from the connected socket. - /** - * @note The value of @a n will be silently reduced to the maximum - * value an @c int can hold if needed. This is due to the underlying - * system calls on many OSes limiting the number of @c iovec structures - * that can be passed in one call. - */ ssize_t recvv (iovec iov[], - size_t n, + int n, const ACE_Time_Value *timeout = 0) const; - /// @deprecated Same as above. Deprecated. - ssize_t recv (iovec iov[], - size_t n, - const ACE_Time_Value *timeout = 0) const; - /** * Allows a client to read from a socket without having to provide a * buffer to read. This method determines how much data is in the @@ -96,10 +85,6 @@ public: ssize_t recvv (iovec *io_vec, const ACE_Time_Value *timeout = 0) const; - /// Same as above. Deprecated. - ssize_t recv (iovec *io_vec, - const ACE_Time_Value *timeout = 0) const; - /// Recv <n> varargs messages to the connected socket. ssize_t recv (size_t n, ...) const; @@ -121,21 +106,10 @@ public: const ACE_Time_Value *timeout = 0) const; /// Send an <iovec> of size <n> to the connected socket. - /** - * @note The value of @a n will be silently reduced to the maximum - * value an @c int can hold if needed. This is due to the underlying - * system calls on many OSes limiting the number of @c iovec structures - * that can be passed in one call. - */ ssize_t sendv (const iovec iov[], - size_t n, + int n, const ACE_Time_Value *timeout = 0) const; - /// Same as above. Deprecated. - ssize_t send (const iovec iov[], - size_t n, - const ACE_Time_Value *timeout = 0) const; - /// Send <n> varargs messages to the connected socket. ssize_t send (size_t n, ...) const; diff --git a/ACE/ace/SOCK_IO.inl b/ACE/ace/SOCK_IO.inl index f1aec4af3b8..0721c33fd0d 100644 --- a/ACE/ace/SOCK_IO.inl +++ b/ACE/ace/SOCK_IO.inl @@ -3,7 +3,6 @@ // $Id$ #include "ace/OS_NS_unistd.h" -#include "ace/Truncate.h" ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -49,37 +48,17 @@ ACE_SOCK_IO::recv (void *buf, ACE_INLINE ssize_t ACE_SOCK_IO::recvv (iovec iov[], - size_t n, + int n, const ACE_Time_Value *timeout) const { ACE_TRACE ("ACE_SOCK_IO::recvv"); return ACE::recvv (this->get_handle (), iov, - ACE_Utils::Truncate<size_t> (n), + n, timeout); } ACE_INLINE ssize_t -ACE_SOCK_IO::recv (iovec iov[], - size_t n, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::recv"); - return this->recvv (iov, - n, - timeout); -} - -ACE_INLINE ssize_t -ACE_SOCK_IO::recv (iovec *io_vec, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::recv"); - return this->recvv (io_vec, - timeout); -} - -ACE_INLINE ssize_t ACE_SOCK_IO::recv (void *buf, size_t n, ACE_OVERLAPPED *overlapped) const @@ -119,28 +98,17 @@ ACE_SOCK_IO::send (const void *buf, ACE_INLINE ssize_t ACE_SOCK_IO::sendv (const iovec iov[], - size_t n, + int n, const ACE_Time_Value *timeout) const { ACE_TRACE ("ACE_SOCK_IO::sendv"); return ACE::sendv (this->get_handle (), iov, - ACE_Utils::Truncate<size_t> (n), + n, timeout); } ACE_INLINE ssize_t -ACE_SOCK_IO::send (const iovec iov[], - size_t n, - const ACE_Time_Value *timeout) const -{ - ACE_TRACE ("ACE_SOCK_IO::send"); - return this->sendv (iov, - n, - timeout); -} - -ACE_INLINE ssize_t ACE_SOCK_IO::send (const void *buf, size_t n, ACE_OVERLAPPED *overlapped) const diff --git a/ACE/ace/Service_Gestalt.cpp b/ACE/ace/Service_Gestalt.cpp index 756ac4de993..4d2492daac2 100644 --- a/ACE/ace/Service_Gestalt.cpp +++ b/ACE/ace/Service_Gestalt.cpp @@ -138,12 +138,13 @@ ACE_Service_Type_Dynamic_Guard::~ACE_Service_Type_Dynamic_Guard (void) // Lookup without ignoring suspended services. Making sure // not to ignore any inactive services, since those may be forward // declarations - int const ret = this->repo_.find_i (this->name_, &tmp, 0); + size_t slot = 0; + int const ret = this->repo_.find_i (this->name_, slot, &tmp, false); // We inserted it (as inactive), so we expect to find it, right? if (ret < 0 && ret != -2) { - if(ACE::debug ()) + if (ACE::debug ()) ACE_ERROR ((LM_WARNING, ACE_LIB_TEXT ("ACE (%P|%t) STDG::<dtor> - Failed (%d) to find %s\n"), ret, this->name_)); diff --git a/ACE/ace/Service_Repository.cpp b/ACE/ace/Service_Repository.cpp index c3b63ac5a97..df0bdc8f136 100644 --- a/ACE/ace/Service_Repository.cpp +++ b/ACE/ace/Service_Repository.cpp @@ -247,8 +247,9 @@ ACE_Service_Repository::~ACE_Service_Repository (void) int ACE_Service_Repository::find_i (const ACE_TCHAR name[], + size_t &slot, const ACE_Service_Type **srp, - int ignore_suspended) const + bool ignore_suspended) const { ACE_TRACE ("ACE_Service_Repository::find_i"); size_t i; @@ -260,6 +261,7 @@ ACE_Service_Repository::find_i (const ACE_TCHAR name[], if (i < this->current_size_) { + slot = i; if (this->service_vector_[i]->fini_called ()) { if (srp != 0) @@ -272,7 +274,7 @@ ACE_Service_Repository::find_i (const ACE_TCHAR name[], if (ignore_suspended && this->service_vector_[i]->active () == 0) return -2; - return i; + return 0; } else return -1; @@ -320,12 +322,12 @@ ACE_Service_Repository::relocate_i (size_t begin, int ACE_Service_Repository::find (const ACE_TCHAR name[], const ACE_Service_Type **srp, - int ignore_suspended) const + bool ignore_suspended) const { ACE_TRACE ("ACE_Service_Repository::find"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); - - return this->find_i (name, srp, ignore_suspended); + size_t ignore_location = 0; + return this->find_i (name, ignore_location, srp, ignore_suspended); } @@ -414,9 +416,8 @@ ACE_Service_Repository::resume (const ACE_TCHAR name[], ACE_TRACE ("ACE_Service_Repository::resume"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); - int i = this->find_i (name, srp, 0); - - if (i == -1) + size_t i = 0; + if (-1 == this->find_i (name, i, srp, 0)) return -1; return this->service_vector_[i]->resume (); @@ -431,9 +432,8 @@ ACE_Service_Repository::suspend (const ACE_TCHAR name[], { ACE_TRACE ("ACE_Service_Repository::suspend"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); - int i = this->find_i (name, srp, 0); - - if (i == -1) + size_t i = 0; + if (-1 == this->find_i (name, i, srp, 0)) return -1; return this->service_vector_[i]->suspend (); @@ -491,21 +491,19 @@ ACE_Service_Repository::remove (const ACE_TCHAR name[], ACE_Service_Type **ps) int ACE_Service_Repository::remove_i (const ACE_TCHAR name[], ACE_Service_Type **ps) { - int i = this->find_i (name, 0, 0); - - // Not found - if (i == -1) - return -1; + size_t i = 0; + if (-1 == this->find_i (name, i, 0, false)) + return -1; // Not found - // We may need the old ptr - to be delete outside the lock! - *ps = const_cast<ACE_Service_Type *> (this->service_vector_[i]); + // We may need the old ptr - to be delete outside the lock! + *ps = const_cast<ACE_Service_Type *> (this->service_vector_[i]); - // Pack the array - --this->current_size_; - for (size_t j = i; j < this->current_size_; j++) - this->service_vector_[j] = this->service_vector_[j+1]; + // Pack the array + --this->current_size_; + for (size_t j = i; j < this->current_size_; j++) + this->service_vector_[j] = this->service_vector_[j+1]; - return 0; + return 0; } ACE_ALLOC_HOOK_DEFINE(ACE_Service_Repository_Iterator) diff --git a/ACE/ace/Service_Repository.h b/ACE/ace/Service_Repository.h index 8cd55344d29..4041688ee9a 100644 --- a/ACE/ace/Service_Repository.h +++ b/ACE/ace/Service_Repository.h @@ -95,16 +95,24 @@ public: int insert (const ACE_Service_Type *); /** - * Locate an entry with <name> in the table. If <ignore_suspended> - * is set then only consider services marked as resumed. If the - * caller wants the located entry, pass back a pointer to the - * located entry via <srp>. If <name> is not found, -1 is returned. - * If <name> is found, but it is suspended and the caller wants to - * ignore suspended services a -2 is returned. + * Locate a named entry in the service table, optionally ignoring + * suspended entries. + * + * @param service_name The name of the service to search for. + * @param srp Optional; if not 0, it is a pointer to a location + * to receive the ACE_Service_Type pointer for the + * located service. Meaningless if this method + * returns -1. + * @param ignore_suspended If true, the search ignores suspended services. + * + * @retval 0 Named service was located. + * @retval -1 Named service was not found. + * @retval -2 Named service was found, but is suspended and + * @a ignore_suspended is true. */ int find (const ACE_TCHAR name[], const ACE_Service_Type **srp = 0, - int ignore_suspended = 1) const; + bool ignore_suspended = true) const; /// Remove an existing service record. If @a sr == 0, the service record /// is deleted before control is returned to the caller. If @a sr != 0, @@ -141,12 +149,30 @@ private: /// responsible for properly disposing of it. int remove_i (const ACE_TCHAR[], ACE_Service_Type **sr); - /// Locates <service_name>. Must be called without locks being - /// held... - + /** + * Locate a named entry in the service table, optionally ignoring + * suspended entries. + * + * @param service_name The name of the service to search for. + * @param slot Receives the position index of the service if it + * is found. Contents are meaningless if this method + * returns -1. + * @param srp Optional; if not 0, it is a pointer to a location + * to receive the ACE_Service_Type pointer for the + * located service. Meaningless if this method + * returns -1. + * @param ignore_suspended If true, the search ignores suspended services. + * + * @retval 0 Named service was located; index in the table is set in + * @a slot. + * @retval -1 Named service was not found. + * @retval -2 Named service was found, but is suspended and + * @a ignore_suspended is true. + */ int find_i (const ACE_TCHAR service_name[], - const ACE_Service_Type ** = 0, - int ignore_suspended = 1) const; + size_t &slot, + const ACE_Service_Type **srp = 0, + bool ignore_suspended = true) const; /// @brief Relocate (static) services to another DLL. /// |