mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 18:45:10 +01:00
latest changes from main rep
This commit is contained in:
parent
18dfc99ef4
commit
ed4789b844
@ -1,7 +1,7 @@
|
||||
//
|
||||
// DialogSocket.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/DialogSocket.cpp#9 $
|
||||
// $Id: //poco/Main/Net/src/DialogSocket.cpp#10 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@ -35,8 +35,8 @@
|
||||
|
||||
|
||||
#include "Poco/Net/DialogSocket.h"
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <cstring>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@ -93,7 +93,7 @@ void DialogSocket::sendByte(unsigned char ch)
|
||||
|
||||
void DialogSocket::sendString(const char* str)
|
||||
{
|
||||
sendBytes(str, (int) strlen(str));
|
||||
sendBytes(str, (int) std::strlen(str));
|
||||
}
|
||||
|
||||
|
||||
@ -256,7 +256,7 @@ int DialogSocket::receiveStatusLine(std::string& line)
|
||||
int ch = get();
|
||||
if (ch != EOF_CHAR) line += (char) ch;
|
||||
int n = 0;
|
||||
while (isdigit(ch) && n < 3)
|
||||
while (std::isdigit(ch) && n < 3)
|
||||
{
|
||||
status *= 10;
|
||||
status += ch - '0';
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FTPClientSession.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/FTPClientSession.cpp#7 $
|
||||
// $Id: //poco/Main/Net/src/FTPClientSession.cpp#8 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: FTP
|
||||
@ -40,7 +40,7 @@
|
||||
#include "Poco/Net/ServerSocket.h"
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
using Poco::NumberFormatter;
|
||||
@ -459,19 +459,19 @@ void FTPClientSession::parseAddress(const std::string& str, SocketAddress& addr)
|
||||
while (it != end && *it != '(') ++it;
|
||||
if (it != end) ++it;
|
||||
std::string host;
|
||||
while (it != end && isdigit(*it)) host += *it++;
|
||||
while (it != end && std::isdigit(*it)) host += *it++;
|
||||
if (it != end && *it == ',') { host += '.'; ++it; }
|
||||
while (it != end && isdigit(*it)) host += *it++;
|
||||
while (it != end && std::isdigit(*it)) host += *it++;
|
||||
if (it != end && *it == ',') { host += '.'; ++it; }
|
||||
while (it != end && isdigit(*it)) host += *it++;
|
||||
while (it != end && std::isdigit(*it)) host += *it++;
|
||||
if (it != end && *it == ',') { host += '.'; ++it; }
|
||||
while (it != end && isdigit(*it)) host += *it++;
|
||||
while (it != end && std::isdigit(*it)) host += *it++;
|
||||
if (it != end && *it == ',') ++it;
|
||||
Poco::UInt16 portHi = 0;
|
||||
while (it != end && isdigit(*it)) { portHi *= 10; portHi += *it++ - '0'; }
|
||||
while (it != end && std::isdigit(*it)) { portHi *= 10; portHi += *it++ - '0'; }
|
||||
if (it != end && *it == ',') ++it;
|
||||
Poco::UInt16 portLo = 0;
|
||||
while (it != end && isdigit(*it)) { portLo *= 10; portLo += *it++ - '0'; }
|
||||
while (it != end && std::isdigit(*it)) { portLo *= 10; portLo += *it++ - '0'; }
|
||||
addr = SocketAddress(host, portHi*256 + portLo);
|
||||
}
|
||||
|
||||
@ -487,7 +487,7 @@ void FTPClientSession::parseExtAddress(const std::string& str, SocketAddress& ad
|
||||
if (it != end && *it == delim) ++it;
|
||||
if (it != end && *it == delim) ++it;
|
||||
Poco::UInt16 port = 0;
|
||||
while (it != end && isdigit(*it)) { port *= 10; port += *it++ - '0'; }
|
||||
while (it != end && std::isdigit(*it)) { port *= 10; port += *it++ - '0'; }
|
||||
addr = SocketAddress(_controlSocket.peerAddress().host(), port);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTMLForm.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/HTMLForm.cpp#16 $
|
||||
// $Id: //poco/Main/Net/src/HTMLForm.cpp#17 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTML
|
||||
@ -48,7 +48,7 @@
|
||||
#include "Poco/URI.h"
|
||||
#include "Poco/String.h"
|
||||
#include <sstream>
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
using Poco::NullInputStream;
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPChunkedStream.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/HTTPChunkedStream.cpp#14 $
|
||||
// $Id: //poco/Main/Net/src/HTTPChunkedStream.cpp#16 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTP
|
||||
@ -38,7 +38,7 @@
|
||||
#include "Poco/Net/HTTPSession.h"
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include "Poco/NumberParser.h"
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
using Poco::NumberFormatter;
|
||||
@ -85,9 +85,9 @@ int HTTPChunkedStreamBuf::readFromDevice(char* buffer, std::streamsize length)
|
||||
if (_chunk == 0)
|
||||
{
|
||||
int ch = _session.get();
|
||||
while (isspace(ch)) ch = _session.get();
|
||||
while (std::isspace(ch)) ch = _session.get();
|
||||
std::string chunkLen;
|
||||
while (isxdigit(ch)) { chunkLen += (char) ch; ch = _session.get(); }
|
||||
while (std::isxdigit(ch)) { chunkLen += (char) ch; ch = _session.get(); }
|
||||
while (ch != eof && ch != '\n') ch = _session.get();
|
||||
unsigned chunk;
|
||||
if (NumberParser::tryParseHex(chunkLen, chunk))
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPRequest.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/HTTPRequest.cpp#11 $
|
||||
// $Id: //poco/Main/Net/src/HTTPRequest.cpp#12 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTP
|
||||
@ -39,7 +39,7 @@
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include "Poco/Net/NameValueCollection.h"
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
using Poco::NumberFormatter;
|
||||
@ -174,9 +174,9 @@ void HTTPRequest::getCredentials(std::string& scheme, std::string& authInfo) con
|
||||
const std::string& auth = get(AUTHORIZATION);
|
||||
std::string::const_iterator it = auth.begin();
|
||||
std::string::const_iterator end = auth.end();
|
||||
while (it != end && isspace(*it)) ++it;
|
||||
while (it != end && !isspace(*it)) scheme += *it++;
|
||||
while (it != end && isspace(*it)) ++it;
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end && !std::isspace(*it)) scheme += *it++;
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end) authInfo += *it++;
|
||||
}
|
||||
else throw NotAuthenticatedException();
|
||||
@ -209,16 +209,16 @@ void HTTPRequest::read(std::istream& istr)
|
||||
std::string version;
|
||||
int ch = istr.get();
|
||||
if (ch == eof) throw NoMessageException();
|
||||
while (isspace(ch)) ch = istr.get();
|
||||
while (std::isspace(ch)) ch = istr.get();
|
||||
if (ch == eof) throw MessageException("No HTTP request header");
|
||||
while (!isspace(ch) && ch != eof && method.length() < MAX_METHOD_LENGTH) { method += (char) ch; ch = istr.get(); }
|
||||
if (!isspace(ch)) throw MessageException("HTTP request method invalid or too long");
|
||||
while (isspace(ch)) ch = istr.get();
|
||||
while (!isspace(ch) && ch != eof && uri.length() < MAX_URI_LENGTH) { uri += (char) ch; ch = istr.get(); }
|
||||
if (!isspace(ch)) throw MessageException("HTTP request URI invalid or too long");
|
||||
while (isspace(ch)) ch = istr.get();
|
||||
while (!isspace(ch) && ch != eof && version.length() < MAX_VERSION_LENGTH) { version += (char) ch; ch = istr.get(); }
|
||||
if (!isspace(ch)) throw MessageException("Invalid HTTP version string");
|
||||
while (!std::isspace(ch) && ch != eof && method.length() < MAX_METHOD_LENGTH) { method += (char) ch; ch = istr.get(); }
|
||||
if (!std::isspace(ch)) throw MessageException("HTTP request method invalid or too long");
|
||||
while (std::isspace(ch)) ch = istr.get();
|
||||
while (!std::isspace(ch) && ch != eof && uri.length() < MAX_URI_LENGTH) { uri += (char) ch; ch = istr.get(); }
|
||||
if (!std::isspace(ch)) throw MessageException("HTTP request URI invalid or too long");
|
||||
while (std::isspace(ch)) ch = istr.get();
|
||||
while (!std::isspace(ch) && ch != eof && version.length() < MAX_VERSION_LENGTH) { version += (char) ch; ch = istr.get(); }
|
||||
if (!std::isspace(ch)) throw MessageException("Invalid HTTP version string");
|
||||
while (ch != '\n' && ch != eof) { ch = istr.get(); }
|
||||
HTTPMessage::read(istr);
|
||||
ch = istr.get();
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPResponse.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/HTTPResponse.cpp#11 $
|
||||
// $Id: //poco/Main/Net/src/HTTPResponse.cpp#12 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTP
|
||||
@ -42,7 +42,7 @@
|
||||
#include "Poco/DateTimeFormatter.h"
|
||||
#include "Poco/DateTimeFormat.h"
|
||||
#include "Poco/DateTimeParser.h"
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
using Poco::DateTime;
|
||||
@ -228,16 +228,16 @@ void HTTPResponse::read(std::istream& istr)
|
||||
|
||||
int ch = istr.get();
|
||||
if (ch == eof) throw NoMessageException();
|
||||
while (isspace(ch)) ch = istr.get();
|
||||
while (std::isspace(ch)) ch = istr.get();
|
||||
if (ch == eof) throw MessageException("No HTTP response header");
|
||||
while (!isspace(ch) && ch != eof && version.length() < MAX_VERSION_LENGTH) { version += (char) ch; ch = istr.get(); }
|
||||
if (!isspace(ch)) throw MessageException("Invalid HTTP version string");
|
||||
while (isspace(ch)) ch = istr.get();
|
||||
while (!isspace(ch) && ch != eof && status.length() < MAX_STATUS_LENGTH) { status += (char) ch; ch = istr.get(); }
|
||||
if (!isspace(ch)) throw MessageException("Invalid HTTP status code");
|
||||
while (isspace(ch)) ch = istr.get();
|
||||
while (!std::isspace(ch) && ch != eof && version.length() < MAX_VERSION_LENGTH) { version += (char) ch; ch = istr.get(); }
|
||||
if (!std::isspace(ch)) throw MessageException("Invalid HTTP version string");
|
||||
while (std::isspace(ch)) ch = istr.get();
|
||||
while (!std::isspace(ch) && ch != eof && status.length() < MAX_STATUS_LENGTH) { status += (char) ch; ch = istr.get(); }
|
||||
if (!std::isspace(ch)) throw MessageException("Invalid HTTP status code");
|
||||
while (std::isspace(ch)) ch = istr.get();
|
||||
while (ch != '\r' && ch != '\n' && ch != eof && reason.length() < MAX_REASON_LENGTH) { reason += (char) ch; ch = istr.get(); }
|
||||
if (!isspace(ch)) throw MessageException("HTTP reason string too long");
|
||||
if (!std::isspace(ch)) throw MessageException("HTTP reason string too long");
|
||||
if (ch == '\r') ch = istr.get();
|
||||
|
||||
HTTPMessage::read(istr);
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPSession.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/HTTPSession.cpp#12 $
|
||||
// $Id: //poco/Main/Net/src/HTTPSession.cpp#13 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTP
|
||||
@ -37,7 +37,7 @@
|
||||
#include "Poco/Net/HTTPSession.h"
|
||||
#include "Poco/Net/HTTPBufferAllocator.h"
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
using Poco::TimeoutException;
|
||||
@ -132,7 +132,7 @@ int HTTPSession::read(char* buffer, std::streamsize length)
|
||||
{
|
||||
int n = (int) (_pEnd - _pCurrent);
|
||||
if (n > length) n = (int) length;
|
||||
memcpy(buffer, _pCurrent, n);
|
||||
std::memcpy(buffer, _pCurrent, n);
|
||||
_pCurrent += n;
|
||||
return n;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// IPAddress.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/IPAddress.cpp#15 $
|
||||
// $Id: //poco/Main/Net/src/IPAddress.cpp#16 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: NetCore
|
||||
@ -40,7 +40,7 @@
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include "Poco/Types.h"
|
||||
#include <algorithm>
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
using Poco::RefCountedObject;
|
||||
@ -103,12 +103,12 @@ class IPv4AddressImpl: public IPAddressImpl
|
||||
public:
|
||||
IPv4AddressImpl()
|
||||
{
|
||||
memset(&_addr, 0, sizeof(_addr));
|
||||
std::memset(&_addr, 0, sizeof(_addr));
|
||||
}
|
||||
|
||||
IPv4AddressImpl(const void* addr)
|
||||
{
|
||||
memcpy(&_addr, addr, sizeof(_addr));
|
||||
std::memcpy(&_addr, addr, sizeof(_addr));
|
||||
}
|
||||
|
||||
std::string toString() const
|
||||
@ -260,12 +260,12 @@ class IPv6AddressImpl: public IPAddressImpl
|
||||
public:
|
||||
IPv6AddressImpl()
|
||||
{
|
||||
memset(&_addr, 0, sizeof(_addr));
|
||||
std::memset(&_addr, 0, sizeof(_addr));
|
||||
}
|
||||
|
||||
IPv6AddressImpl(const void* addr)
|
||||
{
|
||||
memcpy(&_addr, addr, sizeof(_addr));
|
||||
std::memcpy(&_addr, addr, sizeof(_addr));
|
||||
}
|
||||
|
||||
std::string toString() const
|
||||
@ -426,7 +426,7 @@ public:
|
||||
#if defined(_WIN32)
|
||||
struct addrinfo* pAI;
|
||||
struct addrinfo hints;
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
std::memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_NUMERICHOST;
|
||||
int rc = getaddrinfo(addr.c_str(), NULL, &hints, &pAI);
|
||||
if (rc == 0)
|
||||
@ -651,7 +651,7 @@ bool IPAddress::operator == (const IPAddress& a) const
|
||||
poco_socklen_t l1 = length();
|
||||
poco_socklen_t l2 = a.length();
|
||||
if (l1 == l2)
|
||||
return memcmp(addr(), a.addr(), l1) == 0;
|
||||
return std::memcmp(addr(), a.addr(), l1) == 0;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
@ -662,7 +662,7 @@ bool IPAddress::operator != (const IPAddress& a) const
|
||||
poco_socklen_t l1 = length();
|
||||
poco_socklen_t l2 = a.length();
|
||||
if (l1 == l2)
|
||||
return memcmp(addr(), a.addr(), l1) != 0;
|
||||
return std::memcmp(addr(), a.addr(), l1) != 0;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
@ -673,7 +673,7 @@ bool IPAddress::operator < (const IPAddress& a) const
|
||||
poco_socklen_t l1 = length();
|
||||
poco_socklen_t l2 = a.length();
|
||||
if (l1 == l2)
|
||||
return memcmp(addr(), a.addr(), l1) < 0;
|
||||
return std::memcmp(addr(), a.addr(), l1) < 0;
|
||||
else
|
||||
return l1 < l2;
|
||||
}
|
||||
@ -684,7 +684,7 @@ bool IPAddress::operator <= (const IPAddress& a) const
|
||||
poco_socklen_t l1 = length();
|
||||
poco_socklen_t l2 = a.length();
|
||||
if (l1 == l2)
|
||||
return memcmp(addr(), a.addr(), l1) <= 0;
|
||||
return std::memcmp(addr(), a.addr(), l1) <= 0;
|
||||
else
|
||||
return l1 < l2;
|
||||
}
|
||||
@ -695,7 +695,7 @@ bool IPAddress::operator > (const IPAddress& a) const
|
||||
poco_socklen_t l1 = length();
|
||||
poco_socklen_t l2 = a.length();
|
||||
if (l1 == l2)
|
||||
return memcmp(addr(), a.addr(), l1) > 0;
|
||||
return std::memcmp(addr(), a.addr(), l1) > 0;
|
||||
else
|
||||
return l1 > l2;
|
||||
}
|
||||
@ -706,7 +706,7 @@ bool IPAddress::operator >= (const IPAddress& a) const
|
||||
poco_socklen_t l1 = length();
|
||||
poco_socklen_t l2 = a.length();
|
||||
if (l1 == l2)
|
||||
return memcmp(addr(), a.addr(), l1) >= 0;
|
||||
return std::memcmp(addr(), a.addr(), l1) >= 0;
|
||||
else
|
||||
return l1 > l2;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// MailMessage.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/MailMessage.cpp#9 $
|
||||
// $Id: //poco/Main/Net/src/MailMessage.cpp#10 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Mail
|
||||
@ -50,7 +50,7 @@
|
||||
#include "Poco/DateTimeParser.h"
|
||||
#include "Poco/String.h"
|
||||
#include <sstream>
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
using Poco::Base64Encoder;
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// MediaType.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/MediaType.cpp#7 $
|
||||
// $Id: //poco/Main/Net/src/MediaType.cpp#8 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Messages
|
||||
@ -38,7 +38,7 @@
|
||||
#include "Poco/Net/MessageHeader.h"
|
||||
#include "Poco/String.h"
|
||||
#include <algorithm>
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
using Poco::icompare;
|
||||
@ -179,10 +179,10 @@ void MediaType::parse(const std::string& mediaType)
|
||||
_parameters.clear();
|
||||
std::string::const_iterator it = mediaType.begin();
|
||||
std::string::const_iterator end = mediaType.end();
|
||||
while (it != end && isspace(*it)) ++it;
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end && *it != '/') _type += *it++;
|
||||
if (it != end) ++it;
|
||||
while (it != end && *it != ';' && !isspace(*it)) _subType += *it++;
|
||||
while (it != end && *it != ';' && !std::isspace(*it)) _subType += *it++;
|
||||
while (it != end && *it != ';') ++it;
|
||||
MessageHeader::splitParameters(it, end, _parameters);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// MessageHeader.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/MessageHeader.cpp#11 $
|
||||
// $Id: //poco/Main/Net/src/MessageHeader.cpp#12 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Messages
|
||||
@ -37,7 +37,7 @@
|
||||
#include "Poco/Net/MessageHeader.h"
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include "Poco/String.h"
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@ -90,7 +90,7 @@ void MessageHeader::read(std::istream& istr)
|
||||
if (ch == '\n') { ch = istr.get(); continue; } // ignore invalid header lines
|
||||
if (ch != ':') throw MessageException("Field name too long/no colon found");
|
||||
if (ch != eof) ch = istr.get(); // ':'
|
||||
while (isspace(ch)) ch = istr.get();
|
||||
while (std::isspace(ch)) ch = istr.get();
|
||||
while (ch != eof && ch != '\r' && ch != '\n' && value.length() < MAX_VALUE_LENGTH) { value += ch; ch = istr.get(); }
|
||||
if (ch == '\r') ch = istr.get();
|
||||
if (ch == '\n')
|
||||
@ -164,7 +164,7 @@ void MessageHeader::splitParameters(const std::string& s, std::string& value, Na
|
||||
parameters.clear();
|
||||
std::string::const_iterator it = s.begin();
|
||||
std::string::const_iterator end = s.end();
|
||||
while (it != end && isspace(*it)) ++it;
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end && *it != ';') value += *it++;
|
||||
Poco::trimRightInPlace(value);
|
||||
if (it != end) ++it;
|
||||
@ -179,11 +179,11 @@ void MessageHeader::splitParameters(const std::string::const_iterator& begin, co
|
||||
{
|
||||
std::string pname;
|
||||
std::string pvalue;
|
||||
while (it != end && isspace(*it)) ++it;
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end && *it != '=' && *it != ';') pname += *it++;
|
||||
Poco::trimRightInPlace(pname);
|
||||
if (it != end && *it != ';') ++it;
|
||||
while (it != end && isspace(*it)) ++it;
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end && *it != ';')
|
||||
{
|
||||
if (*it == '"')
|
||||
@ -219,7 +219,7 @@ void MessageHeader::quote(const std::string& value, std::string& result, bool al
|
||||
bool mustQuote = false;
|
||||
for (std::string::const_iterator it = value.begin(); !mustQuote && it != value.end(); ++it)
|
||||
{
|
||||
if (!isalnum(*it) && *it != '.' && *it != '_' && *it != '-' && !(isspace(*it) && allowSpace))
|
||||
if (!std::isalnum(*it) && *it != '.' && *it != '_' && *it != '-' && !(std::isspace(*it) && allowSpace))
|
||||
mustQuote = true;
|
||||
}
|
||||
if (mustQuote) result += '"';
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// MulticastSocket.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/MulticastSocket.cpp#10 $
|
||||
// $Id: //poco/Main/Net/src/MulticastSocket.cpp#11 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
#include "Poco/Net/MulticastSocket.h"
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
#if defined(hpux) && defined(_XOPEN_SOURCE_EXTENDED)
|
||||
@ -214,15 +214,15 @@ void MulticastSocket::joinGroup(const IPAddress& groupAddress, const NetworkInte
|
||||
if (groupAddress.af() == AF_INET)
|
||||
{
|
||||
struct ip_mreq mr;
|
||||
memcpy(&mr.imr_multiaddr, groupAddress.addr(), groupAddress.length());
|
||||
memcpy(&mr.imr_interface, interface.address().addr(), interface.address().length());
|
||||
std::memcpy(&mr.imr_multiaddr, groupAddress.addr(), groupAddress.length());
|
||||
std::memcpy(&mr.imr_interface, interface.address().addr(), interface.address().length());
|
||||
impl()->setRawOption(IPPROTO_IP, IP_ADD_MEMBERSHIP, &mr, sizeof(mr));
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(POCO_HAVE_IPv6)
|
||||
struct ipv6_mreq mr;
|
||||
memcpy(&mr.ipv6mr_multiaddr, groupAddress.addr(), groupAddress.length());
|
||||
std::memcpy(&mr.ipv6mr_multiaddr, groupAddress.addr(), groupAddress.length());
|
||||
mr.ipv6mr_interface = interface.index();
|
||||
impl()->setRawOption(IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mr, sizeof(mr));
|
||||
#endif
|
||||
@ -242,15 +242,15 @@ void MulticastSocket::leaveGroup(const IPAddress& groupAddress, const NetworkInt
|
||||
if (groupAddress.af() == AF_INET)
|
||||
{
|
||||
struct ip_mreq mr;
|
||||
memcpy(&mr.imr_multiaddr, groupAddress.addr(), groupAddress.length());
|
||||
memcpy(&mr.imr_interface, interface.address().addr(), interface.address().length());
|
||||
std::memcpy(&mr.imr_multiaddr, groupAddress.addr(), groupAddress.length());
|
||||
std::memcpy(&mr.imr_interface, interface.address().addr(), interface.address().length());
|
||||
impl()->setRawOption(IPPROTO_IP, IP_DROP_MEMBERSHIP, &mr, sizeof(mr));
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(POCO_HAVE_IPv6)
|
||||
struct ipv6_mreq mr;
|
||||
memcpy(&mr.ipv6mr_multiaddr, groupAddress.addr(), groupAddress.length());
|
||||
std::memcpy(&mr.ipv6mr_multiaddr, groupAddress.addr(), groupAddress.length());
|
||||
mr.ipv6mr_interface = interface.index();
|
||||
impl()->setRawOption(IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP, &mr, sizeof(mr));
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// MultipartReader.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/MultipartReader.cpp#10 $
|
||||
// $Id: //poco/Main/Net/src/MultipartReader.cpp#11 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Messages
|
||||
@ -37,7 +37,7 @@
|
||||
#include "Poco/Net/MultipartReader.h"
|
||||
#include "Poco/Net/MessageHeader.h"
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
using Poco::BufferedStreamBuf;
|
||||
@ -267,7 +267,7 @@ void MultipartReader::guessBoundary()
|
||||
{
|
||||
static const int eof = std::char_traits<char>::eof();
|
||||
int ch = _istr.get();
|
||||
while (isspace(ch))
|
||||
while (std::isspace(ch))
|
||||
ch = _istr.get();
|
||||
if (ch == '-' && _istr.peek() == '-')
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// NetworkInterface.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/NetworkInterface.cpp#18 $
|
||||
// $Id: //poco/Main/Net/src/NetworkInterface.cpp#20 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@ -39,7 +39,7 @@
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include "Poco/RefCountedObject.h"
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
using Poco::NumberFormatter;
|
||||
@ -95,7 +95,7 @@ NetworkInterfaceImpl::NetworkInterfaceImpl(const std::string& name, const IPAddr
|
||||
if (index == -1) // IPv4
|
||||
{
|
||||
struct ifreq ifr;
|
||||
strncpy(ifr.ifr_name, name.c_str(), IFNAMSIZ);
|
||||
std::strncpy(ifr.ifr_name, name.c_str(), IFNAMSIZ);
|
||||
DatagramSocket ds(IPAddress::IPv4);
|
||||
ds.impl()->ioctl(SIOCGIFNETMASK, &ifr);
|
||||
if (ifr.ifr_addr.sa_family == AF_INET)
|
||||
@ -273,7 +273,7 @@ NetworkInterface NetworkInterface::forName(const std::string& name, bool require
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
struct ifreq ifr;
|
||||
strncpy(ifr.ifr_name, name.c_str(), IFNAMSIZ);
|
||||
std::strncpy(ifr.ifr_name, name.c_str(), IFNAMSIZ);
|
||||
DatagramSocket ds(requireIPv6 ? IPAddress::IPv6 : IPAddress::IPv4);
|
||||
ds.impl()->ioctl(SIOCGIFADDR, &ifr);
|
||||
IPAddress addr;
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// POP3ClientSession.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/POP3ClientSession.cpp#7 $
|
||||
// $Id: //poco/Main/Net/src/POP3ClientSession.cpp#8 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Mail
|
||||
@ -43,7 +43,7 @@
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include "Poco/UnbufferedStreamBuf.h"
|
||||
#include <istream>
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
using Poco::NumberFormatter;
|
||||
@ -184,9 +184,9 @@ int POP3ClientSession::messageCount()
|
||||
std::string::const_iterator it = response.begin();
|
||||
std::string::const_iterator end = response.end();
|
||||
int count = 0;
|
||||
while (it != end && !isspace(*it)) ++it;
|
||||
while (it != end && isspace(*it)) ++it;
|
||||
while (it != end && isdigit(*it)) count = count*10 + *it++ - '0';
|
||||
while (it != end && !std::isspace(*it)) ++it;
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end && std::isdigit(*it)) count = count*10 + *it++ - '0';
|
||||
return count;
|
||||
}
|
||||
|
||||
@ -203,9 +203,9 @@ void POP3ClientSession::listMessages(MessageInfoVec& messages)
|
||||
MessageInfo info = {0, 0};
|
||||
std::string::const_iterator it = response.begin();
|
||||
std::string::const_iterator end = response.end();
|
||||
while (it != end && isdigit(*it)) info.id = info.id*10 + *it++ - '0';
|
||||
while (it != end && isspace(*it)) ++it;
|
||||
while (it != end && isdigit(*it)) info.size = info.size*10 + *it++ - '0';
|
||||
while (it != end && std::isdigit(*it)) info.id = info.id*10 + *it++ - '0';
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end && std::isdigit(*it)) info.size = info.size*10 + *it++ - '0';
|
||||
messages.push_back(info);
|
||||
_socket.receiveMessage(response);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// QuotedPrintableDecoder.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/QuotedPrintableDecoder.cpp#8 $
|
||||
// $Id: //poco/Main/Net/src/QuotedPrintableDecoder.cpp#10 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Messages
|
||||
@ -37,7 +37,7 @@
|
||||
#include "Poco/Net/QuotedPrintableDecoder.h"
|
||||
#include "Poco/NumberParser.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include <ctype.h>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
using Poco::UnbufferedStreamBuf;
|
||||
@ -70,12 +70,12 @@ int QuotedPrintableDecoderBuf::readFromDevice()
|
||||
{
|
||||
ch = _istr.get(); // read \n
|
||||
}
|
||||
else if (isxdigit(ch))
|
||||
else if (std::isxdigit(ch))
|
||||
{
|
||||
std::string hex;
|
||||
hex += (char) ch;
|
||||
ch = _istr.get();
|
||||
if (isxdigit(ch))
|
||||
if (std::isxdigit(ch))
|
||||
{
|
||||
hex += (char) ch;
|
||||
return NumberParser::parseHex(hex);
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Socket.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/Socket.cpp#10 $
|
||||
// $Id: //poco/Main/Net/src/Socket.cpp#13 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@ -38,7 +38,7 @@
|
||||
#include "Poco/Net/StreamSocketImpl.h"
|
||||
#include "Poco/Timestamp.h"
|
||||
#include <algorithm>
|
||||
#include <string.h>
|
||||
#include <string.h> // FD_SET needs memset on some platforms, so we can't use <cstring>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// SocketAddress.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/SocketAddress.cpp#12 $
|
||||
// $Id: //poco/Main/Net/src/SocketAddress.cpp#13 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: NetCore
|
||||
@ -42,7 +42,7 @@
|
||||
#include "Poco/NumberParser.h"
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include <algorithm>
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
using Poco::RefCountedObject;
|
||||
@ -90,21 +90,21 @@ class IPv4SocketAddressImpl: public SocketAddressImpl
|
||||
public:
|
||||
IPv4SocketAddressImpl()
|
||||
{
|
||||
memset(&_addr, 0, sizeof(_addr));
|
||||
std::memset(&_addr, 0, sizeof(_addr));
|
||||
_addr.sin_family = AF_INET;
|
||||
poco_set_sin_len(&_addr);
|
||||
}
|
||||
|
||||
IPv4SocketAddressImpl(const struct sockaddr_in* addr)
|
||||
{
|
||||
memcpy(&_addr, addr, sizeof(_addr));
|
||||
std::memcpy(&_addr, addr, sizeof(_addr));
|
||||
}
|
||||
|
||||
IPv4SocketAddressImpl(const void* addr, UInt16 port)
|
||||
{
|
||||
memset(&_addr, 0, sizeof(_addr));
|
||||
std::memset(&_addr, 0, sizeof(_addr));
|
||||
_addr.sin_family = AF_INET;
|
||||
memcpy(&_addr.sin_addr, addr, sizeof(_addr.sin_addr));
|
||||
std::memcpy(&_addr.sin_addr, addr, sizeof(_addr.sin_addr));
|
||||
_addr.sin_port = port;
|
||||
}
|
||||
|
||||
@ -146,15 +146,15 @@ class IPv6SocketAddressImpl: public SocketAddressImpl
|
||||
public:
|
||||
IPv6SocketAddressImpl(const struct sockaddr_in6* addr)
|
||||
{
|
||||
memcpy(&_addr, addr, sizeof(_addr));
|
||||
std::memcpy(&_addr, addr, sizeof(_addr));
|
||||
}
|
||||
|
||||
IPv6SocketAddressImpl(const void* addr, UInt16 port)
|
||||
{
|
||||
memset(&_addr, 0, sizeof(_addr));
|
||||
std::memset(&_addr, 0, sizeof(_addr));
|
||||
_addr.sin6_family = AF_INET6;
|
||||
poco_set_sin6_len(&_addr);
|
||||
memcpy(&_addr.sin6_addr, addr, sizeof(_addr.sin6_addr));
|
||||
std::memcpy(&_addr.sin6_addr, addr, sizeof(_addr.sin6_addr));
|
||||
_addr.sin6_port = port;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// SocketImpl.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/SocketImpl.cpp#19 $
|
||||
// $Id: //poco/Main/Net/src/SocketImpl.cpp#22 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
@ -39,7 +39,7 @@
|
||||
#include "Poco/Net/StreamSocketImpl.h"
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include "Poco/Timestamp.h"
|
||||
#include <string.h>
|
||||
#include <string.h> // FD_SET needs memset on some platforms, so we can't use <cstring>
|
||||
|
||||
|
||||
using Poco::IOException;
|
||||
|
Loading…
Reference in New Issue
Block a user