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

This commit is contained in:
Francis ANDRE 2019-03-10 18:27:17 +01:00
commit fcbd6772dd
5 changed files with 40 additions and 36 deletions

View File

@ -82,6 +82,7 @@ matrix:
- mkdir -p /usr/local/android-sdk/licenses
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > /usr/local/android-sdk/licenses/android-sdk-license
- echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e" >> /usr/local/android-sdk/licenses/android-sdk-license
- echo -e "\n24333f8a63b6825ea9c5514f83c2829b004d1fee" >> /usr/local/android-sdk/licenses/android-sdk-license
# Install NDK and cmake via android sdkmanager.
- /usr/local/android-sdk/tools/bin/sdkmanager --update > /dev/null
- /usr/local/android-sdk/tools/bin/sdkmanager "emulator" "ndk-bundle" "cmake;3.6.4111459" > /dev/null
@ -99,7 +100,7 @@ matrix:
# See also in /usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake
# Using the ninja build command. Is much faster then make build command.
- /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -H. -Bcmake-build -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-19 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build cmake-build --target all && cd cmake-build && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure
- /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -H. -Bcmake-build -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-19 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_APACHECONNECTOR=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build cmake-build --target all && cd cmake-build && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure
- env: TEST_NAME="android API level 24"
language: android
@ -129,6 +130,7 @@ matrix:
- mkdir -p /usr/local/android-sdk/licenses
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > /usr/local/android-sdk/licenses/android-sdk-license
- echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e" >> /usr/local/android-sdk/licenses/android-sdk-license
- echo -e "\n24333f8a63b6825ea9c5514f83c2829b004d1fee" >> /usr/local/android-sdk/licenses/android-sdk-license
# Install NDK and cmake via android sdkmanager.
- /usr/local/android-sdk/tools/bin/sdkmanager --update > /dev/null
- /usr/local/android-sdk/tools/bin/sdkmanager "emulator" "ndk-bundle" "cmake;3.6.4111459" > /dev/null
@ -146,7 +148,7 @@ matrix:
# See also in /usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake
# Using the ninja build command. Is much faster then make build command.
- /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -H. -Bcmake-build -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-24 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build cmake-build --target all && cd cmake-build && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure
- /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -H. -Bcmake-build -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-24 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DANDROID_STL="c++_static" -DANDROID_CPP_FEATURES="exceptions rtti" -DENABLE_APACHECONNECTOR=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_TESTS=ON -DENABLE_LONG_RUNNING_TESTS=OFF -DOLD_REDIS_VERSION=ON && /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build cmake-build --target all && cd cmake-build && travis_wait 30 /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest -E Foundation --output-on-failure
- env: TEST_NAME="gcc (make)"
compiler: gcc

View File

@ -113,7 +113,7 @@ namespace
(dir == DIR_ENCRYPT) ? 1 : 0);
#endif
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
if (_iv.size() != EVP_CIPHER_iv_length(_pCipher) && EVP_CIPHER_mode(_pCipher) == EVP_CIPH_GCM_MODE)
{
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
@ -161,7 +161,7 @@ namespace
std::string CryptoTransformImpl::getTag(std::size_t tagSize)
{
std::string tag;
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
Poco::Buffer<char> buffer(tagSize);
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
int rc = EVP_CIPHER_CTX_ctrl(_pContext, EVP_CTRL_GCM_GET_TAG, tagSize, buffer.begin());
@ -179,7 +179,7 @@ namespace
{
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
int rc = EVP_CIPHER_CTX_ctrl(_pContext, EVP_CTRL_GCM_SET_TAG, tag.size(), const_cast<char*>(tag.data()));
#elif OPENSSL_VERSION_NUMBER >= 0x10000000L
#elif OPENSSL_VERSION_NUMBER >= 0x10001000L
int rc = EVP_CIPHER_CTX_ctrl(&_context, EVP_CTRL_GCM_SET_TAG, tag.size(), const_cast<char*>(tag.data()));
#else
int rc = 0;

View File

@ -115,7 +115,7 @@ CipherKeyImpl::Mode CipherKeyImpl::mode() const
case EVP_CIPH_OFB_MODE:
return MODE_OFB;
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
case EVP_CIPH_CTR_MODE:
return MODE_CTR;

View File

@ -165,7 +165,7 @@ void HTTPClientSession::setProxyUsername(const std::string& username)
{
_proxyConfig.username = username;
}
void HTTPClientSession::setProxyPassword(const std::string& password)
{
@ -193,8 +193,9 @@ void HTTPClientSession::setKeepAliveTimeout(const Poco::Timespan& timeout)
std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
{
clearException();
_pRequestStream = 0;
_pResponseStream = 0;
clearException();
_responseReceived = false;
bool keepAlive = getKeepAlive();
@ -247,7 +248,7 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
{
_pRequestStream = new HTTPOutputStream(*this);
request.write(*_pRequestStream);
}
}
_lastRequest.update();
return *_pRequestStream;
}
@ -301,7 +302,7 @@ std::istream& HTTPClientSession::receiveResponse(HTTPResponse& response)
#endif
else
_pResponseStream = new HTTPInputStream(*this);
return *_pResponseStream;
}
@ -354,13 +355,14 @@ int HTTPClientSession::write(const char* buffer, std::streamsize length)
_reconnect = false;
return rc;
}
catch (NetException&)
catch (IOException&)
{
if (_reconnect)
{
close();
reconnect();
int rc = HTTPSession::write(buffer, length);
clearException();
_reconnect = false;
return rc;
}

View File

@ -80,7 +80,7 @@ bool checkIsBrokenTimeout()
SocketImpl::SocketImpl():
_sockfd(POCO_INVALID_SOCKET),
_blocking(true),
_blocking(true),
_isBrokenTimeout(checkIsBrokenTimeout())
{
}
@ -139,7 +139,7 @@ void SocketImpl::connect(const SocketAddress& address)
#endif
}
while (rc != 0 && lastError() == POCO_EINTR);
if (rc != 0)
if (rc != 0)
{
int err = lastError();
error(err, address.toString());
@ -204,7 +204,7 @@ void SocketImpl::connectNB(const SocketAddress& address)
void SocketImpl::bind(const SocketAddress& address, bool reuseAddress)
{
bind(address, reuseAddress, true);
bind(address, reuseAddress, reuseAddress);
}
@ -238,7 +238,7 @@ void SocketImpl::bind6(const SocketAddress& address, bool reuseAddress, bool reu
#if defined(POCO_HAVE_IPv6)
if (address.family() != SocketAddress::IPv6)
throw Poco::InvalidArgumentException("SocketAddress must be an IPv6 address");
if (_sockfd == POCO_INVALID_SOCKET)
{
init(address.af());
@ -263,7 +263,7 @@ void SocketImpl::bind6(const SocketAddress& address, bool reuseAddress, bool reu
void SocketImpl::listen(int backlog)
{
if (_sockfd == POCO_INVALID_SOCKET) throw InvalidSocketException();
int rc = ::listen(_sockfd, backlog);
if (rc != 0) error();
}
@ -372,7 +372,7 @@ int SocketImpl::receiveBytes(void* buffer, int length, int flags)
rc = ::recv(_sockfd, reinterpret_cast<char*>(buffer), length, flags);
}
while (_blocking && rc < 0 && lastError() == POCO_EINTR);
if (rc < 0)
if (rc < 0)
{
int err = lastError();
if (err == POCO_EAGAIN && !_blocking)
@ -671,7 +671,7 @@ bool SocketImpl::poll(const Poco::Timespan& timeout, int mode)
::close(epollfd);
if (rc < 0) error();
return rc > 0;
return rc > 0;
#elif defined(POCO_HAVE_FD_POLL)
@ -704,7 +704,7 @@ bool SocketImpl::poll(const Poco::Timespan& timeout, int mode)
}
while (rc < 0 && lastError() == POCO_EINTR);
if (rc < 0) error();
return rc > 0;
return rc > 0;
#else
@ -748,18 +748,18 @@ bool SocketImpl::poll(const Poco::Timespan& timeout, int mode)
}
while (rc < 0 && errorCode == POCO_EINTR);
if (rc < 0) error(errorCode);
return rc > 0;
return rc > 0;
#endif // POCO_HAVE_FD_EPOLL
}
void SocketImpl::setSendBufferSize(int size)
{
setOption(SOL_SOCKET, SO_SNDBUF, size);
}
int SocketImpl::getSendBufferSize()
{
int result;
@ -773,7 +773,7 @@ void SocketImpl::setReceiveBufferSize(int size)
setOption(SOL_SOCKET, SO_RCVBUF, size);
}
int SocketImpl::getReceiveBufferSize()
{
int result;
@ -841,34 +841,34 @@ Poco::Timespan SocketImpl::getReceiveTimeout()
return result;
}
SocketAddress SocketImpl::address()
{
if (_sockfd == POCO_INVALID_SOCKET) throw InvalidSocketException();
sockaddr_storage buffer;
struct sockaddr* pSA = reinterpret_cast<struct sockaddr*>(&buffer);
poco_socklen_t saLen = sizeof(buffer);
int rc = ::getsockname(_sockfd, pSA, &saLen);
if (rc == 0)
return SocketAddress(pSA, saLen);
else
else
error();
return SocketAddress();
}
SocketAddress SocketImpl::peerAddress()
{
if (_sockfd == POCO_INVALID_SOCKET) throw InvalidSocketException();
sockaddr_storage buffer;
struct sockaddr* pSA = reinterpret_cast<struct sockaddr*>(&buffer);
poco_socklen_t saLen = sizeof(buffer);
int rc = ::getpeername(_sockfd, pSA, &saLen);
if (rc == 0)
return SocketAddress(pSA, saLen);
else
else
error();
return SocketAddress();
}
@ -903,18 +903,18 @@ void SocketImpl::setOption(int level, int option, const Poco::Timespan& value)
struct timeval tv;
tv.tv_sec = (long) value.totalSeconds();
tv.tv_usec = (long) value.useconds();
setRawOption(level, option, &tv, sizeof(tv));
}
void SocketImpl::setRawOption(int level, int option, const void* value, poco_socklen_t length)
{
if (_sockfd == POCO_INVALID_SOCKET) throw InvalidSocketException();
#if defined(POCO_VXWORKS)
int rc = ::setsockopt(_sockfd, level, option, (char*) value, length);
#else
#else
int rc = ::setsockopt(_sockfd, level, option, reinterpret_cast<const char*>(value), length);
#endif
if (rc == -1) error();
@ -963,7 +963,7 @@ void SocketImpl::getOption(int level, int option, IPAddress& value)
void SocketImpl::getRawOption(int level, int option, void* value, poco_socklen_t& length)
{
if (_sockfd == POCO_INVALID_SOCKET) throw InvalidSocketException();
int rc = ::getsockopt(_sockfd, level, option, reinterpret_cast<char*>(value), &length);
if (rc == -1) error();
}
@ -977,7 +977,7 @@ void SocketImpl::setLinger(bool on, int seconds)
setRawOption(SOL_SOCKET, SO_LINGER, &l, sizeof(l));
}
void SocketImpl::getLinger(bool& on, int& seconds)
{
struct linger l;
@ -1084,7 +1084,7 @@ void SocketImpl::setBroadcast(bool flag)
setOption(SOL_SOCKET, SO_BROADCAST, value);
}
bool SocketImpl::getBroadcast()
{
int value(0);
@ -1183,7 +1183,7 @@ int SocketImpl::fcntl(poco_fcntl_request_t request, long arg)
return rc;
}
#endif
void SocketImpl::reset(poco_socket_t aSocket)
{