mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +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,12 +1,10 @@
|
|||
// $Id: Codecs.cpp 96985 2013-04-11 15:50:32Z huangh $
|
||||
|
||||
#include "ace/Codecs.h"
|
||||
#include "ace/Log_Category.h"
|
||||
#include "ace/OS_Memory.h"
|
||||
#include "ace/OS_NS_ctype.h"
|
||||
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
# include "ace/Malloc_Base.h"
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
namespace
|
||||
{
|
||||
// Just in case ...
|
||||
|
|
@ -51,11 +49,7 @@ ACE_Base64::encode (const ACE_Byte* input,
|
|||
size_t length = ((input_len + 2) / 3) * 4;
|
||||
size_t num_lines = length / max_columns + 1;
|
||||
length += num_lines + 1;
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN (result, static_cast<ACE_Byte*> (ACE_Allocator::instance()->malloc(sizeof (ACE_Byte) * length)), 0);
|
||||
#else
|
||||
ACE_NEW_RETURN (result, ACE_Byte[length], 0);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
int char_count = 0;
|
||||
int bits = 0;
|
||||
|
|
@ -143,12 +137,7 @@ ACE_Base64::decode (const ACE_Byte* input, size_t* output_len)
|
|||
|
||||
size_t result_len = ACE_Base64::length (input);
|
||||
ACE_Byte* result = 0;
|
||||
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_ALLOCATOR_RETURN (result, static_cast<ACE_Byte*> (ACE_Allocator::instance()->malloc(sizeof (ACE_Byte) * result_len)), 0);
|
||||
#else
|
||||
ACE_NEW_RETURN (result, ACE_Byte[result_len], 0);
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
ACE_Byte* ptr = const_cast<ACE_Byte*> (input);
|
||||
while (*ptr != 0 &&
|
||||
|
|
@ -217,11 +206,7 @@ ACE_Base64::decode (const ACE_Byte* input, size_t* output_len)
|
|||
|
||||
if (errors)
|
||||
{
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
ACE_Allocator::instance()->free(result);
|
||||
#else
|
||||
delete[] result;
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
return 0;
|
||||
}
|
||||
result[pos] = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue