aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/imap/IMAPConnection.cpp9
-rw-r--r--src/net/imap/IMAPServiceInfos.cpp6
-rw-r--r--src/net/pop3/POP3ServiceInfos.cpp6
-rw-r--r--src/net/pop3/POP3Store.cpp9
-rw-r--r--src/net/service.cpp12
-rw-r--r--src/net/serviceInfos.cpp3
-rw-r--r--src/net/smtp/SMTPServiceInfos.cpp6
-rw-r--r--src/net/smtp/SMTPTransport.cpp9
-rw-r--r--src/platforms/posix/posixHandler.cpp8
-rw-r--r--src/platforms/windows/windowsHandler.cpp8
10 files changed, 18 insertions, 58 deletions
diff --git a/src/net/imap/IMAPConnection.cpp b/src/net/imap/IMAPConnection.cpp
index 180caa4b..69dfcb1e 100644
--- a/src/net/imap/IMAPConnection.cpp
+++ b/src/net/imap/IMAPConnection.cpp
@@ -85,13 +85,8 @@ void IMAPConnection::connect()
const port_t port = GET_PROPERTY(port_t, PROPERTY_SERVER_PORT);
// Create the time-out handler
- if (HAS_PROPERTY(PROPERTY_TIMEOUT_FACTORY))
- {
- timeoutHandlerFactory* tof = platformDependant::getHandler()->
- getTimeoutHandlerFactory(GET_PROPERTY(string, PROPERTY_TIMEOUT_FACTORY));
-
- m_timeoutHandler = tof->create();
- }
+ if (m_store->getTimeoutHandlerFactory())
+ m_timeoutHandler = m_store->getTimeoutHandlerFactory()->create();
// Create and connect the socket
m_socket = m_store->getSocketFactory()->create();
diff --git a/src/net/imap/IMAPServiceInfos.cpp b/src/net/imap/IMAPServiceInfos.cpp
index a5d1ca5a..85b23a34 100644
--- a/src/net/imap/IMAPServiceInfos.cpp
+++ b/src/net/imap/IMAPServiceInfos.cpp
@@ -61,8 +61,6 @@ const IMAPServiceInfos::props& IMAPServiceInfos::getProperties() const
property(serviceInfos::property::SERVER_ADDRESS, serviceInfos::property::FLAG_REQUIRED),
property(serviceInfos::property::SERVER_PORT, "143"),
-
- property(serviceInfos::property::TIMEOUT_FACTORY)
};
static props imapsProps =
@@ -84,8 +82,6 @@ const IMAPServiceInfos::props& IMAPServiceInfos::getProperties() const
property(serviceInfos::property::SERVER_ADDRESS, serviceInfos::property::FLAG_REQUIRED),
property(serviceInfos::property::SERVER_PORT, "993"),
-
- property(serviceInfos::property::TIMEOUT_FACTORY)
};
return m_imaps ? imapsProps : imapProps;
@@ -118,8 +114,6 @@ const std::vector <serviceInfos::property> IMAPServiceInfos::getAvailablePropert
list.push_back(p.PROPERTY_SERVER_ADDRESS);
list.push_back(p.PROPERTY_SERVER_PORT);
- list.push_back(p.PROPERTY_TIMEOUT_FACTORY);
-
return list;
}
diff --git a/src/net/pop3/POP3ServiceInfos.cpp b/src/net/pop3/POP3ServiceInfos.cpp
index 54a44771..27c2a7e3 100644
--- a/src/net/pop3/POP3ServiceInfos.cpp
+++ b/src/net/pop3/POP3ServiceInfos.cpp
@@ -63,8 +63,6 @@ const POP3ServiceInfos::props& POP3ServiceInfos::getProperties() const
property(serviceInfos::property::SERVER_ADDRESS, serviceInfos::property::FLAG_REQUIRED),
property(serviceInfos::property::SERVER_PORT, "110"),
-
- property(serviceInfos::property::TIMEOUT_FACTORY)
};
static props pop3sProps =
@@ -88,8 +86,6 @@ const POP3ServiceInfos::props& POP3ServiceInfos::getProperties() const
property(serviceInfos::property::SERVER_ADDRESS, serviceInfos::property::FLAG_REQUIRED),
property(serviceInfos::property::SERVER_PORT, "995"),
-
- property(serviceInfos::property::TIMEOUT_FACTORY)
};
return m_pop3s ? pop3sProps : pop3Props;
@@ -124,8 +120,6 @@ const std::vector <serviceInfos::property> POP3ServiceInfos::getAvailablePropert
list.push_back(p.PROPERTY_SERVER_ADDRESS);
list.push_back(p.PROPERTY_SERVER_PORT);
- list.push_back(p.PROPERTY_TIMEOUT_FACTORY);
-
return list;
}
diff --git a/src/net/pop3/POP3Store.cpp b/src/net/pop3/POP3Store.cpp
index 4c3ba224..1b15c9f6 100644
--- a/src/net/pop3/POP3Store.cpp
+++ b/src/net/pop3/POP3Store.cpp
@@ -123,13 +123,8 @@ void POP3Store::connect()
const port_t port = GET_PROPERTY(port_t, PROPERTY_SERVER_PORT);
// Create the time-out handler
- if (HAS_PROPERTY(PROPERTY_TIMEOUT_FACTORY))
- {
- timeoutHandlerFactory* tof = platformDependant::getHandler()->
- getTimeoutHandlerFactory(GET_PROPERTY(string, PROPERTY_TIMEOUT_FACTORY));
-
- m_timeoutHandler = tof->create();
- }
+ if (getTimeoutHandlerFactory())
+ m_timeoutHandler = getTimeoutHandlerFactory()->create();
// Create and connect the socket
m_socket = getSocketFactory()->create();
diff --git a/src/net/service.cpp b/src/net/service.cpp
index 1589f3f2..8dde675a 100644
--- a/src/net/service.cpp
+++ b/src/net/service.cpp
@@ -123,5 +123,17 @@ ref <socketFactory> service::getSocketFactory()
}
+void service::setTimeoutHandlerFactory(ref <timeoutHandlerFactory> thf)
+{
+ m_toHandlerFactory = thf;
+}
+
+
+ref <timeoutHandlerFactory> service::getTimeoutHandlerFactory()
+{
+ return m_toHandlerFactory;
+}
+
+
} // net
} // vmime
diff --git a/src/net/serviceInfos.cpp b/src/net/serviceInfos.cpp
index c76744a2..624a559e 100644
--- a/src/net/serviceInfos.cpp
+++ b/src/net/serviceInfos.cpp
@@ -40,9 +40,6 @@ const serviceInfos::property serviceInfos::property::AUTH_USERNAME
const serviceInfos::property serviceInfos::property::AUTH_PASSWORD
("auth.password", serviceInfos::property::TYPE_STRING);
-const serviceInfos::property serviceInfos::property::TIMEOUT_FACTORY
- ("timeout.factory", serviceInfos::property::TYPE_STRING);
-
#if VMIME_HAVE_TLS_SUPPORT
const serviceInfos::property serviceInfos::property::CONNECTION_TLS
diff --git a/src/net/smtp/SMTPServiceInfos.cpp b/src/net/smtp/SMTPServiceInfos.cpp
index 5563608d..a1d800cd 100644
--- a/src/net/smtp/SMTPServiceInfos.cpp
+++ b/src/net/smtp/SMTPServiceInfos.cpp
@@ -62,8 +62,6 @@ const SMTPServiceInfos::props& SMTPServiceInfos::getProperties() const
property(serviceInfos::property::SERVER_ADDRESS, serviceInfos::property::FLAG_REQUIRED),
property(serviceInfos::property::SERVER_PORT, "25"),
-
- property(serviceInfos::property::TIMEOUT_FACTORY)
};
static props smtpsProps =
@@ -86,8 +84,6 @@ const SMTPServiceInfos::props& SMTPServiceInfos::getProperties() const
property(serviceInfos::property::SERVER_ADDRESS, serviceInfos::property::FLAG_REQUIRED),
property(serviceInfos::property::SERVER_PORT, "465"),
-
- property(serviceInfos::property::TIMEOUT_FACTORY)
};
return m_smtps ? smtpsProps : smtpProps;
@@ -121,8 +117,6 @@ const std::vector <serviceInfos::property> SMTPServiceInfos::getAvailablePropert
list.push_back(p.PROPERTY_SERVER_ADDRESS);
list.push_back(p.PROPERTY_SERVER_PORT);
- list.push_back(p.PROPERTY_TIMEOUT_FACTORY);
-
return list;
}
diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp
index 645f6aa2..2e6013e9 100644
--- a/src/net/smtp/SMTPTransport.cpp
+++ b/src/net/smtp/SMTPTransport.cpp
@@ -89,13 +89,8 @@ void SMTPTransport::connect()
const port_t port = GET_PROPERTY(port_t, PROPERTY_SERVER_PORT);
// Create the time-out handler
- if (HAS_PROPERTY(PROPERTY_TIMEOUT_FACTORY))
- {
- timeoutHandlerFactory* tof = platformDependant::getHandler()->
- getTimeoutHandlerFactory(GET_PROPERTY(string, PROPERTY_TIMEOUT_FACTORY));
-
- m_timeoutHandler = tof->create();
- }
+ if (getTimeoutHandlerFactory())
+ m_timeoutHandler = getTimeoutHandlerFactory()->create();
// Create and connect the socket
m_socket = getSocketFactory()->create();
diff --git a/src/platforms/posix/posixHandler.cpp b/src/platforms/posix/posixHandler.cpp
index 8703d4c0..c8c57ce6 100644
--- a/src/platforms/posix/posixHandler.cpp
+++ b/src/platforms/posix/posixHandler.cpp
@@ -174,14 +174,6 @@ ref <vmime::net::socketFactory> posixHandler::getSocketFactory() const
return m_socketFactory.dynamicCast <vmime::net::socketFactory>();
}
-
-vmime::net::timeoutHandlerFactory* posixHandler::getTimeoutHandlerFactory
- (const vmime::string& /* name */) const
-{
- // Not used by default
- return (NULL);
-}
-
#endif
diff --git a/src/platforms/windows/windowsHandler.cpp b/src/platforms/windows/windowsHandler.cpp
index 4f5a94b5..926ccb98 100644
--- a/src/platforms/windows/windowsHandler.cpp
+++ b/src/platforms/windows/windowsHandler.cpp
@@ -239,14 +239,6 @@ ref <vmime::net::socketFactory> windowsHandler::getSocketFactory() const
return m_socketFactory.dynamicCast <vmime::net::socketFactory>();
}
-
-vmime::net::timeoutHandlerFactory* windowsHandler::getTimeoutHandlerFactory
- (const vmime::string& /* name */) const
-{
- // Not used by default
- return (NULL);
-}
-
#endif