Added missing VMIME_HAVE_TLS_SUPPORT guards (pull request #74).

This commit is contained in:
Vincent Richard 2014-04-01 22:39:13 +02:00
parent bbfdcc36a0
commit c08d8145d8
2 changed files with 31 additions and 5 deletions

View File

@ -39,21 +39,34 @@ namespace net {
session::session()
: m_tlsProps(make_shared <tls::TLSProperties>())
{
#if VMIME_HAVE_TLS_SUPPORT
m_tlsProps = make_shared <tls::TLSProperties>();
#endif // VMIME_HAVE_TLS_SUPPORT
}
session::session(const session& sess)
: object(), m_props(sess.m_props),
m_tlsProps(make_shared <tls::TLSProperties>(*sess.m_tlsProps))
: object(), m_props(sess.m_props)
{
#if VMIME_HAVE_TLS_SUPPORT
m_tlsProps = make_shared <tls::TLSProperties>(*sess.m_tlsProps);
#endif // VMIME_HAVE_TLS_SUPPORT
}
session::session(const propertySet& props)
: m_props(props), m_tlsProps(make_shared <tls::TLSProperties>())
: m_props(props)
{
#if VMIME_HAVE_TLS_SUPPORT
m_tlsProps = make_shared <tls::TLSProperties>();
#endif // VMIME_HAVE_TLS_SUPPORT
}
@ -138,6 +151,8 @@ propertySet& session::getProperties()
}
#if VMIME_HAVE_TLS_SUPPORT
void session::setTLSProperties(shared_ptr <tls::TLSProperties> tlsProps)
{
m_tlsProps = make_shared <tls::TLSProperties>(*tlsProps);
@ -149,6 +164,8 @@ shared_ptr <tls::TLSProperties> session::getTLSProperties() const
return m_tlsProps;
}
#endif // VMIME_HAVE_TLS_SUPPORT
} // net
} // vmime

View File

@ -33,7 +33,9 @@
#include "vmime/security/authenticator.hpp"
#include "vmime/net/tls/TLSProperties.hpp"
#if VMIME_HAVE_TLS_SUPPORT
# include "vmime/net/tls/TLSProperties.hpp"
#endif // VMIME_HAVE_TLS_SUPPORT
#include "vmime/utility/url.hpp"
@ -149,6 +151,8 @@ public:
*/
propertySet& getProperties();
#if VMIME_HAVE_TLS_SUPPORT
/** Set properties for SSL/TLS secured connections in this session.
*
* @param tlsProps SSL/TLS properties
@ -161,11 +165,16 @@ public:
*/
shared_ptr <tls::TLSProperties> getTLSProperties() const;
#endif // VMIME_HAVE_TLS_SUPPORT
private:
propertySet m_props;
#if VMIME_HAVE_TLS_SUPPORT
shared_ptr <tls::TLSProperties> m_tlsProps;
#endif // VMIME_HAVE_TLS_SUPPORT
};