*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk
This commit is contained in:
@@ -1,45 +1,35 @@
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// $Id: IOStream_T.inl 80826 2008-03-04 14:51:23Z wotte $
|
||||
|
||||
#include "ace/Handle_Set.h"
|
||||
#include "ace/OS_NS_errno.h"
|
||||
#include "ace/OS_NS_sys_select.h"
|
||||
|
||||
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
template <class STREAM> ACE_INLINE int
|
||||
ACE_IOStream<STREAM>::eof (void) const
|
||||
{
|
||||
// Get the timeout value of the streambuf
|
||||
ACE_Time_Value *timeout = this->streambuf_->recv_timeout (0);
|
||||
|
||||
// Reset the timeout value of the streambuf.
|
||||
(void) this->streambuf_->recv_timeout (timeout);
|
||||
|
||||
char c;
|
||||
int rval = this->streambuf_->recv_n (&c,
|
||||
sizeof c,
|
||||
MSG_PEEK,
|
||||
timeout);
|
||||
|
||||
// Timeout, not an eof
|
||||
if (this->streambuf_->timeout())
|
||||
return 0;
|
||||
|
||||
// No timeout, got enough data: not eof
|
||||
if (rval == sizeof(char))
|
||||
return 0;
|
||||
|
||||
// No timeout, not enough data: definately eof
|
||||
return 1;
|
||||
}
|
||||
|
||||
template <class STREAM> ACE_INLINE
|
||||
ACE_SOCK_Dgram_SC<STREAM>::ACE_SOCK_Dgram_SC (void)
|
||||
{
|
||||
}
|
||||
|
||||
template <class STREAM> ACE_INLINE
|
||||
ACE_SOCK_Dgram_SC<STREAM>::ACE_SOCK_Dgram_SC (STREAM &source,
|
||||
ACE_INET_Addr &dest)
|
||||
@@ -47,14 +37,12 @@ ACE_SOCK_Dgram_SC<STREAM>::ACE_SOCK_Dgram_SC (STREAM &source,
|
||||
peer_ (dest)
|
||||
{
|
||||
}
|
||||
|
||||
template <class STREAM> ACE_INLINE ssize_t
|
||||
ACE_SOCK_Dgram_SC<STREAM>::send_n (char *buf,
|
||||
ssize_t len)
|
||||
{
|
||||
return STREAM::send (buf, len, peer_);
|
||||
}
|
||||
|
||||
template <class STREAM> ACE_INLINE ssize_t
|
||||
ACE_SOCK_Dgram_SC<STREAM>::recv (char *buf,
|
||||
ssize_t len,
|
||||
@@ -64,7 +52,6 @@ ACE_SOCK_Dgram_SC<STREAM>::recv (char *buf,
|
||||
return recv (buf, len, 0, tv);
|
||||
//FUZZ: enable check_for_lack_ACE_OS
|
||||
}
|
||||
|
||||
template <class STREAM> ACE_INLINE ssize_t
|
||||
ACE_SOCK_Dgram_SC<STREAM>::recv (char *buf,
|
||||
ssize_t len,
|
||||
@@ -75,9 +62,7 @@ ACE_SOCK_Dgram_SC<STREAM>::recv (char *buf,
|
||||
{
|
||||
ACE_HANDLE handle = this->get_handle ();
|
||||
ACE_Handle_Set handle_set;
|
||||
|
||||
handle_set.set_bit (handle);
|
||||
|
||||
switch (ACE_OS::select (int (handle) + 1,
|
||||
(fd_set *) handle_set, // read_fds.
|
||||
(fd_set *) 0, // write_fds.
|
||||
@@ -92,7 +77,6 @@ ACE_SOCK_Dgram_SC<STREAM>::recv (char *buf,
|
||||
; // Do the 'recv' below
|
||||
}
|
||||
}
|
||||
|
||||
int rval = STREAM::recv (buf, len, peer_, flags);
|
||||
#if defined (ACE_WIN32)
|
||||
if (rval == SOCKET_ERROR)
|
||||
@@ -102,7 +86,6 @@ ACE_SOCK_Dgram_SC<STREAM>::recv (char *buf,
|
||||
#endif /* ACE_WIN32 */
|
||||
return rval < len ? rval : len;
|
||||
}
|
||||
|
||||
template <class STREAM> ACE_INLINE ssize_t
|
||||
ACE_SOCK_Dgram_SC<STREAM>::recv_n (char *buf,
|
||||
ssize_t len,
|
||||
@@ -112,12 +95,10 @@ ACE_SOCK_Dgram_SC<STREAM>::recv_n (char *buf,
|
||||
int rval = this->recv (buf, len, flags, tv);
|
||||
return rval;
|
||||
}
|
||||
|
||||
template <class STREAM> ACE_INLINE int
|
||||
ACE_SOCK_Dgram_SC<STREAM>::get_remote_addr (ACE_INET_Addr &addr) const
|
||||
{
|
||||
addr = peer_;
|
||||
return 0;
|
||||
}
|
||||
|
||||
ACE_END_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
Reference in New Issue
Block a user