mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 16:16:27 +00:00
chore(Deps/Acelite): Update to 6.5.10 (#3450)
This commit is contained in:
166
deps/acelite/ace/ACE.cpp
vendored
166
deps/acelite/ace/ACE.cpp
vendored
@@ -108,6 +108,12 @@ ACE::beta_version (void)
|
||||
return ACE_BETA_VERSION;
|
||||
}
|
||||
|
||||
u_int
|
||||
ACE::micro_version (void)
|
||||
{
|
||||
return ACE_MICRO_VERSION;
|
||||
}
|
||||
|
||||
const ACE_TCHAR *
|
||||
ACE::compiler_name (void)
|
||||
{
|
||||
@@ -158,7 +164,9 @@ ACE::nibble2hex (u_int n)
|
||||
bool
|
||||
ACE::debug (void)
|
||||
{
|
||||
static const char* debug = ACE_OS::getenv ("ACELIB_DEBUG");
|
||||
//FUZZ: disable check_for_ace_log_categories
|
||||
static const char *debug = ACE_OS::getenv ("ACE_DEBUG");
|
||||
//FUZZ: enable check_for_ace_log_categories
|
||||
return (ACE::debug_ != 0) ? ACE::debug_ : (debug != 0 ? (*debug != '0') : false);
|
||||
}
|
||||
|
||||
@@ -909,7 +917,7 @@ ACE::recv_n_i (ACE_HANDLE handle,
|
||||
// number of (char *ptr, int len) tuples. However, the count N is the
|
||||
// *total* number of trailing arguments, *not* a couple of the number
|
||||
// of tuple pairs!
|
||||
|
||||
#if !defined (ACE_LACKS_VA_FUNCTIONS)
|
||||
ssize_t
|
||||
ACE::recv (ACE_HANDLE handle, size_t n, ...)
|
||||
{
|
||||
@@ -919,9 +927,16 @@ ACE::recv (ACE_HANDLE handle, size_t n, ...)
|
||||
#if defined (ACE_HAS_ALLOCA)
|
||||
iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
|
||||
#else
|
||||
# ifdef ACE_HAS_ALLOC_HOOKS
|
||||
ACE_ALLOCATOR_RETURN (iovp, (iovec *)
|
||||
ACE_Allocator::instance ()->malloc (total_tuples *
|
||||
sizeof (iovec)),
|
||||
-1);
|
||||
# else
|
||||
ACE_NEW_RETURN (iovp,
|
||||
iovec[total_tuples],
|
||||
-1);
|
||||
# endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
#endif /* !defined (ACE_HAS_ALLOCA) */
|
||||
|
||||
va_start (argp, n);
|
||||
@@ -934,11 +949,17 @@ ACE::recv (ACE_HANDLE handle, size_t n, ...)
|
||||
|
||||
ssize_t const result = ACE_OS::recvv (handle, iovp, total_tuples);
|
||||
#if !defined (ACE_HAS_ALLOCA)
|
||||
# ifdef ACE_HAS_ALLOC_HOOKS
|
||||
ACE_Allocator::instance ()->free (iovp);
|
||||
# else
|
||||
delete [] iovp;
|
||||
# endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
#endif /* !defined (ACE_HAS_ALLOCA) */
|
||||
va_end (argp);
|
||||
return result;
|
||||
}
|
||||
#endif /* ACE_LACKS_VA_FUNCTIONS */
|
||||
|
||||
|
||||
ssize_t
|
||||
ACE::recvv (ACE_HANDLE handle,
|
||||
@@ -993,7 +1014,6 @@ ACE::recvv_n_i (ACE_HANDLE handle,
|
||||
if (result != -1)
|
||||
{
|
||||
// Blocking subsided. Continue data transfer.
|
||||
n = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1057,7 +1077,6 @@ ACE::recvv_n_i (ACE_HANDLE handle,
|
||||
{
|
||||
// Blocking subsided in <timeout> period. Continue
|
||||
// data transfer.
|
||||
n = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1684,7 +1703,7 @@ ACE::send_n_i (ACE_HANDLE handle,
|
||||
// the ints (basically, an varargs version of writev). The count N is
|
||||
// the *total* number of trailing arguments, *not* a couple of the
|
||||
// number of tuple pairs!
|
||||
|
||||
#if !defined (ACE_LACKS_VA_FUNCTIONS)
|
||||
ssize_t
|
||||
ACE::send (ACE_HANDLE handle, size_t n, ...)
|
||||
{
|
||||
@@ -1694,9 +1713,16 @@ ACE::send (ACE_HANDLE handle, size_t n, ...)
|
||||
#if defined (ACE_HAS_ALLOCA)
|
||||
iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
|
||||
#else
|
||||
# ifdef ACE_HAS_ALLOC_HOOKS
|
||||
ACE_ALLOCATOR_RETURN (iovp, (iovec *)
|
||||
ACE_Allocator::instance ()->malloc (total_tuples *
|
||||
sizeof (iovec)),
|
||||
-1);
|
||||
# else
|
||||
ACE_NEW_RETURN (iovp,
|
||||
iovec[total_tuples],
|
||||
-1);
|
||||
# endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
#endif /* !defined (ACE_HAS_ALLOCA) */
|
||||
|
||||
va_start (argp, n);
|
||||
@@ -1709,11 +1735,16 @@ ACE::send (ACE_HANDLE handle, size_t n, ...)
|
||||
|
||||
ssize_t result = ACE_OS::sendv (handle, iovp, total_tuples);
|
||||
#if !defined (ACE_HAS_ALLOCA)
|
||||
# ifdef ACE_HAS_ALLOC_HOOKS
|
||||
ACE_Allocator::instance ()->free (iovp);
|
||||
# else
|
||||
delete [] iovp;
|
||||
# endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
#endif /* !defined (ACE_HAS_ALLOCA) */
|
||||
va_end (argp);
|
||||
return result;
|
||||
}
|
||||
#endif /* ACE_LACKS_VA_FUNCTIONS */
|
||||
|
||||
ssize_t
|
||||
ACE::sendv (ACE_HANDLE handle,
|
||||
@@ -1773,7 +1804,6 @@ ACE::sendv_n_i (ACE_HANDLE handle,
|
||||
if (result != -1)
|
||||
{
|
||||
// Blocking subsided. Continue data transfer.
|
||||
n = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1843,7 +1873,6 @@ ACE::sendv_n_i (ACE_HANDLE handle,
|
||||
{
|
||||
// Blocking subsided in <timeout> period. Continue
|
||||
// data transfer.
|
||||
n = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -2162,9 +2191,9 @@ ACE::writev_n (ACE_HANDLE handle,
|
||||
int
|
||||
ACE::handle_ready (ACE_HANDLE handle,
|
||||
const ACE_Time_Value *timeout,
|
||||
int read_ready,
|
||||
int write_ready,
|
||||
int exception_ready)
|
||||
bool read_ready,
|
||||
bool write_ready,
|
||||
bool exception_ready)
|
||||
{
|
||||
#if defined (ACE_HAS_POLL)
|
||||
ACE_UNUSED_ARG (exception_ready);
|
||||
@@ -2285,6 +2314,7 @@ ACE::format_hexdump (const char *buffer,
|
||||
|
||||
// We can fit 16 bytes output in text mode per line, 4 chars per byte.
|
||||
size_t maxlen = (obuf_sz / 68) * 16;
|
||||
const ACE_TCHAR *const obuf_start = obuf;
|
||||
|
||||
if (size > maxlen)
|
||||
size = maxlen;
|
||||
@@ -2299,22 +2329,20 @@ ACE::format_hexdump (const char *buffer,
|
||||
for (j = 0 ; j < 16; j++)
|
||||
{
|
||||
c = (u_char) buffer[(i << 4) + j]; // or, buffer[i*16+j]
|
||||
ACE_OS::sprintf (obuf,
|
||||
ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start),
|
||||
ACE_TEXT ("%02x "),
|
||||
c);
|
||||
obuf += 3;
|
||||
if (j == 7)
|
||||
{
|
||||
ACE_OS::sprintf (obuf,
|
||||
ACE_TEXT (" "));
|
||||
++obuf;
|
||||
*obuf++ = ACE_TEXT (' ');
|
||||
}
|
||||
textver[j] = ACE_OS::ace_isprint (c) ? c : u_char ('.');
|
||||
}
|
||||
|
||||
textver[j] = 0;
|
||||
|
||||
ACE_OS::sprintf (obuf,
|
||||
ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start),
|
||||
#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
|
||||
ACE_TEXT (" %ls\n"),
|
||||
#else
|
||||
@@ -2331,35 +2359,31 @@ ACE::format_hexdump (const char *buffer,
|
||||
for (i = 0 ; i < size % 16; i++)
|
||||
{
|
||||
c = (u_char) buffer[size - size % 16 + i];
|
||||
ACE_OS::sprintf (obuf,
|
||||
ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start),
|
||||
ACE_TEXT ("%02x "),
|
||||
c);
|
||||
obuf += 3;
|
||||
if (i == 7)
|
||||
{
|
||||
ACE_OS::sprintf (obuf,
|
||||
ACE_TEXT (" "));
|
||||
++obuf;
|
||||
*obuf++ = ACE_TEXT (' ');
|
||||
}
|
||||
textver[i] = ACE_OS::ace_isprint (c) ? c : u_char ('.');
|
||||
}
|
||||
|
||||
for (i = size % 16; i < 16; i++)
|
||||
{
|
||||
ACE_OS::sprintf (obuf,
|
||||
ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start),
|
||||
ACE_TEXT (" "));
|
||||
obuf += 3;
|
||||
if (i == 7)
|
||||
{
|
||||
ACE_OS::sprintf (obuf,
|
||||
ACE_TEXT (" "));
|
||||
++obuf;
|
||||
*obuf++ = ACE_TEXT (' ');
|
||||
}
|
||||
textver[i] = ' ';
|
||||
}
|
||||
|
||||
textver[i] = 0;
|
||||
ACE_OS::sprintf (obuf,
|
||||
ACE_OS::snprintf (obuf, obuf_sz - (obuf - obuf_start),
|
||||
#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
|
||||
ACE_TEXT (" %ls\n"),
|
||||
#else
|
||||
@@ -2370,11 +2394,10 @@ ACE::format_hexdump (const char *buffer,
|
||||
return size;
|
||||
}
|
||||
|
||||
// Returns the current timestamp in the form
|
||||
// "hour:minute:second:microsecond." The month, day, and year are
|
||||
// also stored in the beginning of the date_and_time array
|
||||
// using ISO-8601 format.
|
||||
|
||||
/// Returns the current timestamp in the form
|
||||
/// "hour:minute:second:microsecond." The month, day, and year are
|
||||
/// also stored in the beginning of the date_and_time array
|
||||
/// using ISO-8601 format.
|
||||
ACE_TCHAR *
|
||||
ACE::timestamp (ACE_TCHAR date_and_time[],
|
||||
size_t date_and_timelen,
|
||||
@@ -2386,13 +2409,12 @@ ACE::timestamp (ACE_TCHAR date_and_time[],
|
||||
return_pointer_to_first_digit);
|
||||
}
|
||||
|
||||
// Returns the given timestamp in the form
|
||||
// "hour:minute:second:microsecond." The month, day, and year are
|
||||
// also stored in the beginning of the date_and_time array
|
||||
// using ISO-8601 format.
|
||||
// 012345678901234567890123456
|
||||
// 2010-12-02 12:56:00.123456<nul>
|
||||
|
||||
/// Returns the given timestamp in the form
|
||||
/// "hour:minute:second:microsecond." The month, day, and year are
|
||||
/// also stored in the beginning of the date_and_time array
|
||||
/// using ISO-8601 format.
|
||||
/// 012345678901234567890123456
|
||||
/// 2010-12-02 12:56:00.123456<nul>
|
||||
ACE_TCHAR *
|
||||
ACE::timestamp (const ACE_Time_Value& time_value,
|
||||
ACE_TCHAR date_and_time[],
|
||||
@@ -2429,8 +2451,7 @@ ACE::timestamp (const ACE_Time_Value& time_value,
|
||||
return &date_and_time[10 + (return_pointer_to_first_digit != 0)];
|
||||
}
|
||||
|
||||
// This function rounds the request to a multiple of the page size.
|
||||
|
||||
/// This function rounds the request to a multiple of the page size.
|
||||
size_t
|
||||
ACE::round_to_pagesize (size_t len)
|
||||
{
|
||||
@@ -2612,8 +2633,7 @@ ACE::handle_timed_complete (ACE_HANDLE h,
|
||||
return h;
|
||||
}
|
||||
|
||||
// Wait up to <timeout> amount of time to accept a connection.
|
||||
|
||||
/// Wait up to @a timeout amount of time to accept a connection.
|
||||
int
|
||||
ACE::handle_timed_accept (ACE_HANDLE listener,
|
||||
ACE_Time_Value *timeout,
|
||||
@@ -2682,9 +2702,8 @@ ACE::handle_timed_accept (ACE_HANDLE listener,
|
||||
}
|
||||
}
|
||||
|
||||
// Make the current process a UNIX daemon. This is based on Stevens
|
||||
// code from APUE.
|
||||
|
||||
/// Make the current process a UNIX daemon. This is based on Stevens
|
||||
/// code from APUE.
|
||||
int
|
||||
ACE::daemonize (const ACE_TCHAR pathname[],
|
||||
bool close_all_handles,
|
||||
@@ -2770,7 +2789,7 @@ ACE::fork (const ACE_TCHAR *program_name,
|
||||
{
|
||||
case 0: // grandchild returns 0.
|
||||
return 0;
|
||||
case -1: // assumes all errnos are < 256
|
||||
case static_cast<pid_t>(-1): // assumes all errnos are < 256
|
||||
ACE_OS::_exit (errno);
|
||||
default: // child terminates, orphaning grandchild
|
||||
ACE_OS::_exit (0);
|
||||
@@ -2816,7 +2835,7 @@ ACE::max_handles (void)
|
||||
# endif /* RLIM_INFINITY */
|
||||
#endif /* RLIMIT_NOFILE && !ACE_LACKS_RLIMIT */
|
||||
|
||||
#if defined (_SC_OPEN_MAX)
|
||||
#if defined (_SC_OPEN_MAX) && !defined (ACE_LACKS_SYSCONF)
|
||||
return static_cast<int> (ACE_OS::sysconf (_SC_OPEN_MAX));
|
||||
#elif defined (FD_SETSIZE)
|
||||
return FD_SETSIZE;
|
||||
@@ -2888,7 +2907,7 @@ ACE::set_handle_limit (int new_limit,
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Euclid's greatest common divisor algorithm.
|
||||
/// Euclid's greatest common divisor algorithm.
|
||||
u_long
|
||||
ACE::gcd (u_long x, u_long y)
|
||||
{
|
||||
@@ -2903,7 +2922,7 @@ ACE::gcd (u_long x, u_long y)
|
||||
}
|
||||
|
||||
|
||||
// Calculates the minimum enclosing frame size for the given values.
|
||||
/// Calculates the minimum enclosing frame size for the given values.
|
||||
u_long
|
||||
ACE::minimum_frame_size (u_long period1, u_long period2)
|
||||
{
|
||||
@@ -3104,7 +3123,9 @@ ACE::sock_error (int error)
|
||||
return ACE_TEXT ("destination address required");
|
||||
/* NOTREACHED */
|
||||
default:
|
||||
ACE_OS::sprintf (unknown_msg, ACE_TEXT ("unknown error: %d"), error);
|
||||
ACE_OS::snprintf (unknown_msg,
|
||||
sizeof unknown_msg / sizeof unknown_msg[0],
|
||||
ACE_TEXT ("unknown error: %d"), error);
|
||||
return unknown_msg;
|
||||
/* NOTREACHED */
|
||||
}
|
||||
@@ -3188,9 +3209,15 @@ ACE::strndup (const char *str, size_t n)
|
||||
continue;
|
||||
|
||||
char *s;
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN (s,
|
||||
(char *) ACE_Allocator::instance()->malloc (len + 1),
|
||||
0);
|
||||
#else
|
||||
ACE_ALLOCATOR_RETURN (s,
|
||||
(char *) ACE_OS::malloc (len + 1),
|
||||
0);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
return ACE_OS::strsncpy (s, str, len + 1);
|
||||
}
|
||||
|
||||
@@ -3209,11 +3236,18 @@ ACE::strndup (const wchar_t *str, size_t n)
|
||||
len++)
|
||||
continue;
|
||||
|
||||
wchar_t *s;
|
||||
size_t const size = (len + 1) * sizeof (wchar_t);
|
||||
wchar_t *s = 0;
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN (s,
|
||||
static_cast<wchar_t *> (
|
||||
ACE_OS::malloc ((len + 1) * sizeof (wchar_t))),
|
||||
static_cast<wchar_t*> (
|
||||
ACE_Allocator::instance ()->malloc (size)),
|
||||
0);
|
||||
#else
|
||||
ACE_ALLOCATOR_RETURN (s,
|
||||
static_cast<wchar_t*> (ACE_OS::malloc (size)),
|
||||
0);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
return ACE_OS::strsncpy (s, str, len + 1);
|
||||
}
|
||||
#endif /* ACE_HAS_WCHAR */
|
||||
@@ -3233,9 +3267,17 @@ ACE::strnnew (const char *str, size_t n)
|
||||
continue;
|
||||
|
||||
char *s;
|
||||
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN (s,
|
||||
static_cast<char*> (ACE_Allocator::instance ()->malloc (sizeof (char) * (len + 1))),
|
||||
0);
|
||||
#else
|
||||
ACE_NEW_RETURN (s,
|
||||
char[len + 1],
|
||||
0);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
return ACE_OS::strsncpy (s, str, len + 1);
|
||||
}
|
||||
|
||||
@@ -3288,9 +3330,16 @@ ACE::strnew (const char *s)
|
||||
if (s == 0)
|
||||
return 0;
|
||||
char *t = 0;
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN (t,
|
||||
static_cast<char*> (ACE_Allocator::instance ()->malloc (sizeof (char) * (ACE_OS::strlen (s) + 1))),
|
||||
0);
|
||||
#else
|
||||
ACE_NEW_RETURN (t,
|
||||
char [ACE_OS::strlen (s) + 1],
|
||||
0);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
return ACE_OS::strcpy (t, s);
|
||||
}
|
||||
|
||||
@@ -3300,10 +3349,19 @@ ACE::strnew (const wchar_t *s)
|
||||
{
|
||||
if (s == 0)
|
||||
return 0;
|
||||
|
||||
size_t const n = ACE_OS::strlen (s) + 1;
|
||||
wchar_t *t = 0;
|
||||
ACE_NEW_RETURN (t,
|
||||
wchar_t[ACE_OS::strlen (s) + 1],
|
||||
0);
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN (t,
|
||||
static_cast<wchar_t*> (
|
||||
ACE_Allocator::instance ()->malloc (
|
||||
sizeof (wchar_t) * (n))),
|
||||
0);
|
||||
#else
|
||||
ACE_NEW_RETURN (t, wchar_t[n], 0);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
return ACE_OS::strcpy (t, s);
|
||||
}
|
||||
#endif /* ACE_HAS_WCHAR */
|
||||
|
||||
Reference in New Issue
Block a user