Merge branch 'poco-1.11.0' of github.com:pocoproject/poco into poco-1.11.0

This commit is contained in:
Günter Obiltschnig 2021-06-17 18:50:04 +02:00
commit 9dfda83305
22 changed files with 126 additions and 26 deletions

View File

@ -177,7 +177,15 @@ private:
EVP_PKEY* pKey = getFunc ? EVP_PKEY_new() : (EVP_PKEY*)*ppKey;
if (pKey)
{
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4996) // deprecation warnings
#endif
pFile = fopen(keyFile.c_str(), "r");
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
if (pFile)
{
pem_password_cb* pCB = pass.empty() ? (pem_password_cb*)0 : &passCB;

View File

@ -13,6 +13,11 @@
//
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "Poco/Crypto/PKCS12Container.h"
#include "Poco/NumberFormatter.h"
#include "Poco/StreamCopier.h"

View File

@ -47,7 +47,14 @@ inline void makeUTF8(Poco::Buffer<wchar_t>& buffer, SQLINTEGER length, SQLPOINTE
UnicodeConverter::toUTF8(buffer.begin(), length, result);
std::memset(pTarget, 0, targetLength);
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4996) // deprecation warnings
#endif
std::strncpy((char*) pTarget, result.c_str(), result.size() < targetLength ? result.size() : targetLength);
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
}

View File

@ -22,10 +22,6 @@
#include "Poco/UnWindows.h"
#if defined(_MSC_VER) && !defined(POCO_MSVC_SECURE_WARNINGS) && !defined(_CRT_SECURE_NO_DEPRECATE)
#define _CRT_SECURE_NO_DEPRECATE
#endif
// Verify that we're built with the multithreaded
// versions of the runtime libraries
@ -78,7 +74,6 @@
#pragma warning(disable:4351) // new behavior: elements of array '...' will be default initialized
#pragma warning(disable:4355) // 'this' : used in base member initializer list
#pragma warning(disable:4675) // resolved overload was found by argument-dependent lookup
#pragma warning(disable:4996) // VC++ 8.0 deprecation warnings
#endif

View File

@ -12,6 +12,11 @@
//
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "Poco/Environment.h"
#include "Poco/Version.h"
#include <cstdlib>

View File

@ -25,6 +25,11 @@
#include <iphlpapi.h>
#if defined(_MSC_VER)
#pragma warning(disable:4996) // deprecation warnings
#endif
namespace Poco {

View File

@ -12,6 +12,11 @@
//
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
// pull in platform identification macros needed below
#include "Poco/Platform.h"
#include "Poco/FPEnvironment.h"

View File

@ -12,6 +12,11 @@
//
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "Poco/LocalDateTime.h"
#include "Poco/Timezone.h"
#include "Poco/Timespan.h"

View File

@ -12,6 +12,11 @@
//
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "Poco/NumberFormatter.h"
#include "Poco/MemoryStream.h"
#include <iomanip>
@ -31,6 +36,7 @@
#endif
namespace Poco {

View File

@ -12,6 +12,11 @@
//
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "Poco/Timezone.h"
#include <ctime>

View File

@ -8,6 +8,11 @@
//
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "DateTimeTest.h"
#include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h"

View File

@ -8,6 +8,11 @@
//
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "LocalDateTimeTest.h"
#include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h"
@ -24,6 +29,7 @@
#include "wce_time.h"
#endif
using Poco::LocalDateTime;
using Poco::DateTime;
using Poco::Timestamp;

View File

@ -8,6 +8,11 @@
//
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "StringTest.h"
#include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h"

View File

@ -12,6 +12,11 @@
//
#if defined(_MSC_VER) && !defined(_WINSOCK_DEPRECATED_NO_WARNINGS)
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#endif
#include "Poco/Net/IPAddressImpl.h"
#include "Poco/Net/NetException.h"
#include "Poco/RefCountedObject.h"

View File

@ -38,6 +38,11 @@
#include <iomanip>
#if defined(_MSC_VER)
#pragma warning(disable:4996) // deprecation warnings
#endif
using Poco::NumberFormatter;
using Poco::FastMutex;
using Poco::format;

View File

@ -51,6 +51,11 @@
#endif
#if defined(_MSC_VER)
#pragma warning(disable:4996) // deprecation warnings
#endif
using Poco::IOException;
using Poco::TimeoutException;
using Poco::InvalidArgumentException;

View File

@ -324,6 +324,7 @@ namespace
_data.resize(1);
_reactor.addEventHandler(_socket, Observer<DataServiceHandler, ReadableNotification>(*this, &DataServiceHandler::onReadable));
_reactor.addEventHandler(_socket, Observer<DataServiceHandler, ShutdownNotification>(*this, &DataServiceHandler::onShutdown));
_socket.setBlocking(false);
}
~DataServiceHandler()
@ -336,13 +337,16 @@ namespace
{
pNf->release();
char buffer[64];
int n = _socket.receiveBytes(&buffer[0], sizeof(buffer));
int n = 0;
do
{
n = _socket.receiveBytes(&buffer[0], sizeof(buffer));
if (n > 0)
{
_data[_pos].append(buffer, n);
std::size_t pos;
pos = _data[_pos].find('\n');
if(pos != std::string::npos)
if (pos != std::string::npos)
{
if (pos == _data[_pos].size() - 1)
{
@ -357,7 +361,8 @@ namespace
++_pos;
}
}
else return;
else break;
} while (true);
}
void onShutdown(ShutdownNotification* pNf)
@ -500,7 +505,6 @@ void SocketReactorTest::testDataCollection()
" \"data\":123"
"}\n");
sock.sendBytes(data0.data(), static_cast<int>(data0.size()));
std::string data1("{"
" \"src\":\"127.0.0.1\","
" \"id\":\"test1\","
@ -517,7 +521,6 @@ void SocketReactorTest::testDataCollection()
" ]"
"}\n");
sock.sendBytes(data1.data(), static_cast<int>(data1.size()));
std::string data2 = "{"
" \"src\":\"127.0.0.1\","
" \"id\":\"test2\","

View File

@ -12,6 +12,11 @@
//
#if defined(_MSC_VER)
#pragma warning(disable:4996) // deprecation warnings
#endif
#include "Poco/Net/SSLManager.h"
#include "Poco/Net/Context.h"
#include "Poco/Net/Utility.h"
@ -26,6 +31,7 @@
#include "Poco/Util/OptionException.h"
namespace Poco {
namespace Net {

View File

@ -12,6 +12,11 @@
//
#if defined(_MSC_VER)
#pragma warning(disable:4996) // deprecation warnings
#endif
#include "Poco/Net/SSLManager.h"
#include "Poco/Net/Context.h"
#include "Poco/Net/Utility.h"

View File

@ -41,13 +41,13 @@ RedisStreamBuf::~RedisStreamBuf()
int RedisStreamBuf::readFromDevice(char* buffer, std::streamsize len)
{
return _redis.receiveBytes(buffer, len);
return _redis.receiveBytes(buffer, static_cast<int>(len));
}
int RedisStreamBuf::writeToDevice(const char* buffer, std::streamsize length)
{
return _redis.sendBytes(buffer, length);
return _redis.sendBytes(buffer, static_cast<int>(length));
}

View File

@ -12,6 +12,11 @@
//
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "Poco/Util/SystemConfiguration.h"
#include "Poco/Environment.h"
#include "Poco/Path.h"

View File

@ -65,6 +65,10 @@
# endif
#endif
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stddef.h>
#include <string.h> /* memset(), memcpy() */
#include <assert.h>