author | alwin <alwin> | 2005-02-26 10:48:06 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-02-26 10:48:06 (UTC) |
commit | 2e32fb035b4e8ed29e5522ed081c75df1fd74f40 (patch) (side-by-side diff) | |
tree | 6a82a6f6eedb24a18df5166baf64a9fafb472d33 | |
parent | f2f2b0bc7f8fbb0ecbfd7548b7a29618cc5a9139 (diff) | |
download | opie-2e32fb035b4e8ed29e5522ed081c75df1fd74f40.zip opie-2e32fb035b4e8ed29e5522ed081c75df1fd74f40.tar.gz opie-2e32fb035b4e8ed29e5522ed081c75df1fd74f40.tar.bz2 |
uninitialized value of local variable fixed
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 576804d..9e58303 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp @@ -1,115 +1,115 @@ #include <stdlib.h> #include <libetpan/libetpan.h> #include <qpe/global.h> #include <opie2/oapplication.h> #include <opie2/odebug.h> #include "imapwrapper.h" #include "mailtypes.h" #include "logindialog.h" using namespace Opie::Core; IMAPwrapper::IMAPwrapper( IMAPaccount *a ) : AbstractMail(),MailStatics() { account = a; m_imap = 0; m_Lastmbox = ""; } IMAPwrapper::~IMAPwrapper() { logout(); } /* to avoid to often select statements in loops etc. we trust that we are logged in and connection is established!*/ int IMAPwrapper::selectMbox(const QString&mbox) { if (mbox == m_Lastmbox) { return MAILIMAP_NO_ERROR; } int err = mailimap_select( m_imap, (char*)mbox.latin1()); if ( err != MAILIMAP_NO_ERROR ) { odebug << "error selecting mailbox: " << m_imap->imap_response << "" << oendl; m_Lastmbox = ""; return err; } m_Lastmbox = mbox; return err; } void IMAPwrapper::imap_progress( size_t current, size_t maximum ) { qApp->processEvents(); odebug << "IMAP: " << current << " of " << maximum << "" << oendl; } bool IMAPwrapper::start_tls(bool force_tls) { int err; - bool try_tls; + bool try_tls=false; mailimap_capability_data * cap_data = 0; err = mailimap_capability(m_imap,&cap_data); if (err != MAILIMAP_NO_ERROR) { Global::statusMessage("error getting capabilities!"); odebug << "error getting capabilities!" << oendl; return false; } clistiter * cur; for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) { struct mailimap_capability * cap; cap = (struct mailimap_capability *)clist_content(cur); if (cap->cap_type == MAILIMAP_CAPABILITY_NAME) { if (strcasecmp(cap->cap_data.cap_name, "STARTTLS") == 0) { try_tls = true; break; } } } if (cap_data) { mailimap_capability_data_free(cap_data); } if (try_tls) { err = mailimap_starttls(m_imap); if (err != MAILIMAP_NO_ERROR) { if (force_tls) { Global::statusMessage(tr("Server has no TLS support!")); odebug << "Server has no TLS support!" << oendl; } try_tls = false; } else { mailstream_low * low; mailstream_low * new_low; low = mailstream_get_low(m_imap->imap_stream); if (!low) { try_tls = false; } else { int fd = mailstream_low_get_fd(low); if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) { mailstream_low_free(low); mailstream_set_low(m_imap->imap_stream, new_low); } else { try_tls = false; } } } } return try_tls; } void IMAPwrapper::login() { const char *server, *user, *pass; uint16_t port; int err = MAILIMAP_NO_ERROR; if (account->getOffline()) return; /* we are connected this moment */ /* TODO: setup a timer holding the line or if connection closed - delete the value */ if (m_imap) { err = mailimap_noop(m_imap); if (err!=MAILIMAP_NO_ERROR) { logout(); } else { |