fix FTPS win build, license, header guards; fix few warnings

This commit is contained in:
Alex Fabijanic
2017-08-31 12:20:49 -05:00
parent dd573b98d8
commit c81de1d34b
6 changed files with 63 additions and 10 deletions

View File

@@ -20,7 +20,9 @@
#include "Poco/ErrorHandler.h"
#include "Poco/Thread.h"
#include "Poco/Exception.h"
#ifdef max
#undef max
#endif
using Poco::FastMutex;
using Poco::Exception;
@@ -104,7 +106,9 @@ void SocketReactor::run()
if (nSockets == 0)
{
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))
{

View File

@@ -207,7 +207,7 @@ int WebSocketImpl::receiveBytes(Poco::Buffer<char>& buffer, int)
int payloadLength = receiveHeader(mask, useMask);
if (payloadLength <= 0)
return payloadLength;
int oldSize = buffer.size();
int oldSize = static_cast<int>(buffer.size());
buffer.resize(oldSize + payloadLength);
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 n = _buffer.size() - _bufferOffset;
int n = static_cast<int>(_buffer.size()) - _bufferOffset;
if (n > 0)
{
if (bytes < n) n = bytes;