mirror of
https://github.com/pocoproject/poco.git
synced 2025-06-01 00:22:09 +02:00
fix FTPS win build, license, header guards; fix few warnings
This commit is contained in:
parent
dd573b98d8
commit
c81de1d34b
@ -20,7 +20,9 @@
|
|||||||
#include "Poco/ErrorHandler.h"
|
#include "Poco/ErrorHandler.h"
|
||||||
#include "Poco/Thread.h"
|
#include "Poco/Thread.h"
|
||||||
#include "Poco/Exception.h"
|
#include "Poco/Exception.h"
|
||||||
|
#ifdef max
|
||||||
|
#undef max
|
||||||
|
#endif
|
||||||
|
|
||||||
using Poco::FastMutex;
|
using Poco::FastMutex;
|
||||||
using Poco::Exception;
|
using Poco::Exception;
|
||||||
@ -104,7 +106,9 @@ void SocketReactor::run()
|
|||||||
if (nSockets == 0)
|
if (nSockets == 0)
|
||||||
{
|
{
|
||||||
onIdle();
|
onIdle();
|
||||||
Thread::trySleep(_timeout.totalMilliseconds());
|
Timespan::TimeDiff ms = _timeout.totalMilliseconds();
|
||||||
|
poco_assert_dbg(ms <= std::numeric_limits<long>::max());
|
||||||
|
Thread::trySleep(static_cast<long>(ms));
|
||||||
}
|
}
|
||||||
else if (Socket::select(readable, writable, except, _timeout))
|
else if (Socket::select(readable, writable, except, _timeout))
|
||||||
{
|
{
|
||||||
|
@ -207,7 +207,7 @@ int WebSocketImpl::receiveBytes(Poco::Buffer<char>& buffer, int)
|
|||||||
int payloadLength = receiveHeader(mask, useMask);
|
int payloadLength = receiveHeader(mask, useMask);
|
||||||
if (payloadLength <= 0)
|
if (payloadLength <= 0)
|
||||||
return payloadLength;
|
return payloadLength;
|
||||||
int oldSize = buffer.size();
|
int oldSize = static_cast<int>(buffer.size());
|
||||||
buffer.resize(oldSize + payloadLength);
|
buffer.resize(oldSize + payloadLength);
|
||||||
return receivePayload(buffer.begin() + oldSize, payloadLength, mask, useMask);
|
return receivePayload(buffer.begin() + oldSize, payloadLength, mask, useMask);
|
||||||
}
|
}
|
||||||
@ -233,7 +233,7 @@ int WebSocketImpl::receiveNBytes(void* buffer, int bytes)
|
|||||||
|
|
||||||
int WebSocketImpl::receiveSomeBytes(char* buffer, int bytes)
|
int WebSocketImpl::receiveSomeBytes(char* buffer, int bytes)
|
||||||
{
|
{
|
||||||
int n = _buffer.size() - _bufferOffset;
|
int n = static_cast<int>(_buffer.size()) - _bufferOffset;
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
{
|
{
|
||||||
if (bytes < n) n = bytes;
|
if (bytes < n) n = bytes;
|
||||||
|
@ -1,10 +1,34 @@
|
|||||||
#pragma once
|
//
|
||||||
|
// FTPSClientSession.h
|
||||||
|
//
|
||||||
|
// $Id: //poco/1.4/Net/include/Poco/Net/FTPSClientSession.h#1 $
|
||||||
|
//
|
||||||
|
// Library: Net
|
||||||
|
// Package: FTP
|
||||||
|
// Module: FTPSClientSession
|
||||||
|
//
|
||||||
|
// Definition of the FTPSClientSession class.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
||||||
|
// and Contributors.
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: BSL-1.0
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NetSSL_FTPSClientSession_INCLUDED
|
||||||
|
#define NetSSL_FTPSClientSession_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
|
#include "Poco/Net/NetSSL.h"
|
||||||
#include "Poco/Net/FTPClientSession.h"
|
#include "Poco/Net/FTPClientSession.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
namespace Net {
|
namespace Net {
|
||||||
|
|
||||||
class FTPSClientSession :
|
|
||||||
|
class NetSSL_API FTPSClientSession :
|
||||||
public Poco::Net::FTPClientSession
|
public Poco::Net::FTPClientSession
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -56,6 +80,11 @@ private:
|
|||||||
bool _bSecureDataConnection = false;
|
bool _bSecureDataConnection = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// inlines
|
||||||
|
//
|
||||||
|
|
||||||
inline bool FTPSClientSession::isSecure() const
|
inline bool FTPSClientSession::isSecure() const
|
||||||
{
|
{
|
||||||
if (_pControlSocket != nullptr)
|
if (_pControlSocket != nullptr)
|
||||||
@ -63,4 +92,8 @@ inline bool FTPSClientSession::isSecure() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}} // namespace Poco::Net
|
}} // namespace Poco::Net
|
||||||
|
|
||||||
|
|
||||||
|
#endif // #define NetSSL_FTPSClientSession_INCLUDED
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#define Net_FTPSStreamFactory_INCLUDED
|
#define Net_FTPSStreamFactory_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "Poco/Net/Net.h"
|
#include "Poco/Net/NetSSL.h"
|
||||||
#include "Poco/Net/HTTPSession.h"
|
#include "Poco/Net/HTTPSession.h"
|
||||||
#include "Poco/URIStreamFactory.h"
|
#include "Poco/URIStreamFactory.h"
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ namespace Poco {
|
|||||||
namespace Net {
|
namespace Net {
|
||||||
|
|
||||||
|
|
||||||
class Net_API FTPPasswordProvider
|
class NetSSL_API FTPPasswordProvider
|
||||||
/// The base class for all password providers.
|
/// The base class for all password providers.
|
||||||
/// An instance of a subclass of this class can be
|
/// An instance of a subclass of this class can be
|
||||||
/// registered with the FTPSStreamFactory to
|
/// registered with the FTPSStreamFactory to
|
||||||
@ -45,7 +45,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Net_API FTPSStreamFactory: public Poco::URIStreamFactory
|
class NetSSL_API FTPSStreamFactory: public Poco::URIStreamFactory
|
||||||
/// An implementation of the URIStreamFactory interface
|
/// An implementation of the URIStreamFactory interface
|
||||||
/// that handles File Transfer Protocol (ftp) URIs.
|
/// that handles File Transfer Protocol (ftp) URIs.
|
||||||
///
|
///
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
//
|
||||||
|
// FTPSClientSession.cpp
|
||||||
|
//
|
||||||
|
// $Id: //poco/1.4/Net/src/FTPSClientSession.cpp#1 $
|
||||||
|
//
|
||||||
|
// Library: Net
|
||||||
|
// Package: FTP
|
||||||
|
// Module: FTPSClientSession
|
||||||
|
//
|
||||||
|
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
||||||
|
// and Contributors.
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: BSL-1.0
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "Poco/Net/FTPSClientSession.h"
|
#include "Poco/Net/FTPSClientSession.h"
|
||||||
#include "Poco/Net/SecureStreamSocket.h"
|
#include "Poco/Net/SecureStreamSocket.h"
|
||||||
#include "Poco/Net/SecureStreamSocketImpl.h"
|
#include "Poco/Net/SecureStreamSocketImpl.h"
|
||||||
|
@ -248,7 +248,7 @@ void ParserEngine::parse(const char* pBuffer, std::size_t size)
|
|||||||
std::size_t processed = 0;
|
std::size_t processed = 0;
|
||||||
while (processed < size)
|
while (processed < size)
|
||||||
{
|
{
|
||||||
const int bufferSize = processed + PARSE_BUFFER_SIZE < size ? PARSE_BUFFER_SIZE : size - processed;
|
const int bufferSize = processed + PARSE_BUFFER_SIZE < size ? PARSE_BUFFER_SIZE : static_cast<int>(size - processed);
|
||||||
if (!XML_Parse(_parser, pBuffer + processed, bufferSize, 0))
|
if (!XML_Parse(_parser, pBuffer + processed, bufferSize, 0))
|
||||||
handleError(XML_GetErrorCode(_parser));
|
handleError(XML_GetErrorCode(_parser));
|
||||||
processed += bufferSize;
|
processed += bufferSize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user