From a4710c0d4629e0234e7f97424499fb4aa348489e Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Mon, 30 May 2011 21:36:06 +0000 Subject: [PATCH] Move ServerConnection class from the IMAP add-on to libmail.so. This avoids to init SSL each time an IMAP add-on is loaded. SMTP and POP still have this problem! TODO: use the ServerConnection class in these add-ons too. This would also remove a lot of #ifdef SSL form these add-ons. Will not do it in the near future, feel free to fix it ... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41840 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../private/mail}/ServerConnection.h | 0 .../inbound_protocols/imap/Jamfile | 15 +----------- src/kits/mail/Jamfile | 23 ++++++++++++++++++- .../mail}/ServerConnection.cpp | 0 4 files changed, 23 insertions(+), 15 deletions(-) rename {src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib => headers/private/mail}/ServerConnection.h (100%) rename src/{add-ons/mail_daemon/inbound_protocols/imap/imap_lib => kits/mail}/ServerConnection.cpp (100%) diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.h b/headers/private/mail/ServerConnection.h similarity index 100% rename from src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.h rename to headers/private/mail/ServerConnection.h diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile b/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile index 9dec9bb404..9c2e7431fe 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile @@ -27,26 +27,13 @@ local sources = IMAPParser.cpp IMAPProtocol.cpp IMAPStorage.cpp - ServerConnection.cpp ; -# use OpenSSL, if enabled -if $(HAIKU_OPENSSL_ENABLED) { - SubDirC++Flags -DUSE_SSL ; - SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ; - Includes [ FGristFiles $(sources) ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ; - # Dependency needed to trigger downloading/unzipping the package before - # compiling the files. - SetupFeatureObjectsDir ssl ; -} else { - SetupFeatureObjectsDir no-ssl ; -} - Addon IMAP : $(sources) : - be libmail.so $(TARGET_NETWORK_LIBS) $(HAIKU_OPENSSL_LIBS) libalm.so + be libmail.so $(TARGET_NETWORK_LIBS) libalm.so libshared.a $(TARGET_LIBSUPC++) $(TARGET_LIBSTDC++) ; diff --git a/src/kits/mail/Jamfile b/src/kits/mail/Jamfile index 19f1351526..0ea5acb037 100644 --- a/src/kits/mail/Jamfile +++ b/src/kits/mail/Jamfile @@ -11,7 +11,8 @@ SubDirC++Flags -D_BUILDING_mail=1 ; UsePrivateHeaders textencoding ; -SharedLibrary libmail.so : + +local sources = c_mail_api.cpp crypt.cpp des.c @@ -29,7 +30,26 @@ SharedLibrary libmail.so : NodeMessage.cpp numailkit.cpp ProtocolConfigView.cpp + ServerConnection.cpp StringList.cpp +; + + +# use OpenSSL, if enabled +if $(HAIKU_OPENSSL_ENABLED) { + SubDirC++Flags -DUSE_SSL ; + SubDirSysHdrs $(HAIKU_OPENSSL_HEADERS) ; + Includes [ FGristFiles $(sources) ] : $(HAIKU_OPENSSL_HEADERS_DEPENDENCY) ; + # Dependency needed to trigger downloading/unzipping the package before + # compiling the files. + SetupFeatureObjectsDir ssl ; +} else { + SetupFeatureObjectsDir no-ssl ; +} + + +SharedLibrary libmail.so : + $(sources) : be libtextencoding.so @@ -37,4 +57,5 @@ SharedLibrary libmail.so : $(TARGET_LIBSTDC++) $(TARGET_NETWORK_LIBS) $(TARGET_SELECT_UNAME_ETC_LIB) + $(HAIKU_OPENSSL_LIBS) ; diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.cpp b/src/kits/mail/ServerConnection.cpp similarity index 100% rename from src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.cpp rename to src/kits/mail/ServerConnection.cpp