Merge branch 'devel' into feat/hash-range

This commit is contained in:
Alex Fabijanic 2021-04-23 18:02:33 +02:00
commit d70fb9b2ba
43 changed files with 584 additions and 450 deletions

View File

@ -16,6 +16,7 @@
#include "Poco/Crypto/ECDSADigestEngine.h" #include "Poco/Crypto/ECDSADigestEngine.h"
#include "Poco/Crypto/CryptoException.h" #include "Poco/Crypto/CryptoException.h"
#include <openssl/ecdsa.h> #include <openssl/ecdsa.h>
#include <openssl/bn.h>
namespace Poco { namespace Poco {

View File

@ -155,6 +155,7 @@ void PKCS12Container::load(PKCS12* pPKCS12, const std::string& password)
{ {
_pX509Cert.reset(new X509Certificate(pCert, true)); _pX509Cert.reset(new X509Certificate(pCert, true));
_pkcsFriendlyName = extractFriendlyName(pCert); _pkcsFriendlyName = extractFriendlyName(pCert);
X509_free(pCert);
} }
else _pX509Cert.reset(); else _pX509Cert.reset();
@ -171,17 +172,22 @@ void PKCS12Container::load(PKCS12* pPKCS12, const std::string& password)
_caCertList.push_back(X509Certificate(pX509, true)); _caCertList.push_back(X509Certificate(pX509, true));
_caCertNames.push_back(extractFriendlyName(pX509)); _caCertNames.push_back(extractFriendlyName(pX509));
} }
else throw OpenSSLException("PKCS12Container::load()"); else
{
sk_X509_pop_free(pCA, X509_free);
PKCS12_free(pPKCS12);
throw OpenSSLException("PKCS12Container::load()");
}
} }
sk_X509_pop_free(pCA, X509_free);
} }
} }
else else
{ {
PKCS12_free(pPKCS12);
throw OpenSSLException(); throw OpenSSLException();
} }
PKCS12_free(pPKCS12); PKCS12_free(pPKCS12);
sk_X509_pop_free(pCA, X509_free);
if (pCert) X509_free(pCert);
poco_assert_dbg (_caCertList.size() == _caCertNames.size()); poco_assert_dbg (_caCertList.size() == _caCertNames.size());
} }
else else

View File

@ -18,13 +18,13 @@
#define Data_ODBC_Extractor_INCLUDED #define Data_ODBC_Extractor_INCLUDED
#include "Poco/Data/Constants.h"
#include "Poco/Data/ODBC/ODBC.h" #include "Poco/Data/ODBC/ODBC.h"
#include "Poco/Data/AbstractExtractor.h"
#include "Poco/Data/ODBC/Preparator.h" #include "Poco/Data/ODBC/Preparator.h"
#include "Poco/Data/ODBC/ODBCMetaColumn.h" #include "Poco/Data/ODBC/ODBCMetaColumn.h"
#include "Poco/Data/ODBC/Error.h" #include "Poco/Data/ODBC/Error.h"
#include "Poco/Data/ODBC/Utility.h" #include "Poco/Data/ODBC/Utility.h"
#include "Poco/Data/AbstractExtractor.h"
#include "Poco/Data/Constants.h"
#include "Poco/Data/Date.h" #include "Poco/Data/Date.h"
#include "Poco/Data/Time.h" #include "Poco/Data/Time.h"
#include "Poco/DateTime.h" #include "Poco/DateTime.h"
@ -52,7 +52,7 @@ class ODBC_API Extractor: public Poco::Data::AbstractExtractor
public: public:
typedef Preparator::Ptr PreparatorPtr; typedef Preparator::Ptr PreparatorPtr;
Extractor(const StatementHandle& rStmt, Extractor(const StatementHandle& rStmt,
Preparator::Ptr pPreparator); Preparator::Ptr pPreparator);
/// Creates the Extractor. /// Creates the Extractor.
@ -304,7 +304,7 @@ public:
bool extract(std::size_t pos, std::list<Poco::DateTime>& val); bool extract(std::size_t pos, std::list<Poco::DateTime>& val);
/// Extracts a DateTime list. /// Extracts a DateTime list.
bool extract(std::size_t pos, Poco::Any& val); bool extract(std::size_t pos, Poco::Any& val);
/// Extracts an Any. /// Extracts an Any.
@ -339,7 +339,7 @@ public:
/// Returns true if the value at [col,row] is null. /// Returns true if the value at [col,row] is null.
void reset(); void reset();
/// Resets the internally cached length indicators. /// Resets the internally cached length indicators.
private: private:
static const int CHUNK_SIZE = 1024; static const int CHUNK_SIZE = 1024;
@ -365,7 +365,7 @@ private:
{ {
if (isNull(pos)) return false; if (isNull(pos)) return false;
poco_assert_dbg (typeid(T) == _pPreparator->at(pos).type()); poco_assert_dbg (typeid(T) == _pPreparator->at(pos).type());
val = *AnyCast<T>(&_pPreparator->at(pos)); val = *AnyCast<T>(&_pPreparator->at(pos));
return true; return true;
} }
@ -384,7 +384,7 @@ private:
bool extractBoundImplContainer(std::size_t pos, std::vector<std::string>& values); bool extractBoundImplContainer(std::size_t pos, std::vector<std::string>& values);
bool extractBoundImplContainer(std::size_t pos, std::deque<std::string>& values); bool extractBoundImplContainer(std::size_t pos, std::deque<std::string>& values);
bool extractBoundImplContainer(std::size_t pos, std::list<std::string>& values); bool extractBoundImplContainer(std::size_t pos, std::list<std::string>& values);
bool extractBoundImplContainer(std::size_t pos, std::vector<Poco::UTF16String>& values); bool extractBoundImplContainer(std::size_t pos, std::vector<Poco::UTF16String>& values);
bool extractBoundImplContainer(std::size_t pos, std::deque<Poco::UTF16String>& values); bool extractBoundImplContainer(std::size_t pos, std::deque<Poco::UTF16String>& values);
bool extractBoundImplContainer(std::size_t pos, std::list<Poco::UTF16String>& values); bool extractBoundImplContainer(std::size_t pos, std::list<Poco::UTF16String>& values);
@ -466,8 +466,8 @@ private:
resizeLengths(pos); resizeLengths(pos);
rc = SQLGetData(_rStmt, rc = SQLGetData(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT) pos + 1,
cType, //C data type cType, //C data type
&value, //returned value &value, //returned value
0, //buffer length (ignored) 0, //buffer length (ignored)
@ -475,10 +475,10 @@ private:
if (Utility::isError(rc)) if (Utility::isError(rc))
throw StatementException(_rStmt, "SQLGetData()"); throw StatementException(_rStmt, "SQLGetData()");
if (isNullLengthIndicator(_lengths[pos])) if (isNullLengthIndicator(_lengths[pos]))
return false; return false;
else else
{ {
//for fixed-length data, buffer must be large enough //for fixed-length data, buffer must be large enough
//otherwise, driver may write past the end //otherwise, driver may write past the end
@ -567,7 +567,7 @@ private:
case MetaColumn::FDT_TIMESTAMP: case MetaColumn::FDT_TIMESTAMP:
{ return extAny<T, Poco::DateTime>(pos, val); } { return extAny<T, Poco::DateTime>(pos, val); }
default: default:
throw DataFormatException("Unsupported data type."); throw DataFormatException("Unsupported data type.");
} }
@ -575,8 +575,8 @@ private:
} }
bool isNullLengthIndicator(SQLLEN val) const; bool isNullLengthIndicator(SQLLEN val) const;
/// The reason for this utility wrapper are platforms where /// The reason for this utility wrapper are platforms where
/// SQLLEN macro (a.k.a. SQLINTEGER) yields 64-bit value, /// SQLLEN macro (a.k.a. SQLINTEGER) yields 64-bit value,
/// while SQL_NULL_DATA (#define'd as -1 literal) remains 32-bit. /// while SQL_NULL_DATA (#define'd as -1 literal) remains 32-bit.
SQLINTEGER columnSize(std::size_t pos) const; SQLINTEGER columnSize(std::size_t pos) const;
@ -640,42 +640,42 @@ inline bool Extractor::extractBoundImplContainer(std::size_t pos, std::list<Poco
} }
inline bool Extractor::extractBoundImplContainer(std::size_t pos, inline bool Extractor::extractBoundImplContainer(std::size_t pos,
std::vector<Poco::Data::CLOB>& values) std::vector<Poco::Data::CLOB>& values)
{ {
return extractBoundImplContainerLOB(pos, values); return extractBoundImplContainerLOB(pos, values);
} }
inline bool Extractor::extractBoundImplContainer(std::size_t pos, inline bool Extractor::extractBoundImplContainer(std::size_t pos,
std::deque<Poco::Data::CLOB>& values) std::deque<Poco::Data::CLOB>& values)
{ {
return extractBoundImplContainerLOB(pos, values); return extractBoundImplContainerLOB(pos, values);
} }
inline bool Extractor::extractBoundImplContainer(std::size_t pos, inline bool Extractor::extractBoundImplContainer(std::size_t pos,
std::list<Poco::Data::CLOB>& values) std::list<Poco::Data::CLOB>& values)
{ {
return extractBoundImplContainerLOB(pos, values); return extractBoundImplContainerLOB(pos, values);
} }
inline bool Extractor::extractBoundImplContainer(std::size_t pos, inline bool Extractor::extractBoundImplContainer(std::size_t pos,
std::vector<Poco::Data::BLOB>& values) std::vector<Poco::Data::BLOB>& values)
{ {
return extractBoundImplContainerLOB(pos, values); return extractBoundImplContainerLOB(pos, values);
} }
inline bool Extractor::extractBoundImplContainer(std::size_t pos, inline bool Extractor::extractBoundImplContainer(std::size_t pos,
std::deque<Poco::Data::BLOB>& values) std::deque<Poco::Data::BLOB>& values)
{ {
return extractBoundImplContainerLOB(pos, values); return extractBoundImplContainerLOB(pos, values);
} }
inline bool Extractor::extractBoundImplContainer(std::size_t pos, inline bool Extractor::extractBoundImplContainer(std::size_t pos,
std::list<Poco::Data::BLOB>& values) std::list<Poco::Data::BLOB>& values)
{ {
return extractBoundImplContainerLOB(pos, values); return extractBoundImplContainerLOB(pos, values);
@ -702,7 +702,7 @@ inline void Extractor::reset()
inline void Extractor::resizeLengths(std::size_t pos) inline void Extractor::resizeLengths(std::size_t pos)
{ {
if (pos >= _lengths.size()) if (pos >= _lengths.size())
_lengths.resize(pos + 1, (SQLLEN) 0); _lengths.resize(pos + 1, (SQLLEN) 0);
} }

View File

@ -18,12 +18,12 @@
#define Data_ODBC_Preparator_INCLUDED #define Data_ODBC_Preparator_INCLUDED
#include "Poco/Data/Constants.h"
#include "Poco/Data/ODBC/ODBC.h" #include "Poco/Data/ODBC/ODBC.h"
#include "Poco/Data/ODBC/Handle.h" #include "Poco/Data/ODBC/Handle.h"
#include "Poco/Data/ODBC/ODBCMetaColumn.h" #include "Poco/Data/ODBC/ODBCMetaColumn.h"
#include "Poco/Data/ODBC/Utility.h" #include "Poco/Data/ODBC/Utility.h"
#include "Poco/Data/AbstractPreparator.h" #include "Poco/Data/AbstractPreparator.h"
#include "Poco/Data/Constants.h"
#include "Poco/Data/LOB.h" #include "Poco/Data/LOB.h"
#include "Poco/Any.h" #include "Poco/Any.h"
#include "Poco/DynamicAny.h" #include "Poco/DynamicAny.h"
@ -49,13 +49,13 @@ namespace ODBC {
class ODBC_API Preparator : public AbstractPreparator class ODBC_API Preparator : public AbstractPreparator
/// Class used for database preparation where we first have to register all data types /// Class used for database preparation where we first have to register all data types
/// with respective memory output locations before extracting data. /// with respective memory output locations before extracting data.
/// Extraction works in two-phases: first prepare is called once, then extract n-times. /// Extraction works in two-phases: first prepare is called once, then extract n-times.
/// In ODBC, SQLBindCol/SQLFetch is the preferred method of data retrieval (SQLGetData is available, /// In ODBC, SQLBindCol/SQLFetch is the preferred method of data retrieval (SQLGetData is available,
/// however with numerous driver implementation dependent limitations and inferior performance). /// however with numerous driver implementation dependent limitations and inferior performance).
/// In order to fit this functionality into Poco DataConnectors framework, every ODBC SQL statement /// In order to fit this functionality into Poco DataConnectors framework, every ODBC SQL statement
/// instantiates its own Preparator object. /// instantiates its own Preparator object.
/// This is done once per statement execution (from StatementImpl::bindImpl()). /// This is done once per statement execution (from StatementImpl::bindImpl()).
/// ///
/// Preparator object is used to : /// Preparator object is used to :
@ -69,7 +69,7 @@ class ODBC_API Preparator : public AbstractPreparator
/// - Value datatypes in this interface prepare() calls serve only for the purpose of type distinction. /// - Value datatypes in this interface prepare() calls serve only for the purpose of type distinction.
/// - Preparator keeps its own std::vector<Any> buffer for fetched data to be later retrieved by Extractor. /// - Preparator keeps its own std::vector<Any> buffer for fetched data to be later retrieved by Extractor.
/// - prepare() methods should not be called when extraction mode is DE_MANUAL /// - prepare() methods should not be called when extraction mode is DE_MANUAL
/// ///
{ {
public: public:
typedef std::vector<char*> CharArray; typedef std::vector<char*> CharArray;
@ -96,8 +96,8 @@ public:
DT_DATETIME DT_DATETIME
}; };
Preparator(const StatementHandle& rStmt, Preparator(const StatementHandle& rStmt,
const std::string& statement, const std::string& statement,
std::size_t maxFieldSize, std::size_t maxFieldSize,
DataExtraction dataExtraction = DE_BOUND); DataExtraction dataExtraction = DE_BOUND);
/// Creates the Preparator. /// Creates the Preparator.
@ -395,12 +395,12 @@ public:
std::size_t maxDataSize(std::size_t pos) const; std::size_t maxDataSize(std::size_t pos) const;
/// Returns max supported size for column at position pos. /// Returns max supported size for column at position pos.
/// Returned length for variable length fields is the one /// Returned length for variable length fields is the one
/// supported by this implementation, not the underlying DB. /// supported by this implementation, not the underlying DB.
std::size_t actualDataSize(std::size_t col, std::size_t row = POCO_DATA_INVALID_ROW) const; std::size_t actualDataSize(std::size_t col, std::size_t row = POCO_DATA_INVALID_ROW) const;
/// Returns the returned length for the column and row specified. /// Returns the returned length for the column and row specified.
/// This is usually equal to the column size, except for /// This is usually equal to the column size, except for
/// variable length fields (BLOB and variable length strings). /// variable length fields (BLOB and variable length strings).
/// For null values, the return value is -1 (SQL_NO_DATA) /// For null values, the return value is -1 (SQL_NO_DATA)
@ -435,7 +435,7 @@ private:
if (pVal) if (pVal)
return prepareFixedSize<Poco::Int8>(pos, SQL_C_STINYINT, pVal->size()); return prepareFixedSize<Poco::Int8>(pos, SQL_C_STINYINT, pVal->size());
else else
return prepareFixedSize<Poco::Int8>(pos, SQL_C_STINYINT); return prepareFixedSize<Poco::Int8>(pos, SQL_C_STINYINT);
case MetaColumn::FDT_UINT8: case MetaColumn::FDT_UINT8:
if (pVal) if (pVal)
@ -548,7 +548,7 @@ private:
else else
return prepareFixedSize<DateTime>(pos, SQL_C_TYPE_TIMESTAMP); return prepareFixedSize<DateTime>(pos, SQL_C_TYPE_TIMESTAMP);
default: default:
throw DataFormatException("Unsupported data type."); throw DataFormatException("Unsupported data type.");
} }
} }
@ -567,11 +567,11 @@ private:
_values[pos] = Poco::Any(T()); _values[pos] = Poco::Any(T());
T* pVal = AnyCast<T>(&_values[pos]); T* pVal = AnyCast<T>(&_values[pos]);
if (Utility::isError(SQLBindCol(_rStmt, if (Utility::isError(SQLBindCol(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT) pos + 1,
valueType, valueType,
(SQLPOINTER) pVal, (SQLPOINTER) pVal,
(SQLINTEGER) dataSize, (SQLINTEGER) dataSize,
&_lengths[pos]))) &_lengths[pos])))
{ {
throw StatementException(_rStmt, "SQLBindCol()"); throw StatementException(_rStmt, "SQLBindCol()");
@ -596,11 +596,11 @@ private:
std::vector<T>& cache = RefAnyCast<std::vector<T> >(_values[pos]); std::vector<T>& cache = RefAnyCast<std::vector<T> >(_values[pos]);
cache.resize(length); cache.resize(length);
if (Utility::isError(SQLBindCol(_rStmt, if (Utility::isError(SQLBindCol(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT) pos + 1,
valueType, valueType,
(SQLPOINTER) &cache[0], (SQLPOINTER) &cache[0],
(SQLINTEGER) dataSize, (SQLINTEGER) dataSize,
&_lenLengths[pos][0]))) &_lenLengths[pos][0])))
{ {
throw StatementException(_rStmt, "SQLBindCol()"); throw StatementException(_rStmt, "SQLBindCol()");
@ -614,18 +614,18 @@ private:
poco_assert (DE_BOUND == _dataExtraction); poco_assert (DE_BOUND == _dataExtraction);
poco_assert (pos < _values.size()); poco_assert (pos < _values.size());
T* pCache = new T[size]; T* pCache = new T[size];
std::memset(pCache, 0, size); std::memset(pCache, 0, size);
_values[pos] = Any(pCache); _values[pos] = Any(pCache);
_lengths[pos] = (SQLLEN) size; _lengths[pos] = (SQLLEN) size;
_varLengthArrays.insert(IndexMap::value_type(pos, dt)); _varLengthArrays.insert(IndexMap::value_type(pos, dt));
if (Utility::isError(SQLBindCol(_rStmt, if (Utility::isError(SQLBindCol(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT) pos + 1,
valueType, valueType,
(SQLPOINTER) pCache, (SQLPOINTER) pCache,
(SQLINTEGER) size*sizeof(T), (SQLINTEGER) size*sizeof(T),
&_lengths[pos]))) &_lengths[pos])))
{ {
throw StatementException(_rStmt, "SQLBindCol()"); throw StatementException(_rStmt, "SQLBindCol()");
@ -648,11 +648,11 @@ private:
_lenLengths[pos].resize(length); _lenLengths[pos].resize(length);
_varLengthArrays.insert(IndexMap::value_type(pos, DT)); _varLengthArrays.insert(IndexMap::value_type(pos, DT));
if (Utility::isError(SQLBindCol(_rStmt, if (Utility::isError(SQLBindCol(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT) pos + 1,
valueType, valueType,
(SQLPOINTER) pArray, (SQLPOINTER) pArray,
(SQLINTEGER) size, (SQLINTEGER) size,
&_lenLengths[pos][0]))) &_lenLengths[pos][0])))
{ {
throw StatementException(_rStmt, "SQLBindCol()"); throw StatementException(_rStmt, "SQLBindCol()");

View File

@ -33,9 +33,9 @@ const std::string Extractor::FLD_SIZE_EXCEEDED_FMT = "Specified data size (%z by
"to increase the maximum allowed data size\n"; "to increase the maximum allowed data size\n";
Extractor::Extractor(const StatementHandle& rStmt, Extractor::Extractor(const StatementHandle& rStmt,
Preparator::Ptr pPreparator): Preparator::Ptr pPreparator):
_rStmt(rStmt), _rStmt(rStmt),
_pPreparator(pPreparator), _pPreparator(pPreparator),
_dataExtraction(pPreparator->getDataExtraction()) _dataExtraction(pPreparator->getDataExtraction())
{ {
@ -106,7 +106,7 @@ bool Extractor::extractBoundImpl<Poco::Data::Date>(std::size_t pos, Poco::Data::
template<> template<>
bool Extractor::extractBoundImplContainer<std::vector<Poco::Data::Date> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::vector<Poco::Data::Date> >(std::size_t pos,
std::vector<Poco::Data::Date>& val) std::vector<Poco::Data::Date>& val)
{ {
std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_pPreparator->at(pos)); std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_pPreparator->at(pos));
@ -116,7 +116,7 @@ bool Extractor::extractBoundImplContainer<std::vector<Poco::Data::Date> >(std::s
template<> template<>
bool Extractor::extractBoundImplContainer<std::deque<Poco::Data::Date> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::deque<Poco::Data::Date> >(std::size_t pos,
std::deque<Poco::Data::Date>& val) std::deque<Poco::Data::Date>& val)
{ {
std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_pPreparator->at(pos)); std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_pPreparator->at(pos));
@ -126,7 +126,7 @@ bool Extractor::extractBoundImplContainer<std::deque<Poco::Data::Date> >(std::si
template<> template<>
bool Extractor::extractBoundImplContainer<std::list<Poco::Data::Date> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::list<Poco::Data::Date> >(std::size_t pos,
std::list<Poco::Data::Date>& val) std::list<Poco::Data::Date>& val)
{ {
std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_pPreparator->at(pos)); std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_pPreparator->at(pos));
@ -150,7 +150,7 @@ bool Extractor::extractBoundImpl<Poco::Data::Time>(std::size_t pos, Poco::Data::
template<> template<>
bool Extractor::extractBoundImplContainer<std::vector<Poco::Data::Time> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::vector<Poco::Data::Time> >(std::size_t pos,
std::vector<Poco::Data::Time>& val) std::vector<Poco::Data::Time>& val)
{ {
std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_pPreparator->at(pos)); std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_pPreparator->at(pos));
@ -160,7 +160,7 @@ bool Extractor::extractBoundImplContainer<std::vector<Poco::Data::Time> >(std::s
template<> template<>
bool Extractor::extractBoundImplContainer<std::deque<Poco::Data::Time> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::deque<Poco::Data::Time> >(std::size_t pos,
std::deque<Poco::Data::Time>& val) std::deque<Poco::Data::Time>& val)
{ {
std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_pPreparator->at(pos)); std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_pPreparator->at(pos));
@ -170,7 +170,7 @@ bool Extractor::extractBoundImplContainer<std::deque<Poco::Data::Time> >(std::si
template<> template<>
bool Extractor::extractBoundImplContainer<std::list<Poco::Data::Time> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::list<Poco::Data::Time> >(std::size_t pos,
std::list<Poco::Data::Time>& val) std::list<Poco::Data::Time>& val)
{ {
std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_pPreparator->at(pos)); std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_pPreparator->at(pos));
@ -194,7 +194,7 @@ bool Extractor::extractBoundImpl<Poco::DateTime>(std::size_t pos, Poco::DateTime
template<> template<>
bool Extractor::extractBoundImplContainer<std::vector<Poco::DateTime> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::vector<Poco::DateTime> >(std::size_t pos,
std::vector<Poco::DateTime>& val) std::vector<Poco::DateTime>& val)
{ {
std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_pPreparator->at(pos)); std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_pPreparator->at(pos));
@ -204,7 +204,7 @@ bool Extractor::extractBoundImplContainer<std::vector<Poco::DateTime> >(std::siz
template<> template<>
bool Extractor::extractBoundImplContainer<std::deque<Poco::DateTime> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::deque<Poco::DateTime> >(std::size_t pos,
std::deque<Poco::DateTime>& val) std::deque<Poco::DateTime>& val)
{ {
std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_pPreparator->at(pos)); std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_pPreparator->at(pos));
@ -214,7 +214,7 @@ bool Extractor::extractBoundImplContainer<std::deque<Poco::DateTime> >(std::size
template<> template<>
bool Extractor::extractBoundImplContainer<std::list<Poco::DateTime> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::list<Poco::DateTime> >(std::size_t pos,
std::list<Poco::DateTime>& val) std::list<Poco::DateTime>& val)
{ {
std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_pPreparator->at(pos)); std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_pPreparator->at(pos));
@ -224,7 +224,7 @@ bool Extractor::extractBoundImplContainer<std::list<Poco::DateTime> >(std::size_
template<> template<>
bool Extractor::extractBoundImplContainer<std::vector<bool> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::vector<bool> >(std::size_t pos,
std::vector<bool>& val) std::vector<bool>& val)
{ {
std::size_t length = _pPreparator->getLength(); std::size_t length = _pPreparator->getLength();
@ -235,7 +235,7 @@ bool Extractor::extractBoundImplContainer<std::vector<bool> >(std::size_t pos,
template<> template<>
bool Extractor::extractBoundImplContainer<std::deque<bool> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::deque<bool> >(std::size_t pos,
std::deque<bool>& val) std::deque<bool>& val)
{ {
std::size_t length = _pPreparator->getLength(); std::size_t length = _pPreparator->getLength();
@ -246,7 +246,7 @@ bool Extractor::extractBoundImplContainer<std::deque<bool> >(std::size_t pos,
template<> template<>
bool Extractor::extractBoundImplContainer<std::list<bool> >(std::size_t pos, bool Extractor::extractBoundImplContainer<std::list<bool> >(std::size_t pos,
std::list<bool>& val) std::list<bool>& val)
{ {
std::size_t length = _pPreparator->getLength(); std::size_t length = _pPreparator->getLength();
@ -262,13 +262,13 @@ bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val
std::size_t maxSize = _pPreparator->getMaxFieldSize(); std::size_t maxSize = _pPreparator->getMaxFieldSize();
std::size_t fetchedSize = 0; std::size_t fetchedSize = 0;
std::size_t totalSize = 0; std::size_t totalSize = 0;
SQLLEN len; SQLLEN len;
const int bufSize = CHUNK_SIZE; const int bufSize = CHUNK_SIZE;
Poco::Buffer<char> apChar(bufSize); Poco::Buffer<char> apChar(bufSize);
char* pChar = apChar.begin(); char* pChar = apChar.begin();
SQLRETURN rc = 0; SQLRETURN rc = 0;
val.clear(); val.clear();
resizeLengths(pos); resizeLengths(pos);
@ -276,8 +276,8 @@ bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val
{ {
std::memset(pChar, 0, bufSize); std::memset(pChar, 0, bufSize);
len = 0; len = 0;
rc = SQLGetData(_rStmt, rc = SQLGetData(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT) pos + 1,
cType, //C data type cType, //C data type
pChar, //returned value pChar, //returned value
bufSize, //buffer length bufSize, //buffer length
@ -301,9 +301,9 @@ bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val
_lengths[pos] += len; _lengths[pos] += len;
fetchedSize = _lengths[pos] > CHUNK_SIZE ? CHUNK_SIZE : _lengths[pos]; fetchedSize = _lengths[pos] > CHUNK_SIZE ? CHUNK_SIZE : _lengths[pos];
totalSize += fetchedSize; totalSize += fetchedSize;
if (totalSize <= maxSize) if (totalSize <= maxSize)
val.append(pChar, fetchedSize); val.append(pChar, fetchedSize);
else else
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize)); throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize));
}while (true); }while (true);
@ -367,8 +367,8 @@ bool Extractor::extractManualImpl<UTF16String>(std::size_t pos, UTF16String& val
template<> template<>
bool Extractor::extractManualImpl<Poco::Data::CLOB>(std::size_t pos, bool Extractor::extractManualImpl<Poco::Data::CLOB>(std::size_t pos,
Poco::Data::CLOB& val, Poco::Data::CLOB& val,
SQLSMALLINT cType) SQLSMALLINT cType)
{ {
std::size_t maxSize = _pPreparator->getMaxFieldSize(); std::size_t maxSize = _pPreparator->getMaxFieldSize();
@ -380,7 +380,7 @@ bool Extractor::extractManualImpl<Poco::Data::CLOB>(std::size_t pos,
Poco::Buffer<char> apChar(bufSize); Poco::Buffer<char> apChar(bufSize);
char* pChar = apChar.begin(); char* pChar = apChar.begin();
SQLRETURN rc = 0; SQLRETURN rc = 0;
val.clear(); val.clear();
resizeLengths(pos); resizeLengths(pos);
@ -388,13 +388,13 @@ bool Extractor::extractManualImpl<Poco::Data::CLOB>(std::size_t pos,
{ {
std::memset(pChar, 0, bufSize); std::memset(pChar, 0, bufSize);
len = 0; len = 0;
rc = SQLGetData(_rStmt, rc = SQLGetData(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT) pos + 1,
cType, //C data type cType, //C data type
pChar, //returned value pChar, //returned value
bufSize, //buffer length bufSize, //buffer length
&len); //length indicator &len); //length indicator
_lengths[pos] += len; _lengths[pos] += len;
if (SQL_NO_DATA != rc && Utility::isError(rc)) if (SQL_NO_DATA != rc && Utility::isError(rc))
@ -411,9 +411,9 @@ bool Extractor::extractManualImpl<Poco::Data::CLOB>(std::size_t pos,
fetchedSize = len > CHUNK_SIZE ? CHUNK_SIZE : len; fetchedSize = len > CHUNK_SIZE ? CHUNK_SIZE : len;
totalSize += fetchedSize; totalSize += fetchedSize;
if (totalSize <= maxSize) if (totalSize <= maxSize)
val.appendRaw(pChar, fetchedSize); val.appendRaw(pChar, fetchedSize);
else else
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize)); throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize));
}while (true); }while (true);
@ -423,26 +423,26 @@ bool Extractor::extractManualImpl<Poco::Data::CLOB>(std::size_t pos,
template<> template<>
bool Extractor::extractManualImpl<Poco::Data::Date>(std::size_t pos, bool Extractor::extractManualImpl<Poco::Data::Date>(std::size_t pos,
Poco::Data::Date& val, Poco::Data::Date& val,
SQLSMALLINT cType) SQLSMALLINT cType)
{ {
SQL_DATE_STRUCT ds; SQL_DATE_STRUCT ds;
resizeLengths(pos); resizeLengths(pos);
SQLRETURN rc = SQLGetData(_rStmt, SQLRETURN rc = SQLGetData(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT) pos + 1,
cType, //C data type cType, //C data type
&ds, //returned value &ds, //returned value
sizeof(ds), //buffer length sizeof(ds), //buffer length
&_lengths[pos]); //length indicator &_lengths[pos]); //length indicator
if (Utility::isError(rc)) if (Utility::isError(rc))
throw StatementException(_rStmt, "SQLGetData()"); throw StatementException(_rStmt, "SQLGetData()");
if (isNullLengthIndicator(_lengths[pos])) if (isNullLengthIndicator(_lengths[pos]))
return false; return false;
else else
Utility::dateSync(val, ds); Utility::dateSync(val, ds);
return true; return true;
@ -450,26 +450,26 @@ bool Extractor::extractManualImpl<Poco::Data::Date>(std::size_t pos,
template<> template<>
bool Extractor::extractManualImpl<Poco::Data::Time>(std::size_t pos, bool Extractor::extractManualImpl<Poco::Data::Time>(std::size_t pos,
Poco::Data::Time& val, Poco::Data::Time& val,
SQLSMALLINT cType) SQLSMALLINT cType)
{ {
SQL_TIME_STRUCT ts; SQL_TIME_STRUCT ts;
resizeLengths(pos); resizeLengths(pos);
SQLRETURN rc = SQLGetData(_rStmt, SQLRETURN rc = SQLGetData(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT) pos + 1,
cType, //C data type cType, //C data type
&ts, //returned value &ts, //returned value
sizeof(ts), //buffer length sizeof(ts), //buffer length
&_lengths[pos]); //length indicator &_lengths[pos]); //length indicator
if (Utility::isError(rc)) if (Utility::isError(rc))
throw StatementException(_rStmt, "SQLGetData()"); throw StatementException(_rStmt, "SQLGetData()");
if (isNullLengthIndicator(_lengths[pos])) if (isNullLengthIndicator(_lengths[pos]))
return false; return false;
else else
Utility::timeSync(val, ts); Utility::timeSync(val, ts);
return true; return true;
@ -477,26 +477,26 @@ bool Extractor::extractManualImpl<Poco::Data::Time>(std::size_t pos,
template<> template<>
bool Extractor::extractManualImpl<Poco::DateTime>(std::size_t pos, bool Extractor::extractManualImpl<Poco::DateTime>(std::size_t pos,
Poco::DateTime& val, Poco::DateTime& val,
SQLSMALLINT cType) SQLSMALLINT cType)
{ {
SQL_TIMESTAMP_STRUCT ts; SQL_TIMESTAMP_STRUCT ts;
resizeLengths(pos); resizeLengths(pos);
SQLRETURN rc = SQLGetData(_rStmt, SQLRETURN rc = SQLGetData(_rStmt,
(SQLUSMALLINT) pos + 1, (SQLUSMALLINT) pos + 1,
cType, //C data type cType, //C data type
&ts, //returned value &ts, //returned value
sizeof(ts), //buffer length sizeof(ts), //buffer length
&_lengths[pos]); //length indicator &_lengths[pos]); //length indicator
if (Utility::isError(rc)) if (Utility::isError(rc))
throw StatementException(_rStmt, "SQLGetData()"); throw StatementException(_rStmt, "SQLGetData()");
if (isNullLengthIndicator(_lengths[pos])) if (isNullLengthIndicator(_lengths[pos]))
return false; return false;
else else
Utility::dateTimeSync(val, ts); Utility::dateTimeSync(val, ts);
return true; return true;
@ -1307,10 +1307,10 @@ bool Extractor::isNull(std::size_t col, std::size_t row)
try try
{ {
return isNullLengthIndicator(_lengths.at(col)); return isNullLengthIndicator(_lengths.at(col));
} }
catch (std::out_of_range& ex) catch (std::out_of_range& ex)
{ {
throw RangeException(ex.what()); throw RangeException(ex.what());
} }
} }
else else

View File

@ -69,7 +69,7 @@ bool Extractor::extract(std::size_t pos, Poco::UInt8& val)
return false; return false;
} }
val = static_cast<Int8>(tempVal); val = static_cast<UInt8>(tempVal);
return true; return true;
} }
@ -88,7 +88,7 @@ bool Extractor::extract(std::size_t pos, Poco::Int16& val)
return false; return false;
} }
val = static_cast<Int8>(tempVal); val = static_cast<Int16>(tempVal);
return true; return true;
} }
@ -107,7 +107,7 @@ bool Extractor::extract(std::size_t pos, Poco::UInt16& val)
return false; return false;
} }
val = static_cast<Int8>(tempVal); val = static_cast<UInt16>(tempVal);
return true; return true;
} }

View File

@ -57,7 +57,8 @@ namespace PostgreSQL {
SessionImpl::SessionImpl(const std::string& aConnectionString, std::size_t aLoginTimeout): SessionImpl::SessionImpl(const std::string& aConnectionString, std::size_t aLoginTimeout):
Poco::Data::AbstractSessionImpl<SessionImpl>(aConnectionString, aLoginTimeout) Poco::Data::AbstractSessionImpl<SessionImpl>(aConnectionString, aLoginTimeout),
_connectorName("postgresql")
{ {
setProperty("handle", static_cast<SessionHandle*>(&_sessionHandle)); setProperty("handle", static_cast<SessionHandle*>(&_sessionHandle));
setConnectionTimeout(CONNECTION_TIMEOUT_DEFAULT); setConnectionTimeout(CONNECTION_TIMEOUT_DEFAULT);

View File

@ -176,6 +176,23 @@ public:
return result; return result;
} }
template <typename Fn>
void forEach(Fn&& fn) const
/// Iterates over all key-value pairs in the
/// cache, using a functor or lambda expression.
///
/// The given functor must take the key and value
/// as parameters. Note that the value is passed
/// as the actual value (or reference),
/// not a Poco::SharedPtr.
{
typename TMutex::ScopedLock lock(_mutex);
for (const auto& p: _data)
{
fn(p.first, *p.second);
}
}
protected: protected:
mutable FIFOEvent<ValidArgs<TKey>> IsValid; mutable FIFOEvent<ValidArgs<TKey>> IsValid;
mutable FIFOEvent<KeySet> Replace; mutable FIFOEvent<KeySet> Replace;

View File

@ -189,7 +189,7 @@ public:
val.append("{ "); val.append("{ ");
Var key(_val.first()); Var key(_val.first());
Impl::appendJSONKey(val, key); Impl::appendJSONKey(val, key);
val.append(" : "); val.append(": ");
Impl::appendJSONValue(val, _val.second()); Impl::appendJSONValue(val, _val.second());
val.append(" }"); val.append(" }");
} }
@ -338,7 +338,7 @@ public:
val.append("{ "); val.append("{ ");
Var key(_val.first()); Var key(_val.first());
Impl::appendJSONKey(val, key); Impl::appendJSONKey(val, key);
val.append(" : "); val.append(": ");
Impl::appendJSONValue(val, _val.second()); Impl::appendJSONValue(val, _val.second());
val.append(" }"); val.append(" }");
} }

View File

@ -339,7 +339,7 @@ public:
{ {
Var key(it->first); Var key(it->first);
Impl::appendJSONKey(val, key); Impl::appendJSONKey(val, key);
val.append(" : "); val.append(": ");
Impl::appendJSONValue(val, it->second); Impl::appendJSONValue(val, it->second);
++it; ++it;
} }
@ -348,7 +348,7 @@ public:
val.append(", "); val.append(", ");
Var key(it->first); Var key(it->first);
Impl::appendJSONKey(val, key); Impl::appendJSONKey(val, key);
val.append(" : "); val.append(": ");
Impl::appendJSONValue(val, it->second); Impl::appendJSONValue(val, it->second);
} }
val.append(" }"); val.append(" }");
@ -525,7 +525,7 @@ public:
{ {
Var key(it->first); Var key(it->first);
Impl::appendJSONKey(val, key); Impl::appendJSONKey(val, key);
val.append(" : "); val.append(": ");
Impl::appendJSONValue(val, it->second); Impl::appendJSONValue(val, it->second);
++it; ++it;
} }
@ -534,7 +534,7 @@ public:
val.append(", "); val.append(", ");
Var key(it->first); Var key(it->first);
Impl::appendJSONKey(val, key); Impl::appendJSONKey(val, key);
val.append(" : "); val.append(": ");
Impl::appendJSONValue(val, it->second); Impl::appendJSONValue(val, it->second);
} }
val.append(" }"); val.append(" }");
@ -711,7 +711,7 @@ public:
{ {
Var key(it->first); Var key(it->first);
Impl::appendJSONKey(val, key); Impl::appendJSONKey(val, key);
val.append(" : "); val.append(": ");
Impl::appendJSONValue(val, it->second); Impl::appendJSONValue(val, it->second);
++it; ++it;
} }
@ -720,7 +720,7 @@ public:
val.append(", "); val.append(", ");
Var key(it->first); Var key(it->first);
Impl::appendJSONKey(val, key); Impl::appendJSONKey(val, key);
val.append(" : "); val.append(": ");
Impl::appendJSONValue(val, it->second); Impl::appendJSONValue(val, it->second);
} }
val.append(" }"); val.append(" }");
@ -897,7 +897,7 @@ public:
{ {
Var key(it->first); Var key(it->first);
Impl::appendJSONKey(val, key); Impl::appendJSONKey(val, key);
val.append(" : "); val.append(": ");
Impl::appendJSONValue(val, it->second); Impl::appendJSONValue(val, it->second);
++it; ++it;
} }
@ -906,7 +906,7 @@ public:
val.append(", "); val.append(", ");
Var key(it->first); Var key(it->first);
Impl::appendJSONKey(val, key); Impl::appendJSONKey(val, key);
val.append(" : "); val.append(": ");
Impl::appendJSONValue(val, it->second); Impl::appendJSONValue(val, it->second);
} }
val.append(" }"); val.append(" }");

View File

@ -144,6 +144,8 @@ private:
void parsePriorityNames(); void parsePriorityNames();
static const std::string DEFAULT_PRIORITY_NAMES;
std::vector<PatternAction> _patternActions; std::vector<PatternAction> _patternActions;
bool _localTime; bool _localTime;
std::string _pattern; std::string _pattern;

View File

@ -55,11 +55,11 @@
// //
// In this scenario, std::ios::init() is called twice // In this scenario, std::ios::init() is called twice
// (the first time by the MyIOS constructor, the second // (the first time by the MyIOS constructor, the second
// time by the std::istream constructor), resulting in // time by the std::istream constructor), resulting in
// two locale objects being allocated, the pointer second // two locale objects being allocated, the pointer second
// one overwriting the pointer to the first one and thus // one overwriting the pointer to the first one and thus
// causing a memory leak. // causing a memory leak.
// //
// The workaround is to call init() only once for each // The workaround is to call init() only once for each
// stream object - by the istream, ostream or iostream // stream object - by the istream, ostream or iostream
// constructor, and not calling init() in ios-derived // constructor, and not calling init() in ios-derived
@ -77,6 +77,9 @@
# define POCO_IOS_INIT_HACK 1 # define POCO_IOS_INIT_HACK 1
// QNX with Dinkumware but not GNU C++ Library // QNX with Dinkumware but not GNU C++ Library
# elif defined(__QNX__) && !defined(__GLIBCPP__) # elif defined(__QNX__) && !defined(__GLIBCPP__)
# define POCO_IOS_INIT_HACK 1
// Linux with Clang libc++
# elif defined(__linux) && defined(_LIBCPP_VERSION)
# define POCO_IOS_INIT_HACK 1 # define POCO_IOS_INIT_HACK 1
# endif # endif
#endif #endif

View File

@ -41,7 +41,7 @@ class Foundation_API ThreadPool
/// Threads in a thread pool are re-used once they become /// Threads in a thread pool are re-used once they become
/// available again. /// available again.
/// The thread pool always keeps a minimum number of threads /// The thread pool always keeps a minimum number of threads
/// running. If the demans for threads increases, additional /// running. If the demand for threads increases, additional
/// threads are created. Once the demand for threads sinks /// threads are created. Once the demand for threads sinks
/// again, no-longer used threads are stopped and removed /// again, no-longer used threads are stopped and removed
/// from the pool. /// from the pool.

View File

@ -49,8 +49,7 @@ void writeString(const std::string &value, T& obj, typename WriteFunc<T, S>::Typ
{ {
for(std::string::const_iterator it = value.begin(), end = value.end(); it != end; ++it) for(std::string::const_iterator it = value.begin(), end = value.end(); it != end; ++it)
{ {
// Forward slash isn't strictly required by JSON spec, but some parsers expect it if((*it >= 0 && *it <= 31) || (*it == '"') || (*it == '\\'))
if((*it >= 0 && *it <= 31) || (*it == '"') || (*it == '\\') || (*it == '/'))
{ {
std::string str = Poco::UTF8::escape(it, it + 1, true); std::string str = Poco::UTF8::escape(it, it + 1, true);
(obj.*write)(str.c_str(), str.size()); (obj.*write)(str.c_str(), str.size());

View File

@ -25,16 +25,18 @@
#include "Poco/StringTokenizer.h" #include "Poco/StringTokenizer.h"
#include "Poco/Path.h" #include "Poco/Path.h"
namespace Poco { namespace Poco {
const std::string PatternFormatter::PROP_PATTERN = "pattern"; const std::string PatternFormatter::PROP_PATTERN = "pattern";
const std::string PatternFormatter::PROP_TIMES = "times"; const std::string PatternFormatter::PROP_TIMES = "times";
const std::string PatternFormatter::PROP_PRIORITY_NAMES = "priorityNames"; const std::string PatternFormatter::PROP_PRIORITY_NAMES = "priorityNames";
const std::string PatternFormatter::DEFAULT_PRIORITY_NAMES = "Fatal,Critical,Error,Warning,Notice,Information,Debug,Trace";
PatternFormatter::PatternFormatter(): PatternFormatter::PatternFormatter():
_localTime(false) _localTime(false),
_priorityNames(DEFAULT_PRIORITY_NAMES)
{ {
parsePriorityNames(); parsePriorityNames();
} }
@ -42,7 +44,8 @@ PatternFormatter::PatternFormatter():
PatternFormatter::PatternFormatter(const std::string& format): PatternFormatter::PatternFormatter(const std::string& format):
_localTime(false), _localTime(false),
_pattern(format) _pattern(format),
_priorityNames(DEFAULT_PRIORITY_NAMES)
{ {
parsePriorityNames(); parsePriorityNames();
parsePattern(); parsePattern();
@ -79,7 +82,7 @@ void PatternFormatter::format(const Message& msg, std::string& text)
case 'I': NumberFormatter::append(text, msg.getTid()); break; case 'I': NumberFormatter::append(text, msg.getTid()); break;
case 'N': text.append(Environment::nodeName()); break; case 'N': text.append(Environment::nodeName()); break;
case 'U': text.append(msg.getSourceFile() ? msg.getSourceFile() : ""); break; case 'U': text.append(msg.getSourceFile() ? msg.getSourceFile() : ""); break;
case 'O': text.append(msg.getSourceFile() ? Path{ msg.getSourceFile() }.getFileName() : ""); break; case 'O': text.append(msg.getSourceFile() ? Path(msg.getSourceFile()).getFileName() : ""); break;
case 'u': NumberFormatter::append(text, msg.getSourceLine()); break; case 'u': NumberFormatter::append(text, msg.getSourceLine()); break;
case 'w': text.append(DateTimeFormat::WEEKDAY_NAMES[dateTime.dayOfWeek()], 0, 3); break; case 'w': text.append(DateTimeFormat::WEEKDAY_NAMES[dateTime.dayOfWeek()], 0, 3); break;
case 'W': text.append(DateTimeFormat::WEEKDAY_NAMES[dateTime.dayOfWeek()]); break; case 'W': text.append(DateTimeFormat::WEEKDAY_NAMES[dateTime.dayOfWeek()]); break;
@ -231,48 +234,24 @@ std::string PatternFormatter::getProperty(const std::string& name) const
} }
namespace
{
static std::string priorities[] =
{
"",
"Fatal",
"Critical",
"Error",
"Warning",
"Notice",
"Information",
"Debug",
"Trace"
};
}
void PatternFormatter::parsePriorityNames() void PatternFormatter::parsePriorityNames()
{ {
for (int i = 0; i <= 8; i++) StringTokenizer st(_priorityNames, ",;", StringTokenizer::TOK_TRIM);
if (st.count() == 8)
{ {
_priorities[i] = priorities[i]; for (int i = 1; i <= 8; i++)
}
if (!_priorityNames.empty())
{
StringTokenizer st(_priorityNames, ",;", StringTokenizer::TOK_TRIM);
if (st.count() == 8)
{ {
for (int i = 1; i <= 8; i++) _priorities[i] = st[i - 1];
{
_priorities[i] = st[i - 1];
}
} }
else throw Poco::SyntaxException("priorityNames property must specify a comma-separated list of 8 property names");
} }
else throw Poco::SyntaxException("priorityNames property must specify a comma-separated list of 8 property names");
} }
const std::string& PatternFormatter::getPriorityName(int prio) const std::string& PatternFormatter::getPriorityName(int prio)
{ {
poco_assert (1 <= prio && prio <= 8); poco_assert (1 <= prio && prio <= 8);
return priorities[prio]; return _priorities[prio];
} }

View File

@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* The current PCRE version information. */ /* The current PCRE version information. */
#define PCRE_MAJOR 8 #define PCRE_MAJOR 8
#define PCRE_MINOR 43 #define PCRE_MINOR 44
#define PCRE_PRERELEASE #define PCRE_PRERELEASE
#define PCRE_DATE 2019-02-23 #define PCRE_DATE 020-02-12
/* When an application links to a PCRE DLL in Windows, the symbols that are /* When an application links to a PCRE DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE, the appropriate imported have to be identified as such. When building PCRE, the appropriate

View File

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language. and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Copyright (c) 1997-2018 University of Cambridge Copyright (c) 1997-2020 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@ -70,7 +70,7 @@ COMPILE_PCREx macro will already be appropriately set. */
/* Macro for setting individual bits in class bitmaps. */ /* Macro for setting individual bits in class bitmaps. */
#define SETBIT(a,b) a[(b)/8] |= (1 << ((b)&7)) #define SETBIT(a,b) a[(b)/8] |= (1U << ((b)&7))
/* Maximum length value to check against when making sure that the integer that /* Maximum length value to check against when making sure that the integer that
holds the compiled pattern length does not overflow. We make it a bit less than holds the compiled pattern length does not overflow. We make it a bit less than
@ -131,8 +131,8 @@ overrun before it actually does run off the end of the data block. */
/* Private flags added to firstchar and reqchar. */ /* Private flags added to firstchar and reqchar. */
#define REQ_CASELESS (1 << 0) /* Indicates caselessness */ #define REQ_CASELESS (1U << 0) /* Indicates caselessness */
#define REQ_VARY (1 << 1) /* Reqchar followed non-literal item */ #define REQ_VARY (1U << 1) /* Reqchar followed non-literal item */
/* Negative values for the firstchar and reqchar flags */ /* Negative values for the firstchar and reqchar flags */
#define REQ_UNSET (-2) #define REQ_UNSET (-2)
#define REQ_NONE (-1) #define REQ_NONE (-1)
@ -3301,7 +3301,7 @@ for(;;)
if ((*xclass_flags & XCL_MAP) == 0) if ((*xclass_flags & XCL_MAP) == 0)
{ {
/* No bits are set for characters < 256. */ /* No bits are set for characters < 256. */
if (list[1] == 0) return TRUE; if (list[1] == 0) return (*xclass_flags & XCL_NOT) == 0;
/* Might be an empty repeat. */ /* Might be an empty repeat. */
continue; continue;
} }
@ -3613,7 +3613,7 @@ for(;;)
if (chr > 255) break; if (chr > 255) break;
class_bitset = (pcre_uint8 *) class_bitset = (pcre_uint8 *)
((list_ptr == list ? code : base_end) - list_ptr[2]); ((list_ptr == list ? code : base_end) - list_ptr[2]);
if ((class_bitset[chr >> 3] & (1 << (chr & 7))) != 0) return FALSE; if ((class_bitset[chr >> 3] & (1U << (chr & 7))) != 0) return FALSE;
break; break;
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8 #if defined SUPPORT_UTF || !defined COMPILE_PCRE8
@ -7132,17 +7132,19 @@ for (;; ptr++)
int n = 0; int n = 0;
ptr++; ptr++;
while(IS_DIGIT(*ptr)) while(IS_DIGIT(*ptr))
{
n = n * 10 + *ptr++ - CHAR_0; n = n * 10 + *ptr++ - CHAR_0;
if (n > 255)
{
*errorcodeptr = ERR38;
goto FAILED;
}
}
if (*ptr != CHAR_RIGHT_PARENTHESIS) if (*ptr != CHAR_RIGHT_PARENTHESIS)
{ {
*errorcodeptr = ERR39; *errorcodeptr = ERR39;
goto FAILED; goto FAILED;
} }
if (n > 255)
{
*errorcodeptr = ERR38;
goto FAILED;
}
*code++ = n; *code++ = n;
PUT(code, 0, (int)(ptr - cd->start_pattern + 1)); /* Pattern offset */ PUT(code, 0, (int)(ptr - cd->start_pattern + 1)); /* Pattern offset */
PUT(code, LINK_SIZE, 0); /* Default length */ PUT(code, LINK_SIZE, 0); /* Default length */
@ -7458,7 +7460,7 @@ for (;; ptr++)
{ {
open_capitem *oc; open_capitem *oc;
recno = GET2(slot, 0); recno = GET2(slot, 0);
cd->backref_map |= (recno < 32)? (1 << recno) : 1; cd->backref_map |= (recno < 32)? (1U << recno) : 1;
if (recno > cd->top_backref) cd->top_backref = recno; if (recno > cd->top_backref) cd->top_backref = recno;
/* Check to see if this back reference is recursive, that it, it /* Check to see if this back reference is recursive, that it, it
@ -7644,8 +7646,8 @@ for (;; ptr++)
/* Can't determine a first byte now */ /* Can't determine a first byte now */
if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE; if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
zerofirstchar = firstchar; zerofirstchar = firstchar;
zerofirstcharflags = firstcharflags; zerofirstcharflags = firstcharflags;
continue; continue;
@ -8069,7 +8071,7 @@ for (;; ptr++)
item_hwm_offset = cd->hwm - cd->start_workspace; item_hwm_offset = cd->hwm - cd->start_workspace;
*code++ = ((options & PCRE_CASELESS) != 0)? OP_REFI : OP_REF; *code++ = ((options & PCRE_CASELESS) != 0)? OP_REFI : OP_REF;
PUT2INC(code, 0, recno); PUT2INC(code, 0, recno);
cd->backref_map |= (recno < 32)? (1 << recno) : 1; cd->backref_map |= (recno < 32)? (1U << recno) : 1;
if (recno > cd->top_backref) cd->top_backref = recno; if (recno > cd->top_backref) cd->top_backref = recno;
/* Check to see if this back reference is recursive, that it, it /* Check to see if this back reference is recursive, that it, it
@ -8682,7 +8684,7 @@ do {
op == OP_SCBRA || op == OP_SCBRAPOS) op == OP_SCBRA || op == OP_SCBRAPOS)
{ {
int n = GET2(scode, 1+LINK_SIZE); int n = GET2(scode, 1+LINK_SIZE);
int new_map = bracket_map | ((n < 32)? (1 << n) : 1); int new_map = bracket_map | ((n < 32)? (1U << n) : 1);
if (!is_anchored(scode, new_map, cd, atomcount)) return FALSE; if (!is_anchored(scode, new_map, cd, atomcount)) return FALSE;
} }
@ -8694,6 +8696,7 @@ do {
} }
/* Condition; not anchored if no second branch */ /* Condition; not anchored if no second branch */
else if (op == OP_COND) else if (op == OP_COND)
{ {
if (scode[GET(scode,1)] != OP_ALT) return FALSE; if (scode[GET(scode,1)] != OP_ALT) return FALSE;
@ -8809,7 +8812,7 @@ do {
op == OP_SCBRA || op == OP_SCBRAPOS) op == OP_SCBRA || op == OP_SCBRAPOS)
{ {
int n = GET2(scode, 1+LINK_SIZE); int n = GET2(scode, 1+LINK_SIZE);
int new_map = bracket_map | ((n < 32)? (1 << n) : 1); int new_map = bracket_map | ((n < 32)? (1U << n) : 1);
if (!is_startline(scode, new_map, cd, atomcount, inassert)) return FALSE; if (!is_startline(scode, new_map, cd, atomcount, inassert)) return FALSE;
} }

View File

@ -289,7 +289,7 @@ sure both macros are undefined; an emulation function will then be used. */
#define PACKAGE_NAME "PCRE" #define PACKAGE_NAME "PCRE"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "PCRE 8.43" #define PACKAGE_STRING "PCRE 8.44"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "pcre" #define PACKAGE_TARNAME "pcre"
@ -298,7 +298,7 @@ sure both macros are undefined; an emulation function will then be used. */
#define PACKAGE_URL "" #define PACKAGE_URL ""
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "8.43" #define PACKAGE_VERSION "8.44"
/* The value of PARENS_NEST_LIMIT specifies the maximum depth of nested /* The value of PARENS_NEST_LIMIT specifies the maximum depth of nested
parentheses (of any kind) in a pattern. This limits the amount of system parentheses (of any kind) in a pattern. This limits the amount of system
@ -400,7 +400,7 @@ sure both macros are undefined; an emulation function will then be used. */
/* #undef SUPPORT_VALGRIND */ /* #undef SUPPORT_VALGRIND */
/* Version number of package */ /* Version number of package */
#define VERSION "8.43" #define VERSION "8.44"
/* Define to empty if `const' does not conform to ANSI C. */ /* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */ /* #undef const */

View File

@ -3937,10 +3937,10 @@ static sljit_s32 character_to_int32(pcre_uchar chr)
sljit_s32 value = (sljit_s32)chr; sljit_s32 value = (sljit_s32)chr;
#if defined COMPILE_PCRE8 #if defined COMPILE_PCRE8
#define SSE2_COMPARE_TYPE_INDEX 0 #define SSE2_COMPARE_TYPE_INDEX 0
return (value << 24) | (value << 16) | (value << 8) | value; return ((unsigned int)value << 24) | ((unsigned int)value << 16) | ((unsigned int)value << 8) | (unsigned int)value;
#elif defined COMPILE_PCRE16 #elif defined COMPILE_PCRE16
#define SSE2_COMPARE_TYPE_INDEX 1 #define SSE2_COMPARE_TYPE_INDEX 1
return (value << 16) | value; return ((unsigned int)value << 16) | value;
#elif defined COMPILE_PCRE32 #elif defined COMPILE_PCRE32
#define SSE2_COMPARE_TYPE_INDEX 2 #define SSE2_COMPARE_TYPE_INDEX 2
return value; return value;
@ -8506,7 +8506,7 @@ if (opcode == OP_ONCE)
/* We temporarily encode the needs_control_head in the lowest bit. /* We temporarily encode the needs_control_head in the lowest bit.
Note: on the target architectures of SLJIT the ((x << 1) >> 1) returns Note: on the target architectures of SLJIT the ((x << 1) >> 1) returns
the same value for small signed numbers (including negative numbers). */ the same value for small signed numbers (including negative numbers). */
BACKTRACK_AS(bracket_backtrack)->u.framesize = (BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0); BACKTRACK_AS(bracket_backtrack)->u.framesize = ((unsigned int)BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0);
} }
return cc + repeat_length; return cc + repeat_length;
} }
@ -9001,7 +9001,7 @@ if (exact > 1)
#ifdef SUPPORT_UTF #ifdef SUPPORT_UTF
&& !common->utf && !common->utf
#endif #endif
) && type != OP_ANYNL && type != OP_EXTUNI)
{ {
OP2(SLJIT_ADD, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(exact)); OP2(SLJIT_ADD, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(exact));
add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_GREATER, TMP1, 0, STR_END, 0)); add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_GREATER, TMP1, 0, STR_END, 0));

View File

@ -221,6 +221,29 @@ void LRUCacheTest::testUpdate()
} }
void LRUCacheTest::testForEach()
{
LRUCache<int, int> aCache(3);
std::map<int, int> values;
aCache.add(1, 100);
aCache.add(2, 200);
aCache.add(3, 300);
aCache.forEach(
[&values](int key, int value)
{
values[key] = value;
}
);
assertEquals (values.size(), 3);
assertEquals (values[1], 100);
assertEquals (values[2], 200);
assertEquals (values[3], 300);
}
void LRUCacheTest::onUpdate(const void* pSender, const Poco::KeyValueArgs<int, int>& args) void LRUCacheTest::onUpdate(const void* pSender, const Poco::KeyValueArgs<int, int>& args)
{ {
++updateCnt; ++updateCnt;
@ -260,6 +283,7 @@ CppUnit::Test* LRUCacheTest::suite()
CppUnit_addTest(pSuite, LRUCacheTest, testCacheSizeN); CppUnit_addTest(pSuite, LRUCacheTest, testCacheSizeN);
CppUnit_addTest(pSuite, LRUCacheTest, testDuplicateAdd); CppUnit_addTest(pSuite, LRUCacheTest, testDuplicateAdd);
CppUnit_addTest(pSuite, LRUCacheTest, testUpdate); CppUnit_addTest(pSuite, LRUCacheTest, testUpdate);
CppUnit_addTest(pSuite, LRUCacheTest, testForEach);
return pSuite; return pSuite;
} }

View File

@ -31,6 +31,7 @@ public:
void testCacheSizeN(); void testCacheSizeN();
void testDuplicateAdd(); void testDuplicateAdd();
void testUpdate(); void testUpdate();
void testForEach();
void setUp(); void setUp();
void tearDown(); void tearDown();

View File

@ -97,6 +97,12 @@ void PatternFormatterTest::testPatternFormatter()
fmt.setProperty("pattern", "%O"); fmt.setProperty("pattern", "%O");
fmt.format(msg, result); fmt.format(msg, result);
assertTrue (result == "PatternFormatterTest.cpp"); assertTrue (result == "PatternFormatterTest.cpp");
result.clear();
fmt.setProperty("priorityNames", "FATAL,CRITICAL,SPECIAL_ERROR_NAME,WARN,NOTICE,INFO,DEBUG,TRACE");
fmt.setProperty("pattern", "%p");
fmt.format(msg, result);
assertTrue (result == "SPECIAL_ERROR_NAME");
} }

View File

@ -1378,7 +1378,6 @@ void StringTest::testJSONString()
{ {
assertTrue (toJSON("\\", false) == "\\\\"); assertTrue (toJSON("\\", false) == "\\\\");
assertTrue (toJSON("\"", false) == "\\\""); assertTrue (toJSON("\"", false) == "\\\"");
assertTrue (toJSON("/", false) == "\\/");
assertTrue (toJSON("\a", false) == "\\u0007"); assertTrue (toJSON("\a", false) == "\\u0007");
assertTrue (toJSON("\b", false) == "\\b"); assertTrue (toJSON("\b", false) == "\\b");
assertTrue (toJSON("\f", false) == "\\f"); assertTrue (toJSON("\f", false) == "\\f");
@ -1395,7 +1394,7 @@ void StringTest::testJSONString()
std::string str = "\"foo\\\\\""; std::string str = "\"foo\\\\\"";
assertTrue (toJSON("foo\\") == str); assertTrue (toJSON("foo\\") == str);
assertTrue (toJSON("bar/") == "\"bar\\/\""); assertTrue (toJSON("bar/") == "\"bar/\"");
assertTrue (toJSON("baz") == "\"baz\""); assertTrue (toJSON("baz") == "\"baz\"");
assertTrue (toJSON("q\"uote\"d") == "\"q\\\"uote\\\"d\""); assertTrue (toJSON("q\"uote\"d") == "\"q\\\"uote\\\"d\"");
assertTrue (toJSON("bs\b") == "\"bs\\b\""); assertTrue (toJSON("bs\b") == "\"bs\\b\"");
@ -1412,7 +1411,7 @@ void StringTest::testJSONString()
ostr.str(""); ostr.str("");
toJSON("foo\\", ostr); toJSON("foo\\", ostr);
assertTrue (toJSON("bar/") == "\"bar\\/\""); assertTrue (toJSON("bar/") == "\"bar/\"");
ostr.str(""); ostr.str("");
toJSON("baz", ostr); toJSON("baz", ostr);
assertTrue (ostr.str() == "\"baz\""); assertTrue (ostr.str() == "\"baz\"");

View File

@ -2438,14 +2438,14 @@ void VarTest::testDynamicPair()
catch (InvalidAccessException&) { } catch (InvalidAccessException&) { }
Var va(aPair); Var va(aPair);
assertTrue ("{ \"0\" : null }" == va.convert<std::string>()); assertTrue ("{ \"0\": null }" == va.convert<std::string>());
assertTrue (aPair.toString() == va.convert<std::string>()); assertTrue (aPair.toString() == va.convert<std::string>());
aPair = Pair<int>(4, "123"); aPair = Pair<int>(4, "123");
assertTrue ("123" == aPair.second()); assertTrue ("123" == aPair.second());
va = aPair; va = aPair;
assertTrue ("{ \"4\" : \"123\" }" == va.convert<std::string>()); assertTrue ("{ \"4\": \"123\" }" == va.convert<std::string>());
assertTrue (aPair.toString() == va.convert<std::string>()); assertTrue (aPair.toString() == va.convert<std::string>());
int i = 1; int i = 1;
@ -2464,11 +2464,11 @@ void VarTest::testDynamicPair()
assertTrue ("2" == pPair.second()); assertTrue ("2" == pPair.second());
Var vp(pPair); Var vp(pPair);
assertTrue ("{ \"1\" : \"2\" }" == vp.convert<std::string>()); assertTrue ("{ \"1\": \"2\" }" == vp.convert<std::string>());
assertTrue (pPair.toString() == vp.convert<std::string>()); assertTrue (pPair.toString() == vp.convert<std::string>());
Var vs(sPair); Var vs(sPair);
assertTrue ("{ \"2\" : 1 }" == vs.convert<std::string>()); assertTrue ("{ \"2\": 1 }" == vs.convert<std::string>());
assertTrue (sPair.toString() == vs.convert<std::string>()); assertTrue (sPair.toString() == vs.convert<std::string>());
} }
@ -2509,7 +2509,7 @@ void VarTest::testStructToString()
aStruct["Age"] = 1; aStruct["Age"] = 1;
Var a1(aStruct); Var a1(aStruct);
std::string res = a1.convert<std::string>(); std::string res = a1.convert<std::string>();
std::string expected = "{ \"Age\" : 1, \"First Name\" : \"Junior\", \"Last Name\" : \"POCO\" }"; std::string expected = "{ \"Age\": 1, \"First Name\": \"Junior\", \"Last Name\": \"POCO\" }";
assertTrue (res == expected); assertTrue (res == expected);
assertTrue (aStruct.toString() == res); assertTrue (aStruct.toString() == res);
} }
@ -2523,7 +2523,7 @@ void VarTest::testOrderedStructToString()
aStruct["Age"] = 1; aStruct["Age"] = 1;
Var a1(aStruct); Var a1(aStruct);
std::string res = a1.convert<std::string>(); std::string res = a1.convert<std::string>();
std::string expected = "{ \"First Name\" : \"Junior\", \"Last Name\" : \"POCO\", \"Age\" : 1 }"; std::string expected = "{ \"First Name\": \"Junior\", \"Last Name\": \"POCO\", \"Age\": 1 }";
assertTrue(res == expected); assertTrue(res == expected);
assertTrue(aStruct.toString() == res); assertTrue(aStruct.toString() == res);
} }
@ -2535,7 +2535,7 @@ void VarTest::testStructToStringEscape()
aStruct["Value"] = "Value with \" and \n"; aStruct["Value"] = "Value with \" and \n";
Var a1(aStruct); Var a1(aStruct);
std::string res = a1.convert<std::string>(); std::string res = a1.convert<std::string>();
std::string expected = "{ \"Value\" : \"Value with \\\" and \\n\" }"; std::string expected = "{ \"Value\": \"Value with \\\" and \\n\" }";
assertTrue (res == expected); assertTrue (res == expected);
assertTrue (aStruct.toString() == res); assertTrue (aStruct.toString() == res);
} }
@ -2560,14 +2560,14 @@ void VarTest::testArrayOfStructsToString()
Var a1(s16); Var a1(s16);
std::string res = a1.convert<std::string>(); std::string res = a1.convert<std::string>();
std::string expected = "[ " std::string expected = "[ "
"{ \"Age\" : 1, \"First Name\" : \"Junior\", \"Last Name\" : \"POCO\" }, " "{ \"Age\": 1, \"First Name\": \"Junior\", \"Last Name\": \"POCO\" }, "
"{ \"Age\" : 100, \"First Name\" : \"Senior\", \"Last Name\" : \"POCO\" }, " "{ \"Age\": 100, \"First Name\": \"Senior\", \"Last Name\": \"POCO\" }, "
"[ " "[ "
"{ \"Age\" : 1, \"First Name\" : \"Junior\", \"Last Name\" : \"POCO\" }, " "{ \"Age\": 1, \"First Name\": \"Junior\", \"Last Name\": \"POCO\" }, "
"{ \"Age\" : 100, \"First Name\" : \"Senior\", \"Last Name\" : \"POCO\" }, " "{ \"Age\": 100, \"First Name\": \"Senior\", \"Last Name\": \"POCO\" }, "
"[ " "[ "
"{ \"Age\" : 1, \"First Name\" : \"Junior\", \"Last Name\" : \"POCO\" }, " "{ \"Age\": 1, \"First Name\": \"Junior\", \"Last Name\": \"POCO\" }, "
"{ \"Age\" : 100, \"First Name\" : \"Senior\", \"Last Name\" : \"POCO\" } " "{ \"Age\": 100, \"First Name\": \"Senior\", \"Last Name\": \"POCO\" } "
"] ] ]"; "] ] ]";
assertTrue (res == expected); assertTrue (res == expected);
@ -2594,8 +2594,8 @@ void VarTest::testStructWithArraysToString()
aStruct["Address"] = addr; aStruct["Address"] = addr;
Var a2(aStruct); Var a2(aStruct);
std::string res = a2.convert<std::string>(); std::string res = a2.convert<std::string>();
std::string expected = "{ \"Address\" : { \"Country\" : \"Carinthia\", \"Number\" : 4, \"Street\" : \"Unknown\" }, " std::string expected = "{ \"Address\": { \"Country\": \"Carinthia\", \"Number\": 4, \"Street\": \"Unknown\" }, "
"\"Age\" : 1, \"First Name\" : \"Junior\", \"Last Name\" : [ \"string\", 23 ] }"; "\"Age\": 1, \"First Name\": \"Junior\", \"Last Name\": [ \"string\", 23 ] }";
assertTrue (res == expected); assertTrue (res == expected);
assertTrue (aStruct.toString() == res); assertTrue (aStruct.toString() == res);
@ -2615,17 +2615,17 @@ void VarTest::testJSONDeserializeString()
char cc = b2.convert<char>(); char cc = b2.convert<char>();
assertTrue (cc == 'c'); assertTrue (cc == 'c');
tst = "{ \"a\" : \"1\", \"b\" : \"2\" \n}"; tst = "{ \"a\": \"1\", \"b\": \"2\" \n}";
a = Var::parse(tst); a = Var::parse(tst);
assertTrue (a.toString() == "{ \"a\" : \"1\", \"b\" : \"2\" }"); assertTrue (a.toString() == "{ \"a\": \"1\", \"b\": \"2\" }");
tst = "{ \"a\" : \"1\", \"b\" : \"2\"\n}"; tst = "{ \"a\": \"1\", \"b\": \"2\"\n}";
a = Var::parse(tst); a = Var::parse(tst);
assertTrue (a.toString() == "{ \"a\" : \"1\", \"b\" : \"2\" }"); assertTrue (a.toString() == "{ \"a\": \"1\", \"b\": \"2\" }");
tst = "{ \"message\" : \"escape\\b\\f\\n\\r\\t\", \"path\" : \"\\/dev\\/null\" }"; tst = "{ \"message\": \"escape\\b\\f\\n\\r\\t\", \"path\": \"\\/dev\\/null\" }";
a = Var::parse(tst); a = Var::parse(tst);
assertTrue(a.toString() == "{ \"message\" : \"escape\\b\\f\\n\\r\\t\", \"path\" : \"\\/dev\\/null\" }"); assertTrue(a.toString() == "{ \"message\": \"escape\\b\\f\\n\\r\\t\", \"path\": \"/dev/null\" }");
} }

View File

@ -124,6 +124,9 @@ public:
std::size_t size() const; std::size_t size() const;
/// Returns the size of the array. /// Returns the size of the array.
bool empty() const;
/// Returns true if the array is empty, false otherwise.
bool isArray(unsigned int index) const; bool isArray(unsigned int index) const;
/// Returns true when the element is an array. /// Returns true when the element is an array.
@ -241,6 +244,12 @@ inline std::size_t Array::size() const
} }
inline bool Array::empty() const
{
return _values.empty();
}
inline bool Array::isArray(unsigned int index) const inline bool Array::isArray(unsigned int index) const
{ {
Dynamic::Var value = get(index); Dynamic::Var value = get(index);

View File

@ -267,7 +267,7 @@ private:
for (unsigned int i = 0; i < indent; i++) out << ' '; for (unsigned int i = 0; i < indent; i++) out << ' ';
Stringifier::stringify(getKey(it), out, indent, step, options); Stringifier::stringify(getKey(it), out, indent, step, options);
out << ((indent > 0) ? " : " : ":"); out << ((indent > 0) ? ": " : ":");
Stringifier::stringify(getValue(it), out, indent + step, step, options); Stringifier::stringify(getValue(it), out, indent + step, step, options);

View File

@ -204,7 +204,12 @@ void ParserImpl::handle()
break; break;
} }
case JSON_STRING: case JSON_STRING:
if (_pHandler) _pHandler->value(std::string(json_get_string(_pJSON, NULL))); if (_pHandler)
{
std::size_t length = 0;
const char* val = json_get_string(_pJSON, &length);
_pHandler->value(std::string(val, length == 0 ? 0 : length - 1)); // Decrease the length by 1 because it also contains the terminating null character
}
break; break;
case JSON_OBJECT: case JSON_OBJECT:
if (_pHandler) _pHandler->startObject(); if (_pHandler) _pHandler->startObject();

View File

@ -791,9 +791,11 @@ void JSONTest::testEmptyArray()
Poco::JSON::Array::Ptr array = result.extract<Poco::JSON::Array::Ptr>(); Poco::JSON::Array::Ptr array = result.extract<Poco::JSON::Array::Ptr>();
assertTrue (array->size() == 0); assertTrue (array->size() == 0);
assertTrue (array->empty());
Poco::Dynamic::Array da = *array; Poco::Dynamic::Array da = *array;
assertTrue (da.size() == 0); assertTrue (da.size() == 0);
assertTrue (da.empty());
} }
@ -817,10 +819,12 @@ void JSONTest::testNestedArray()
Poco::JSON::Array::Ptr array = result.extract<Poco::JSON::Array::Ptr>(); Poco::JSON::Array::Ptr array = result.extract<Poco::JSON::Array::Ptr>();
assertTrue (array->size() == 1); assertTrue (array->size() == 1);
assertTrue (!array->empty());
Poco::Dynamic::Array da = *array; Poco::Dynamic::Array da = *array;
assertTrue (da.size() == 1); assertTrue (da.size() == 1);
assertTrue (da[0].size() == 1); assertTrue (da[0].size() == 1);
assertTrue (!da.empty());
assertTrue (da[0][0].size() == 1); assertTrue (da[0][0].size() == 1);
assertTrue (da[0][0][0].size() == 0); assertTrue (da[0][0][0].size() == 0);
} }
@ -1382,7 +1386,6 @@ void JSONTest::testStringify()
Poco::JSON::Stringifier::stringify(obj1, oss1); Poco::JSON::Stringifier::stringify(obj1, oss1);
Poco::JSON::Stringifier::stringify(obj2, oss2); Poco::JSON::Stringifier::stringify(obj2, oss2);
assertTrue (oss1.str() == "{\"payload\":\"\\r\"}"); assertTrue (oss1.str() == "{\"payload\":\"\\r\"}");
std::cout << "\"" << oss1.str() << "\"" << std::endl;
assertTrue (oss2.str() == "{\"payload\":\"\\n\"}"); assertTrue (oss2.str() == "{\"payload\":\"\\n\"}");
Object jObj(false); Object jObj(false);
@ -1397,7 +1400,7 @@ void JSONTest::testStringify()
std::stringstream ss; std::stringstream ss;
jObj.stringify(ss); jObj.stringify(ss);
assertTrue (ss.str() == "{\"backspace\":\"bs\\b\",\"bar\\/\":0,\"baz\":0,\"foo\\\\\":0," assertTrue (ss.str() == "{\"backspace\":\"bs\\b\",\"bar/\":0,\"baz\":0,\"foo\\\\\":0,"
"\"newline\":\"nl\\n\",\"q\\\"uote\\\"d\":0,\"tab\":\"tb\\t\"}"); "\"newline\":\"nl\\n\",\"q\\\"uote\\\"d\":0,\"tab\":\"tb\\t\"}");
std::string json = "{ \"Simpsons\" : { \"husband\" : { \"name\" : \"Homer\" , \"age\" : 38 }, \"wife\" : { \"name\" : \"Marge\", \"age\" : 36 }, " std::string json = "{ \"Simpsons\" : { \"husband\" : { \"name\" : \"Homer\" , \"age\" : 38 }, \"wife\" : { \"name\" : \"Marge\", \"age\" : 36 }, "
@ -1448,24 +1451,24 @@ void JSONTest::testStringify()
ostr.str(""); ostr.str("");
Stringifier::stringify(result, ostr, 1); Stringifier::stringify(result, ostr, 1);
str = "{\n" str = "{\n"
" \"Simpsons\" : {\n" " \"Simpsons\": {\n"
" \"address\" : {\n" " \"address\": {\n"
" \"number\" : 742,\n" " \"number\": 742,\n"
" \"street\" : \"Evergreen Terrace\",\n" " \"street\": \"Evergreen Terrace\",\n"
" \"town\" : \"Springfield\"\n" " \"town\": \"Springfield\"\n"
" },\n" " },\n"
" \"children\" : [\n" " \"children\": [\n"
" \"Bart\",\n" " \"Bart\",\n"
" \"Lisa\",\n" " \"Lisa\",\n"
" \"Maggie\"\n" " \"Maggie\"\n"
" ],\n" " ],\n"
" \"husband\" : {\n" " \"husband\": {\n"
" \"age\" : 38,\n" " \"age\": 38,\n"
" \"name\" : \"Homer\"\n" " \"name\": \"Homer\"\n"
" },\n" " },\n"
" \"wife\" : {\n" " \"wife\": {\n"
" \"age\" : 36,\n" " \"age\": 36,\n"
" \"name\" : \"Marge\"\n" " \"name\": \"Marge\"\n"
" }\n" " }\n"
" }\n" " }\n"
"}"; "}";
@ -1474,24 +1477,24 @@ void JSONTest::testStringify()
ostr.str(""); ostr.str("");
Stringifier::stringify(result, ostr, 2); Stringifier::stringify(result, ostr, 2);
str = "{\n" str = "{\n"
" \"Simpsons\" : {\n" " \"Simpsons\": {\n"
" \"address\" : {\n" " \"address\": {\n"
" \"number\" : 742,\n" " \"number\": 742,\n"
" \"street\" : \"Evergreen Terrace\",\n" " \"street\": \"Evergreen Terrace\",\n"
" \"town\" : \"Springfield\"\n" " \"town\": \"Springfield\"\n"
" },\n" " },\n"
" \"children\" : [\n" " \"children\": [\n"
" \"Bart\",\n" " \"Bart\",\n"
" \"Lisa\",\n" " \"Lisa\",\n"
" \"Maggie\"\n" " \"Maggie\"\n"
" ],\n" " ],\n"
" \"husband\" : {\n" " \"husband\": {\n"
" \"age\" : 38,\n" " \"age\": 38,\n"
" \"name\" : \"Homer\"\n" " \"name\": \"Homer\"\n"
" },\n" " },\n"
" \"wife\" : {\n" " \"wife\": {\n"
" \"age\" : 36,\n" " \"age\": 36,\n"
" \"name\" : \"Marge\"\n" " \"name\": \"Marge\"\n"
" }\n" " }\n"
" }\n" " }\n"
"}"; "}";
@ -1500,24 +1503,24 @@ void JSONTest::testStringify()
ostr.str(""); ostr.str("");
Stringifier::stringify(result, ostr, 4); Stringifier::stringify(result, ostr, 4);
str = "{\n" str = "{\n"
" \"Simpsons\" : {\n" " \"Simpsons\": {\n"
" \"address\" : {\n" " \"address\": {\n"
" \"number\" : 742,\n" " \"number\": 742,\n"
" \"street\" : \"Evergreen Terrace\",\n" " \"street\": \"Evergreen Terrace\",\n"
" \"town\" : \"Springfield\"\n" " \"town\": \"Springfield\"\n"
" },\n" " },\n"
" \"children\" : [\n" " \"children\": [\n"
" \"Bart\",\n" " \"Bart\",\n"
" \"Lisa\",\n" " \"Lisa\",\n"
" \"Maggie\"\n" " \"Maggie\"\n"
" ],\n" " ],\n"
" \"husband\" : {\n" " \"husband\": {\n"
" \"age\" : 38,\n" " \"age\": 38,\n"
" \"name\" : \"Homer\"\n" " \"name\": \"Homer\"\n"
" },\n" " },\n"
" \"wife\" : {\n" " \"wife\": {\n"
" \"age\" : 36,\n" " \"age\": 36,\n"
" \"name\" : \"Marge\"\n" " \"name\": \"Marge\"\n"
" }\n" " }\n"
" }\n" " }\n"
"}"; "}";
@ -1590,24 +1593,24 @@ void JSONTest::testStringifyPreserveOrder()
ostr.str(""); ostr.str("");
Stringifier::stringify(result, ostr, 1); Stringifier::stringify(result, ostr, 1);
assertTrue (ostr.str() == "{\n" assertTrue (ostr.str() == "{\n"
" \"Simpsons\" : {\n" " \"Simpsons\": {\n"
" \"husband\" : {\n" " \"husband\": {\n"
" \"name\" : \"Homer\",\n" " \"name\": \"Homer\",\n"
" \"age\" : 38\n" " \"age\": 38\n"
" },\n" " },\n"
" \"wife\" : {\n" " \"wife\": {\n"
" \"name\" : \"Marge\",\n" " \"name\": \"Marge\",\n"
" \"age\" : 36\n" " \"age\": 36\n"
" },\n" " },\n"
" \"children\" : [\n" " \"children\": [\n"
" \"Bart\",\n" " \"Bart\",\n"
" \"Lisa\",\n" " \"Lisa\",\n"
" \"Maggie\"\n" " \"Maggie\"\n"
" ],\n" " ],\n"
" \"address\" : {\n" " \"address\": {\n"
" \"number\" : 742,\n" " \"number\": 742,\n"
" \"street\" : \"Evergreen Terrace\",\n" " \"street\": \"Evergreen Terrace\",\n"
" \"town\" : \"Springfield\"\n" " \"town\": \"Springfield\"\n"
" }\n" " }\n"
" }\n" " }\n"
"}"); "}");
@ -1615,24 +1618,24 @@ void JSONTest::testStringifyPreserveOrder()
ostr.str(""); ostr.str("");
Stringifier::stringify(result, ostr, 2); Stringifier::stringify(result, ostr, 2);
assertTrue (ostr.str() == "{\n" assertTrue (ostr.str() == "{\n"
" \"Simpsons\" : {\n" " \"Simpsons\": {\n"
" \"husband\" : {\n" " \"husband\": {\n"
" \"name\" : \"Homer\",\n" " \"name\": \"Homer\",\n"
" \"age\" : 38\n" " \"age\": 38\n"
" },\n" " },\n"
" \"wife\" : {\n" " \"wife\": {\n"
" \"name\" : \"Marge\",\n" " \"name\": \"Marge\",\n"
" \"age\" : 36\n" " \"age\": 36\n"
" },\n" " },\n"
" \"children\" : [\n" " \"children\": [\n"
" \"Bart\",\n" " \"Bart\",\n"
" \"Lisa\",\n" " \"Lisa\",\n"
" \"Maggie\"\n" " \"Maggie\"\n"
" ],\n" " ],\n"
" \"address\" : {\n" " \"address\": {\n"
" \"number\" : 742,\n" " \"number\": 742,\n"
" \"street\" : \"Evergreen Terrace\",\n" " \"street\": \"Evergreen Terrace\",\n"
" \"town\" : \"Springfield\"\n" " \"town\": \"Springfield\"\n"
" }\n" " }\n"
" }\n" " }\n"
"}"); "}");
@ -1640,33 +1643,33 @@ void JSONTest::testStringifyPreserveOrder()
ostr.str(""); ostr.str("");
Stringifier::stringify(result, ostr, 4); Stringifier::stringify(result, ostr, 4);
assertTrue (ostr.str() == "{\n" assertTrue (ostr.str() == "{\n"
" \"Simpsons\" : {\n" " \"Simpsons\": {\n"
" \"husband\" : {\n" " \"husband\": {\n"
" \"name\" : \"Homer\",\n" " \"name\": \"Homer\",\n"
" \"age\" : 38\n" " \"age\": 38\n"
" },\n" " },\n"
" \"wife\" : {\n" " \"wife\": {\n"
" \"name\" : \"Marge\",\n" " \"name\": \"Marge\",\n"
" \"age\" : 36\n" " \"age\": 36\n"
" },\n" " },\n"
" \"children\" : [\n" " \"children\": [\n"
" \"Bart\",\n" " \"Bart\",\n"
" \"Lisa\",\n" " \"Lisa\",\n"
" \"Maggie\"\n" " \"Maggie\"\n"
" ],\n" " ],\n"
" \"address\" : {\n" " \"address\": {\n"
" \"number\" : 742,\n" " \"number\": 742,\n"
" \"street\" : \"Evergreen Terrace\",\n" " \"street\": \"Evergreen Terrace\",\n"
" \"town\" : \"Springfield\"\n" " \"town\": \"Springfield\"\n"
" }\n" " }\n"
" }\n" " }\n"
"}"); "}");
Poco::DynamicStruct ds = *result.extract<Object::Ptr>(); Poco::DynamicStruct ds = *result.extract<Object::Ptr>();
assertTrue(ds.toString() == "{ \"Simpsons\" : { \"address\" : { \"number\" : 742, \"street\" : \"Evergreen Terrace\", \"town\" : \"Springfield\" }, " assertTrue(ds.toString() == "{ \"Simpsons\": { \"address\": { \"number\": 742, \"street\": \"Evergreen Terrace\", \"town\": \"Springfield\" }, "
"\"children\" : [ \"Bart\", \"Lisa\", \"Maggie\" ], " "\"children\": [ \"Bart\", \"Lisa\", \"Maggie\" ], "
"\"husband\" : { \"age\" : 38, \"name\" : \"Homer\" }, " "\"husband\": { \"age\": 38, \"name\": \"Homer\" }, "
"\"wife\" : { \"age\" : 36, \"name\" : \"Marge\" } } }"); "\"wife\": { \"age\": 36, \"name\": \"Marge\" } } }");
assertTrue (ds["Simpsons"].isStruct()); assertTrue (ds["Simpsons"].isStruct());
assertFalse(ds["Simpsons"].isOrdered()); assertFalse(ds["Simpsons"].isOrdered());
assertTrue (ds["Simpsons"]["husband"].isStruct()); assertTrue (ds["Simpsons"]["husband"].isStruct());
@ -1690,11 +1693,11 @@ void JSONTest::testStringifyPreserveOrder()
Poco::OrderedDynamicStruct ods = *result.extract<Object::Ptr>(); Poco::OrderedDynamicStruct ods = *result.extract<Object::Ptr>();
assertTrue(ods["Simpsons"].isStruct()); assertTrue(ods["Simpsons"].isStruct());
assertTrue(ods["Simpsons"].isOrdered()); assertTrue(ods["Simpsons"].isOrdered());
assertTrue(ods.toString() == "{ \"Simpsons\" : { \"husband\" : { \"name\" : \"Homer\", \"age\" : 38 }, " assertTrue(ods.toString() == "{ \"Simpsons\": { \"husband\": { \"name\": \"Homer\", \"age\": 38 }, "
"\"wife\" : { \"name\" : \"Marge\", \"age\" : 36 }, " "\"wife\": { \"name\": \"Marge\", \"age\": 36 }, "
"\"children\" : [ \"Bart\", \"Lisa\", \"Maggie\" ], " "\"children\": [ \"Bart\", \"Lisa\", \"Maggie\" ], "
"\"address\" : { \"number\" : 742, \"street\" : \"Evergreen Terrace\", " "\"address\": { \"number\": 742, \"street\": \"Evergreen Terrace\", "
"\"town\" : \"Springfield\" } } }"); "\"town\": \"Springfield\" } } }");
} }
@ -1936,6 +1939,15 @@ void JSONTest::testEscape0()
json->stringify(ss); json->stringify(ss);
assertTrue (ss.str().compare("{\"name\":\"B\\u0000b\"}") == 0); assertTrue (ss.str().compare("{\"name\":\"B\\u0000b\"}") == 0);
// parse the JSON containing the escaped string
Poco::JSON::Parser parser(new Poco::JSON::ParseHandler());
Var result = parser.parse(ss.str());
assert(result.type() == typeid(Object::Ptr));
Object::Ptr object = result.extract<Object::Ptr>();
assert(object->get("name").extract<std::string>() == nullString);
} }

View File

@ -124,6 +124,7 @@ public:
/// by a colon) can also be specified. /// by a colon) can also be specified.
/// * host: (optional) Host name included in syslog messages. If not specified, the host's real domain name or /// * host: (optional) Host name included in syslog messages. If not specified, the host's real domain name or
/// IP address will be used. /// IP address will be used.
/// * buffer: UDP socket send buffer size in bytes. If not specified, the system default is used.
std::string getProperty(const std::string& name) const; std::string getProperty(const std::string& name) const;
/// Returns the value of the property with the given name. /// Returns the value of the property with the given name.
@ -136,6 +137,7 @@ public:
static const std::string PROP_FORMAT; static const std::string PROP_FORMAT;
static const std::string PROP_LOGHOST; static const std::string PROP_LOGHOST;
static const std::string PROP_HOST; static const std::string PROP_HOST;
static const std::string PROP_BUFFER;
static const std::string STRUCTURED_DATA; static const std::string STRUCTURED_DATA;
protected: protected:
@ -148,6 +150,7 @@ private:
std::string _host; std::string _host;
int _facility; int _facility;
bool _bsdFormat; bool _bsdFormat;
int _buffer;
DatagramSocket _socket; DatagramSocket _socket;
SocketAddress _socketAddress; SocketAddress _socketAddress;
bool _open; bool _open;

View File

@ -73,6 +73,8 @@ public:
/// * threads: The number of parser threads processing /// * threads: The number of parser threads processing
/// received syslog messages. Defaults to 1. A maximum /// received syslog messages. Defaults to 1. A maximum
/// of 16 threads is supported. /// of 16 threads is supported.
/// * buffer: The UDP socket receive buffer size in bytes. If not
/// specified, the system default is used.
std::string getProperty(const std::string& name) const; std::string getProperty(const std::string& name) const;
/// Returns the value of the property with the given name. /// Returns the value of the property with the given name.
@ -96,6 +98,7 @@ public:
static const std::string PROP_PORT; static const std::string PROP_PORT;
static const std::string PROP_THREADS; static const std::string PROP_THREADS;
static const std::string PROP_BUFFER;
static const std::string LOG_PROP_APP; static const std::string LOG_PROP_APP;
static const std::string LOG_PROP_HOST; static const std::string LOG_PROP_HOST;
@ -112,6 +115,7 @@ private:
Poco::NotificationQueue _queue; Poco::NotificationQueue _queue;
Poco::UInt16 _port; Poco::UInt16 _port;
int _threads; int _threads;
int _buffer;
}; };

View File

@ -34,7 +34,7 @@ namespace Net {
struct NTLMContextImpl; struct NTLMContextImpl;
class NTLMContext class Net_API NTLMContext
/// An opaque context class for working with SSPI NTLM authentication. /// An opaque context class for working with SSPI NTLM authentication.
{ {
public: public:

View File

@ -464,6 +464,7 @@ void HTTPClientSession::proxyAuthenticateImpl(HTTPRequest& request, const ProxyC
_proxyDigestCreds.setPassword(proxyConfig.password); _proxyDigestCreds.setPassword(proxyConfig.password);
proxyAuthenticateDigest(request); proxyAuthenticateDigest(request);
} }
break;
case PROXY_AUTH_NTLM: case PROXY_AUTH_NTLM:
if (_ntlmProxyAuthenticated) if (_ntlmProxyAuthenticated)
@ -478,6 +479,7 @@ void HTTPClientSession::proxyAuthenticateImpl(HTTPRequest& request, const ProxyC
proxyAuthenticateNTLM(request); proxyAuthenticateNTLM(request);
_ntlmProxyAuthenticated = true; _ntlmProxyAuthenticated = true;
} }
break;
} }
} }

View File

@ -16,6 +16,7 @@
#include "Poco/Message.h" #include "Poco/Message.h"
#include "Poco/DateTimeFormatter.h" #include "Poco/DateTimeFormatter.h"
#include "Poco/NumberFormatter.h" #include "Poco/NumberFormatter.h"
#include "Poco/NumberParser.h"
#include "Poco/Net/SocketAddress.h" #include "Poco/Net/SocketAddress.h"
#include "Poco/Net/DNS.h" #include "Poco/Net/DNS.h"
#include "Poco/LoggingFactory.h" #include "Poco/LoggingFactory.h"
@ -34,6 +35,7 @@ const std::string RemoteSyslogChannel::PROP_FACILITY("facility");
const std::string RemoteSyslogChannel::PROP_FORMAT("format"); const std::string RemoteSyslogChannel::PROP_FORMAT("format");
const std::string RemoteSyslogChannel::PROP_LOGHOST("loghost"); const std::string RemoteSyslogChannel::PROP_LOGHOST("loghost");
const std::string RemoteSyslogChannel::PROP_HOST("host"); const std::string RemoteSyslogChannel::PROP_HOST("host");
const std::string RemoteSyslogChannel::PROP_BUFFER("buffer");
const std::string RemoteSyslogChannel::STRUCTURED_DATA("structured-data"); const std::string RemoteSyslogChannel::STRUCTURED_DATA("structured-data");
@ -42,6 +44,7 @@ RemoteSyslogChannel::RemoteSyslogChannel():
_name("-"), _name("-"),
_facility(SYSLOG_USER), _facility(SYSLOG_USER),
_bsdFormat(false), _bsdFormat(false),
_buffer(0),
_open(false) _open(false)
{ {
} }
@ -52,6 +55,7 @@ RemoteSyslogChannel::RemoteSyslogChannel(const std::string& address, const std::
_name(name), _name(name),
_facility(facility), _facility(facility),
_bsdFormat(bsdFormat), _bsdFormat(bsdFormat),
_buffer(0),
_open(false) _open(false)
{ {
if (_name.empty()) _name = "-"; if (_name.empty()) _name = "-";
@ -95,6 +99,11 @@ void RemoteSyslogChannel::open()
} }
} }
if (_buffer)
{
_socket.setSendBufferSize(_buffer);
}
_open = true; _open = true;
} }
@ -233,6 +242,10 @@ void RemoteSyslogChannel::setProperty(const std::string& name, const std::string
{ {
_bsdFormat = (value == "bsd" || value == "rfc3164"); _bsdFormat = (value == "bsd" || value == "rfc3164");
} }
else if (name == PROP_BUFFER)
{
_buffer = Poco::NumberParser::parse(value);
}
else else
{ {
Channel::setProperty(name, value); Channel::setProperty(name, value);
@ -314,6 +327,10 @@ std::string RemoteSyslogChannel::getProperty(const std::string& name) const
{ {
return _bsdFormat ? "rfc3164" : "rfc5424"; return _bsdFormat ? "rfc3164" : "rfc5424";
} }
else if (name == PROP_BUFFER)
{
return Poco::NumberFormatter::format(_buffer);
}
else else
{ {
return Channel::getProperty(name); return Channel::getProperty(name);

View File

@ -87,7 +87,7 @@ public:
BUFFER_SIZE = 65536 BUFFER_SIZE = 65536
}; };
RemoteUDPListener(Poco::NotificationQueue& queue, Poco::UInt16 port); RemoteUDPListener(Poco::NotificationQueue& queue, Poco::UInt16 port, int buffer);
~RemoteUDPListener(); ~RemoteUDPListener();
void run(); void run();
@ -100,11 +100,15 @@ private:
}; };
RemoteUDPListener::RemoteUDPListener(Poco::NotificationQueue& queue, Poco::UInt16 port): RemoteUDPListener::RemoteUDPListener(Poco::NotificationQueue& queue, Poco::UInt16 port, int buffer):
_queue(queue), _queue(queue),
_socket(Poco::Net::SocketAddress(Poco::Net::IPAddress(), port)), _socket(Poco::Net::SocketAddress(Poco::Net::IPAddress(), port)),
_stopped(false) _stopped(false)
{ {
if (buffer > 0)
{
_socket.setReceiveBufferSize(buffer);
}
} }
@ -494,6 +498,7 @@ Poco::Message::Priority SyslogParser::convert(RemoteSyslogChannel::Severity seve
const std::string RemoteSyslogListener::PROP_PORT("port"); const std::string RemoteSyslogListener::PROP_PORT("port");
const std::string RemoteSyslogListener::PROP_THREADS("threads"); const std::string RemoteSyslogListener::PROP_THREADS("threads");
const std::string RemoteSyslogListener::PROP_BUFFER("buffer");
const std::string RemoteSyslogListener::LOG_PROP_APP("app"); const std::string RemoteSyslogListener::LOG_PROP_APP("app");
const std::string RemoteSyslogListener::LOG_PROP_HOST("host"); const std::string RemoteSyslogListener::LOG_PROP_HOST("host");
@ -504,7 +509,8 @@ RemoteSyslogListener::RemoteSyslogListener():
_pListener(0), _pListener(0),
_pParser(0), _pParser(0),
_port(RemoteSyslogChannel::SYSLOG_PORT), _port(RemoteSyslogChannel::SYSLOG_PORT),
_threads(1) _threads(1),
_buffer(0)
{ {
} }
@ -513,7 +519,8 @@ RemoteSyslogListener::RemoteSyslogListener(Poco::UInt16 port):
_pListener(0), _pListener(0),
_pParser(0), _pParser(0),
_port(port), _port(port),
_threads(1) _threads(1),
_buffer(0)
{ {
} }
@ -522,7 +529,8 @@ RemoteSyslogListener::RemoteSyslogListener(Poco::UInt16 port, int threads):
_pListener(0), _pListener(0),
_pParser(0), _pParser(0),
_port(port), _port(port),
_threads(threads) _threads(threads),
_buffer(0)
{ {
} }
@ -564,6 +572,10 @@ void RemoteSyslogListener::setProperty(const std::string& name, const std::strin
else else
throw Poco::InvalidArgumentException("Invalid number of threads", value); throw Poco::InvalidArgumentException("Invalid number of threads", value);
} }
else if (name == PROP_BUFFER)
{
_buffer = Poco::NumberParser::parse(value);
}
else else
{ {
SplitterChannel::setProperty(name, value); SplitterChannel::setProperty(name, value);
@ -577,6 +589,8 @@ std::string RemoteSyslogListener::getProperty(const std::string& name) const
return Poco::NumberFormatter::format(_port); return Poco::NumberFormatter::format(_port);
else if (name == PROP_THREADS) else if (name == PROP_THREADS)
return Poco::NumberFormatter::format(_threads); return Poco::NumberFormatter::format(_threads);
else if (name == PROP_BUFFER)
return Poco::NumberFormatter::format(_buffer);
else else
return SplitterChannel::getProperty(name); return SplitterChannel::getProperty(name);
} }
@ -588,7 +602,7 @@ void RemoteSyslogListener::open()
_pParser = new SyslogParser(_queue, this); _pParser = new SyslogParser(_queue, this);
if (_port > 0) if (_port > 0)
{ {
_pListener = new RemoteUDPListener(_queue, _port); _pListener = new RemoteUDPListener(_queue, _port, _buffer);
} }
for (int i = 0; i < _threads; i++) for (int i = 0; i < _threads; i++)
{ {

View File

@ -236,6 +236,7 @@ WebSocketImpl* WebSocket::completeHandshake(HTTPClientSession& cs, HTTPResponse&
std::string WebSocket::createKey() std::string WebSocket::createKey()
{ {
Poco::Random rnd; Poco::Random rnd;
rnd.seed();
std::ostringstream ostr; std::ostringstream ostr;
Poco::Base64Encoder base64(ostr); Poco::Base64Encoder base64(ostr);
Poco::BinaryWriter writer(base64); Poco::BinaryWriter writer(base64);

View File

@ -1313,7 +1313,7 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
if (key_len > 79) if (key_len > 79)
{ {
png_warning(png_ptr, "keyword length must be 1 - 79 characters"); png_warning(png_ptr, "keyword length must be 1 - 79 characters");
new_key[79] = '\0'; *new_key[79] = '\0';
key_len = 79; key_len = 79;
} }

View File

@ -118,6 +118,12 @@ public:
PRIO_SYSTEM = 100 PRIO_SYSTEM = 100
}; };
struct WindowSize
{
int width;
int height;
};
Application(); Application();
/// Creates the Application. /// Creates the Application.
@ -294,6 +300,15 @@ public:
/// help information has been encountered and no other things /// help information has been encountered and no other things
/// besides displaying help shall be done. /// besides displaying help shall be done.
static WindowSize windowSize();
/// Returns the current window size of the console window,
/// if available.
///
/// Currently implemented for POSIX platforms (via TIOCGWINSZ ioctl())
/// and Windows (GetConsoleScreenBufferInfo()).
///
/// Returns zero width and height if the window size cannot be determined.
const char* name() const; const char* name() const;
protected: protected:

View File

@ -40,6 +40,8 @@
#endif #endif
#if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS) #if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS)
#include "Poco/SignalHandler.h" #include "Poco/SignalHandler.h"
#include <stdio.h>
#include <sys/ioctl.h>
#endif #endif
#include "Poco/UnicodeConverter.h" #include "Poco/UnicodeConverter.h"
@ -321,6 +323,30 @@ void Application::stopOptionsProcessing()
} }
Application::WindowSize Application::windowSize()
{
WindowSize size{0, 0};
#if defined(POCO_OS_FAMILY_WINDOWS)
CONSOLE_SCREEN_BUFFER_INFO csbi;
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi))
{
size.width = csbi.srWindow.Right - csbi.srWindow.Left + 1;
size.height = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
}
#elif defined(POCO_OS_FAMILY_UNIX)
struct winsize winsz;
if (ioctl(0, TIOCGWINSZ , &winsz) != -1)
{
size.width = winsz.ws_col;
size.height = winsz.ws_row;
}
#endif
return size;
}
int Application::run() int Application::run()
{ {
int rc = EXIT_CONFIG; int rc = EXIT_CONFIG;

View File

@ -31,34 +31,34 @@
*/ */
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,

View File

@ -32,34 +32,34 @@
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ /* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, /* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,

View File

@ -31,34 +31,34 @@
*/ */
/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME,
/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,

View File

@ -31,34 +31,34 @@
*/ */
/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, /* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, /* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, /* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, /* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4,
/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, /* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, /* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM,

View File

@ -1,15 +0,0 @@
How To Get Help
AAAIntroduction
If you got stuck with a problem when developing with the POCO C++ Libraries,
here's some information how to get help and support.
First, and most important, <!DON'T PANIC!>!
There is help and support available.
First, try the [[http://pocoproject.org POCO C++ Libraries Community]] resources on the Web,
where you can find:
- [[http://pocoproject.org/addons_services.html Professional Support]] by [[http://www.appinf.com Applied Informatics]],
- [[http://pocoproject.org/documentation/ introductory slides and articles]], and
- [[http://pocoproject.org/forum/ discussion forums]] on various topics.