Skip to content

Commit

Permalink
Revert "GH pocoproject#1050 NetSSL_OpenSSL: fix gcc -Wshadow warnings"
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig authored Sep 5, 2016
1 parent 8187032 commit 81b140e
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 74 deletions.
12 changes: 6 additions & 6 deletions Foundation/include/Poco/Optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ class Optional
{
}

Optional(const C& rValue):
Optional(const C& value):
/// Creates a Optional with the given value.
_value(rValue),
_value(value),
_isSpecified(true)
{
}
Expand All @@ -81,10 +81,10 @@ class Optional
{
}

Optional& assign(const C& rValue)
Optional& assign(const C& value)
/// Assigns a value to the Optional.
{
_value = rValue;
_value = value;
_isSpecified = true;
return *this;
}
Expand All @@ -97,9 +97,9 @@ class Optional
return *this;
}

Optional& operator = (const C& rValue)
Optional& operator = (const C& value)
{
return assign(rValue);
return assign(value);
}

Optional& operator = (const Optional& other)
Expand Down
8 changes: 4 additions & 4 deletions Net/src/MailMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ void MailMessage::addRecipient(const MailRecipient& recipient)
}


void MailMessage::setRecipients(const Recipients& rRecipients)
void MailMessage::setRecipients(const Recipients& recipients)
{
_recipients.assign(rRecipients.begin(), rRecipients.end());
_recipients.assign(recipients.begin(), recipients.end());
}


Expand Down Expand Up @@ -326,12 +326,12 @@ void MailMessage::addAttachment(const std::string& name, PartSource* pSource, Co
}


void MailMessage::read(std::istream& istr, PartHandler& rHandler)
void MailMessage::read(std::istream& istr, PartHandler& handler)
{
readHeader(istr);
if (isMultipart())
{
readMultipart(istr, rHandler);
readMultipart(istr, handler);
}
else
{
Expand Down
24 changes: 12 additions & 12 deletions NetSSL_OpenSSL/src/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Context::Params::Params():
}


Context::Context(Usage contextUsage, const Params& params):
_usage(contextUsage),
Context::Context(Usage usage, const Params& params):
_usage(usage),
_mode(params.verificationMode),
_pSSLContext(0),
_extendedCertificateVerification(true)
Expand All @@ -52,24 +52,24 @@ Context::Context(Usage contextUsage, const Params& params):


Context::Context(
Usage contextUsage,
Usage usage,
const std::string& privateKeyFile,
const std::string& certificateFile,
const std::string& caLocation,
VerificationMode mode,
VerificationMode verificationMode,
int verificationDepth,
bool loadDefaultCAs,
const std::string& cipherList):
_usage(contextUsage),
_mode(mode),
_usage(usage),
_mode(verificationMode),
_pSSLContext(0),
_extendedCertificateVerification(true)
{
Params params;
params.privateKeyFile = privateKeyFile;
params.certificateFile = certificateFile;
params.caLocation = caLocation;
params.verificationMode = mode;
params.verificationMode = verificationMode;
params.verificationDepth = verificationDepth;
params.loadDefaultCAs = loadDefaultCAs;
params.cipherList = cipherList;
Expand All @@ -78,20 +78,20 @@ Context::Context(


Context::Context(
Usage contextUsage,
Usage usage,
const std::string& caLocation,
VerificationMode mode,
VerificationMode verificationMode,
int verificationDepth,
bool loadDefaultCAs,
const std::string& cipherList):
_usage(contextUsage),
_mode(mode),
_usage(usage),
_mode(verificationMode),
_pSSLContext(0),
_extendedCertificateVerification(true)
{
Params params;
params.caLocation = caLocation;
params.verificationMode = mode;
params.verificationMode = verificationMode;
params.verificationDepth = verificationDepth;
params.loadDefaultCAs = loadDefaultCAs;
params.cipherList = cipherList;
Expand Down
12 changes: 6 additions & 6 deletions NetSSL_OpenSSL/src/HTTPSClientSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ HTTPSClientSession::HTTPSClientSession():
}


HTTPSClientSession::HTTPSClientSession(const SecureStreamSocket& rSocket):
HTTPClientSession(rSocket),
_pContext(rSocket.context())
HTTPSClientSession::HTTPSClientSession(const SecureStreamSocket& socket):
HTTPClientSession(socket),
_pContext(socket.context())
{
setPort(HTTPS_PORT);
}


HTTPSClientSession::HTTPSClientSession(const SecureStreamSocket& rSocket, Session::Ptr pSession):
HTTPClientSession(rSocket),
_pContext(rSocket.context()),
HTTPSClientSession::HTTPSClientSession(const SecureStreamSocket& socket, Session::Ptr pSession):
HTTPClientSession(socket),
_pContext(socket.context()),
_pSession(pSession)
{
setPort(HTTPS_PORT);
Expand Down
4 changes: 2 additions & 2 deletions NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ namespace Poco {
namespace Net {


SecureSMTPClientSession::SecureSMTPClientSession(const StreamSocket& rSocket):
SMTPClientSession(rSocket)
SecureSMTPClientSession::SecureSMTPClientSession(const StreamSocket& socket):
SMTPClientSession(socket)
{
}

Expand Down
16 changes: 8 additions & 8 deletions NetSSL_OpenSSL/src/SecureServerSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ SecureServerSocket::SecureServerSocket(const Socket& socket):
}


SecureServerSocket::SecureServerSocket(const SocketAddress& rAddress, int backlog):
SecureServerSocket::SecureServerSocket(const SocketAddress& address, int backlog):
ServerSocket(new SecureServerSocketImpl(SSLManager::instance().defaultServerContext()), true)
{
impl()->bind(rAddress, true);
impl()->bind(address, true);
impl()->listen(backlog);
}


SecureServerSocket::SecureServerSocket(const SocketAddress& rAddress, int backlog, Context::Ptr pContext):
SecureServerSocket::SecureServerSocket(const SocketAddress& address, int backlog, Context::Ptr pContext):
ServerSocket(new SecureServerSocketImpl(pContext), true)
{
impl()->bind(rAddress, true);
impl()->bind(address, true);
impl()->listen(backlog);
}

Expand All @@ -68,17 +68,17 @@ SecureServerSocket::SecureServerSocket(Poco::UInt16 port, int backlog):
ServerSocket(new SecureServerSocketImpl(SSLManager::instance().defaultServerContext()), true)
{
IPAddress wildcardAddr;
SocketAddress socketAddress(wildcardAddr, port);
impl()->bind(socketAddress, true);
SocketAddress address(wildcardAddr, port);
impl()->bind(address, true);
impl()->listen(backlog);
}

SecureServerSocket::SecureServerSocket(Poco::UInt16 port, int backlog, Context::Ptr pContext):
ServerSocket(new SecureServerSocketImpl(pContext), true)
{
IPAddress wildcardAddr;
SocketAddress socketAddress(wildcardAddr, port);
impl()->bind(socketAddress, true);
SocketAddress address(wildcardAddr, port);
impl()->bind(address, true);
impl()->listen(backlog);
}

Expand Down
14 changes: 7 additions & 7 deletions NetSSL_OpenSSL/src/SecureServerSocketImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,27 @@ SocketImpl* SecureServerSocketImpl::acceptConnection(SocketAddress& clientAddr)
}


void SecureServerSocketImpl::connect(const SocketAddress& rAddress)
void SecureServerSocketImpl::connect(const SocketAddress& address)
{
throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket");
}


void SecureServerSocketImpl::connect(const SocketAddress& rAddress, const Poco::Timespan& timeout)
void SecureServerSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout)
{
throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket");
}


void SecureServerSocketImpl::connectNB(const SocketAddress& rAddress)
void SecureServerSocketImpl::connectNB(const SocketAddress& address)
{
throw Poco::InvalidAccessException("Cannot connect() a SecureServerSocket");
}


void SecureServerSocketImpl::bind(const SocketAddress& rAddress, bool reuseAddress)
void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddress)
{
_impl.bind(rAddress, reuseAddress);
_impl.bind(address, reuseAddress);
reset(_impl.sockfd());
}

Expand Down Expand Up @@ -97,13 +97,13 @@ int SecureServerSocketImpl::receiveBytes(void* buffer, int length, int flags)
}


int SecureServerSocketImpl::sendTo(const void* buffer, int length, const SocketAddress& rAddress, int flags)
int SecureServerSocketImpl::sendTo(const void* buffer, int length, const SocketAddress& address, int flags)
{
throw Poco::InvalidAccessException("Cannot sendTo() on a SecureServerSocket");
}


int SecureServerSocketImpl::receiveFrom(void* buffer, int length, SocketAddress& rAddress, int flags)
int SecureServerSocketImpl::receiveFrom(void* buffer, int length, SocketAddress& address, int flags)
{
throw Poco::InvalidAccessException("Cannot receiveFrom() on a SecureServerSocket");
}
Expand Down
24 changes: 12 additions & 12 deletions NetSSL_OpenSSL/src/SecureStreamSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,50 +47,50 @@ SecureStreamSocket::SecureStreamSocket(Context::Ptr pContext, Session::Ptr pSess
}


SecureStreamSocket::SecureStreamSocket(const SocketAddress& rAddress):
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address):
StreamSocket(new SecureStreamSocketImpl(SSLManager::instance().defaultClientContext()))
{
connect(rAddress);
connect(address);
}


SecureStreamSocket::SecureStreamSocket(const SocketAddress& rAddress, const std::string& hostName):
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address, const std::string& hostName):
StreamSocket(new SecureStreamSocketImpl(SSLManager::instance().defaultClientContext()))
{
static_cast<SecureStreamSocketImpl*>(impl())->setPeerHostName(hostName);
connect(rAddress);
connect(address);
}


SecureStreamSocket::SecureStreamSocket(const SocketAddress& rAddress, Context::Ptr pContext):
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address, Context::Ptr pContext):
StreamSocket(new SecureStreamSocketImpl(pContext))
{
connect(rAddress);
connect(address);
}


SecureStreamSocket::SecureStreamSocket(const SocketAddress& rAddress, Context::Ptr pContext, Session::Ptr pSession):
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address, Context::Ptr pContext, Session::Ptr pSession):
StreamSocket(new SecureStreamSocketImpl(pContext))
{
useSession(pSession);
connect(rAddress);
connect(address);
}


SecureStreamSocket::SecureStreamSocket(const SocketAddress& rAddress, const std::string& hostName, Context::Ptr pContext):
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address, const std::string& hostName, Context::Ptr pContext):
StreamSocket(new SecureStreamSocketImpl(pContext))
{
static_cast<SecureStreamSocketImpl*>(impl())->setPeerHostName(hostName);
connect(rAddress);
connect(address);
}


SecureStreamSocket::SecureStreamSocket(const SocketAddress& rAddress, const std::string& hostName, Context::Ptr pContext, Session::Ptr pSession):
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address, const std::string& hostName, Context::Ptr pContext, Session::Ptr pSession):
StreamSocket(new SecureStreamSocketImpl(pContext))
{
static_cast<SecureStreamSocketImpl*>(impl())->setPeerHostName(hostName);
useSession(pSession);
connect(rAddress);
connect(address);
}


Expand Down
18 changes: 9 additions & 9 deletions NetSSL_OpenSSL/src/SecureStreamSocketImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ void SecureStreamSocketImpl::acceptSSL()
}


void SecureStreamSocketImpl::connect(const SocketAddress& rAddress)
void SecureStreamSocketImpl::connect(const SocketAddress& address)
{
_impl.connect(rAddress, !_lazyHandshake);
_impl.connect(address, !_lazyHandshake);
reset(_impl.sockfd());
}


void SecureStreamSocketImpl::connect(const SocketAddress& rAddress, const Poco::Timespan& timeout)
void SecureStreamSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout)
{
_impl.connect(rAddress, timeout, !_lazyHandshake);
_impl.connect(address, timeout, !_lazyHandshake);
reset(_impl.sockfd());
}


void SecureStreamSocketImpl::connectNB(const SocketAddress& rAddress)
void SecureStreamSocketImpl::connectNB(const SocketAddress& address)
{
_impl.connectNB(rAddress);
_impl.connectNB(address);
reset(_impl.sockfd());
}

Expand All @@ -91,7 +91,7 @@ void SecureStreamSocketImpl::connectSSL()
}


void SecureStreamSocketImpl::bind(const SocketAddress& rAddress, bool reuseAddress)
void SecureStreamSocketImpl::bind(const SocketAddress& address, bool reuseAddress)
{
throw Poco::InvalidAccessException("Cannot bind() a SecureStreamSocketImpl");
}
Expand Down Expand Up @@ -129,13 +129,13 @@ int SecureStreamSocketImpl::receiveBytes(void* buffer, int length, int flags)
}


int SecureStreamSocketImpl::sendTo(const void* buffer, int length, const SocketAddress& rAddress, int flags)
int SecureStreamSocketImpl::sendTo(const void* buffer, int length, const SocketAddress& address, int flags)
{
throw Poco::InvalidAccessException("Cannot sendTo() on a SecureStreamSocketImpl");
}


int SecureStreamSocketImpl::receiveFrom(void* buffer, int length, SocketAddress& rAddress, int flags)
int SecureStreamSocketImpl::receiveFrom(void* buffer, int length, SocketAddress& address, int flags)
{
throw Poco::InvalidAccessException("Cannot receiveFrom() on a SecureStreamSocketImpl");
}
Expand Down
6 changes: 3 additions & 3 deletions NetSSL_OpenSSL/src/X509Certificate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ bool X509Certificate::verify(const Poco::Crypto::X509Certificate& certificate, c
// compare by IP
const HostEntry& heData = DNS::resolve(*it);
const HostEntry::AddressList& addr = heData.addresses();
HostEntry::AddressList::const_iterator itAddr = addr.begin();
HostEntry::AddressList::const_iterator it = addr.begin();
HostEntry::AddressList::const_iterator itEnd = addr.end();
for (; itAddr != itEnd && !ok; ++itAddr)
for (; it != itEnd && !ok; ++it)
{
ok = (*itAddr == ip);
ok = (*it == ip);
}
}
else
Expand Down
Loading

0 comments on commit 81b140e

Please sign in to comment.