mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 01:37:00 +00:00
Some missing from merge.
Signed-off-by: Salja <salja2012@hotmail.de>
This commit is contained in:
parent
ec939a5bce
commit
f4be15a7af
1895 changed files with 160408 additions and 53601 deletions
|
|
@ -1,3 +1,5 @@
|
|||
// $Id: Log_Record.cpp 97058 2013-04-19 14:41:18Z huangh $
|
||||
|
||||
#include "ace/Log_Record.h"
|
||||
|
||||
#include "ace/Log_Msg.h"
|
||||
|
|
@ -125,14 +127,10 @@ ACE_Log_Record::msg_data (const ACE_TCHAR *data)
|
|||
size_t const newlen = ACE_OS::strlen (data) + 1; // Will need room for '\0'
|
||||
if (newlen > this->msg_data_size_)
|
||||
{
|
||||
this->msg_data_size_ = 0;
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_Allocator::instance()->free(this->msg_data_);
|
||||
ACE_ALLOCATOR_RETURN (this->msg_data_, static_cast<ACE_TCHAR*>(ACE_Allocator::instance()->malloc(sizeof(ACE_TCHAR) * newlen)), -1);
|
||||
#else
|
||||
ACE_TCHAR *new_msg_data = 0;
|
||||
ACE_NEW_RETURN (new_msg_data, ACE_TCHAR[newlen], -1);
|
||||
delete [] this->msg_data_;
|
||||
ACE_NEW_RETURN (this->msg_data_, ACE_TCHAR[newlen], -1);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
this->msg_data_ = new_msg_data;
|
||||
this->msg_data_size_ = newlen;
|
||||
}
|
||||
ACE_OS::strcpy (this->msg_data_, data);
|
||||
|
|
@ -153,11 +151,7 @@ ACE_Log_Record::ACE_Log_Record (ACE_Log_Priority lp,
|
|||
category_(0)
|
||||
{
|
||||
// ACE_TRACE ("ACE_Log_Record::ACE_Log_Record");
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_NORETURN (this->msg_data_, static_cast<ACE_TCHAR*> (ACE_Allocator::instance()->malloc(sizeof(ACE_TCHAR) * MAXLOGMSGLEN)));
|
||||
#else
|
||||
ACE_NEW_NORETURN (this->msg_data_, ACE_TCHAR[MAXLOGMSGLEN]);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
if (0 != this->msg_data_)
|
||||
{
|
||||
this->msg_data_size_ = MAXLOGMSGLEN;
|
||||
|
|
@ -178,11 +172,7 @@ ACE_Log_Record::ACE_Log_Record (ACE_Log_Priority lp,
|
|||
category_(0)
|
||||
{
|
||||
// ACE_TRACE ("ACE_Log_Record::ACE_Log_Record");
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_NORETURN (this->msg_data_, static_cast<ACE_TCHAR*> (ACE_Allocator::instance()->malloc(sizeof(ACE_TCHAR) * MAXLOGMSGLEN)));
|
||||
#else
|
||||
ACE_NEW_NORETURN (this->msg_data_, ACE_TCHAR[MAXLOGMSGLEN]);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
if (0 != this->msg_data_)
|
||||
{
|
||||
this->msg_data_size_ = MAXLOGMSGLEN;
|
||||
|
|
@ -214,11 +204,7 @@ ACE_Log_Record::ACE_Log_Record (void)
|
|||
category_(0)
|
||||
{
|
||||
// ACE_TRACE ("ACE_Log_Record::ACE_Log_Record");
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_NORETURN (this->msg_data_, static_cast<ACE_TCHAR*> (ACE_Allocator::instance()->malloc(sizeof(ACE_TCHAR) * MAXLOGMSGLEN)));
|
||||
#else
|
||||
ACE_NEW_NORETURN (this->msg_data_, ACE_TCHAR[MAXLOGMSGLEN]);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
if (0 != this->msg_data_)
|
||||
{
|
||||
this->msg_data_size_ = MAXLOGMSGLEN;
|
||||
|
|
@ -229,7 +215,7 @@ ACE_Log_Record::ACE_Log_Record (void)
|
|||
int
|
||||
ACE_Log_Record::format_msg (const ACE_TCHAR host_name[],
|
||||
u_long verbose_flag,
|
||||
ACE_TCHAR *verbose_msg, size_t verbose_msg_size)
|
||||
ACE_TCHAR *verbose_msg)
|
||||
{
|
||||
/* 012345678901234567890123456 */
|
||||
/* yyyy-mm-dd hh:mm:ss.mmmmmm<nul> */
|
||||
|
|
@ -268,7 +254,7 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[],
|
|||
const ACE_TCHAR *lhost_name = ((host_name == 0)
|
||||
? ACE_TEXT ("<local_host>")
|
||||
: host_name);
|
||||
ACE_OS::snprintf (verbose_msg, verbose_msg_size,
|
||||
ACE_OS::sprintf (verbose_msg,
|
||||
verbose_fmt,
|
||||
timestamp,
|
||||
lhost_name,
|
||||
|
|
@ -277,7 +263,7 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[],
|
|||
this->msg_data_);
|
||||
}
|
||||
else if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE_LITE))
|
||||
ACE_OS::snprintf (verbose_msg, verbose_msg_size,
|
||||
ACE_OS::sprintf (verbose_msg,
|
||||
verbose_lite_fmt,
|
||||
timestamp,
|
||||
ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)),
|
||||
|
|
@ -303,14 +289,9 @@ ACE_Log_Record::print (const ACE_TCHAR host_name[],
|
|||
if ( log_priority_enabled(this->category(), ACE_Log_Priority (this->type_)) )
|
||||
{
|
||||
ACE_TCHAR *verbose_msg = 0;
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN (verbose_msg, static_cast<ACE_TCHAR *>(ACE_Allocator::instance()->malloc(sizeof(ACE_TCHAR) * MAXVERBOSELOGMSGLEN)), -1);
|
||||
#else
|
||||
ACE_NEW_RETURN (verbose_msg, ACE_TCHAR[MAXVERBOSELOGMSGLEN], -1);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
int result = this->format_msg (host_name, verbose_flag, verbose_msg,
|
||||
MAXVERBOSELOGMSGLEN);
|
||||
int result = this->format_msg (host_name, verbose_flag, verbose_msg);
|
||||
|
||||
if (result == 0)
|
||||
{
|
||||
|
|
@ -335,11 +316,7 @@ ACE_Log_Record::print (const ACE_TCHAR host_name[],
|
|||
}
|
||||
}
|
||||
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_Allocator::instance()->free(verbose_msg);
|
||||
#else
|
||||
delete [] verbose_msg;
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -384,12 +361,8 @@ operator>> (ACE_InputCDR &cdr,
|
|||
if ((cdr >> type) && (cdr >> pid) && (cdr >> sec) && (cdr >> usec)
|
||||
&& (cdr >> buffer_len)) {
|
||||
ACE_TCHAR *log_msg;
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN (log_msg, static_cast<ACE_TCHAR *> (ACE_Allocator::instance()->malloc(sizeof(ACE_TCHAR) * (buffer_len + 1))), -1);
|
||||
#else
|
||||
ACE_NEW_RETURN (log_msg, ACE_TCHAR[buffer_len + 1], -1);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
ACE_Auto_Basic_Array_Ptr<ACE_TCHAR> log_msg_p (log_msg);
|
||||
auto_ptr<ACE_TCHAR> log_msg_p (log_msg);
|
||||
log_record.type (type);
|
||||
log_record.pid (pid);
|
||||
log_record.time_stamp (ACE_Time_Value (ACE_Utils::truncate_cast<time_t> (sec),
|
||||
|
|
@ -418,8 +391,7 @@ ACE_Log_Record::print (const ACE_TCHAR host_name[],
|
|||
ACE_TCHAR* verbose_msg = 0;
|
||||
ACE_NEW_RETURN (verbose_msg, ACE_TCHAR[MAXVERBOSELOGMSGLEN], -1);
|
||||
|
||||
int const result = this->format_msg (host_name, verbose_flag, verbose_msg,
|
||||
MAXVERBOSELOGMSGLEN);
|
||||
int const result = this->format_msg (host_name, verbose_flag, verbose_msg);
|
||||
|
||||
if (result == 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue