Fixed SSL compilation, a compiler warning, and eliminated a crashing bug that would happen on connection timeouts or failures.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9362 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4578da13a4
commit
b1cec3747c
@ -118,12 +118,14 @@ class NoopWorker : public BHandler {
|
|||||||
time_t last_run;
|
time_t last_run;
|
||||||
};
|
};
|
||||||
|
|
||||||
IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BMailRemoteStorageProtocol(settings,run), commandCount(0), net(-1), selected_mb(""), noop(NULL), force_reselect(false) {
|
IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BMailRemoteStorageProtocol(settings,run), noop(NULL), commandCount(0), net(-1), selected_mb(""), force_reselect(false) {
|
||||||
err = B_OK;
|
err = B_OK;
|
||||||
|
|
||||||
mb_root = settings->FindString("root");
|
mb_root = settings->FindString("root");
|
||||||
#ifdef USESSL
|
#ifdef USESSL
|
||||||
use_ssl = (settings->FindInt32("flavor") == 1);
|
use_ssl = (settings->FindInt32("flavor") == 1);
|
||||||
|
ssl = NULL;
|
||||||
|
ctx = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int port = settings->FindInt32("port");
|
int port = settings->FindInt32("port");
|
||||||
@ -270,9 +272,11 @@ IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BMailRemot
|
|||||||
}
|
}
|
||||||
|
|
||||||
IMAP4Client::~IMAP4Client() {
|
IMAP4Client::~IMAP4Client() {
|
||||||
|
if (net > 0) {
|
||||||
if (selected_mb != "")
|
if (selected_mb != "")
|
||||||
SendCommand("CLOSE");
|
SendCommand("CLOSE");
|
||||||
SendCommand("LOGOUT");
|
SendCommand("LOGOUT");
|
||||||
|
}
|
||||||
|
|
||||||
for (int32 i = 0; i < box_info.CountItems(); i++)
|
for (int32 i = 0; i < box_info.CountItems(); i++)
|
||||||
delete (struct mailbox_info *)(box_info.ItemAt(i));
|
delete (struct mailbox_info *)(box_info.ItemAt(i));
|
||||||
@ -281,7 +285,9 @@ IMAP4Client::~IMAP4Client() {
|
|||||||
|
|
||||||
#ifdef USESSL
|
#ifdef USESSL
|
||||||
if (use_ssl) {
|
if (use_ssl) {
|
||||||
|
if (ssl)
|
||||||
SSL_shutdown(ssl);
|
SSL_shutdown(ssl);
|
||||||
|
if (ctx)
|
||||||
SSL_CTX_free(ctx);
|
SSL_CTX_free(ctx);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,11 +21,11 @@ class IMAPConfig : public BMailProtocolConfigView {
|
|||||||
|
|
||||||
IMAPConfig::IMAPConfig(BMessage *archive)
|
IMAPConfig::IMAPConfig(BMessage *archive)
|
||||||
: BMailProtocolConfigView(B_MAIL_PROTOCOL_HAS_USERNAME | B_MAIL_PROTOCOL_HAS_PASSWORD | B_MAIL_PROTOCOL_HAS_HOSTNAME | B_MAIL_PROTOCOL_CAN_LEAVE_MAIL_ON_SERVER
|
: BMailProtocolConfigView(B_MAIL_PROTOCOL_HAS_USERNAME | B_MAIL_PROTOCOL_HAS_PASSWORD | B_MAIL_PROTOCOL_HAS_HOSTNAME | B_MAIL_PROTOCOL_CAN_LEAVE_MAIL_ON_SERVER
|
||||||
#ifdef IMAPSSL
|
#ifdef USESSL
|
||||||
| B_MAIL_PROTOCOL_HAS_FLAVORS)
|
| B_MAIL_PROTOCOL_HAS_FLAVORS)
|
||||||
{
|
{
|
||||||
AddFlavor("Unencrypted");
|
AddFlavor("Unencrypted");
|
||||||
AddFlavor("IMAP-SSL");
|
AddFlavor("SSL");
|
||||||
#else
|
#else
|
||||||
) {
|
) {
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user