author | alwin <alwin> | 2004-03-05 13:15:15 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-05 13:15:15 (UTC) |
commit | 4a18103940564be8585af8121203561e16f0a32c (patch) (unidiff) | |
tree | a3abb3b7b80674ddb956847e2ae7e1b42fa78301 | |
parent | 5af6bb27d2ba6a1d00fd0a6df0550d02164f87e6 (diff) | |
download | opie-4a18103940564be8585af8121203561e16f0a32c.zip opie-4a18103940564be8585af8121203561e16f0a32c.tar.gz opie-4a18103940564be8585af8121203561e16f0a32c.tar.bz2 |
could hold pointer to destructed content
connection problem fixed as quick hack, must done better or real.
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp index c68964d..54e0ed4 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp | |||
@@ -112,56 +112,66 @@ void NNTPwrapper::login() | |||
112 | { | 112 | { |
113 | if (account->getOffline()) | 113 | if (account->getOffline()) |
114 | return; | 114 | return; |
115 | /* we'll hold the line */ | 115 | /* we'll hold the line */ |
116 | if ( m_nntp != NULL ) | 116 | if ( m_nntp != NULL ) |
117 | return; | 117 | return; |
118 | 118 | ||
119 | const char *server, *user, *pass; | 119 | const char *server, *user, *pass; |
120 | QString User,Pass; | ||
120 | uint16_t port; | 121 | uint16_t port; |
121 | int err = NEWSNNTP_NO_ERROR; | 122 | int err = NEWSNNTP_NO_ERROR; |
122 | 123 | ||
123 | server = account->getServer().latin1(); | 124 | server = account->getServer().latin1(); |
124 | port = account->getPort().toUInt(); | 125 | port = account->getPort().toUInt(); |
125 | 126 | ||
127 | user = pass = 0; | ||
128 | |||
126 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { | 129 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { |
127 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); | 130 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); |
128 | login.show(); | 131 | login.show(); |
129 | if ( QDialog::Accepted == login.exec() ) { | 132 | if ( QDialog::Accepted == login.exec() ) { |
130 | // ok | 133 | // ok |
131 | user = login.getUser().latin1(); | 134 | User = login.getUser().latin1(); |
132 | pass = login.getPassword().latin1(); | 135 | Pass = login.getPassword().latin1(); |
133 | } else { | 136 | } else { |
134 | // cancel | 137 | // cancel |
135 | qDebug( "NNTP: Login canceled" ); | 138 | qDebug( "NNTP: Login canceled" ); |
136 | return; | 139 | return; |
137 | } | 140 | } |
138 | } else { | 141 | } else { |
139 | user = account->getUser().latin1(); | 142 | User = account->getUser().latin1(); |
140 | pass = account->getPassword().latin1(); | 143 | Pass = account->getPassword().latin1(); |
141 | } | 144 | } |
142 | 145 | ||
146 | if (User.isEmpty()) { | ||
147 | user=0; | ||
148 | pass = 0; | ||
149 | } else { | ||
150 | user=User.latin1(); | ||
151 | pass=Pass.latin1(); | ||
152 | } | ||
143 | // bool ssl = account->getSSL(); | 153 | // bool ssl = account->getSSL(); |
144 | 154 | ||
145 | m_nntp=mailstorage_new(NULL); | 155 | m_nntp=mailstorage_new(NULL); |
146 | 156 | ||
147 | int conntypeset = account->ConnectionType(); | 157 | int conntypeset = account->ConnectionType(); |
148 | int conntype = 0; | 158 | int conntype = 0; |
149 | if ( conntypeset == 3 ) { | 159 | if ( conntypeset == 3 ) { |
150 | conntype = CONNECTION_TYPE_COMMAND; | 160 | conntype = CONNECTION_TYPE_COMMAND; |
151 | } else if ( conntypeset == 2 ) { | 161 | } else if ( conntypeset == 2 ) { |
152 | conntype = CONNECTION_TYPE_TLS; | 162 | conntype = CONNECTION_TYPE_TLS; |
153 | } else if ( conntypeset == 1 ) { | 163 | } else if ( conntypeset == 1 ) { |
154 | conntype = CONNECTION_TYPE_STARTTLS; | 164 | conntype = CONNECTION_TYPE_STARTTLS; |
155 | } else if ( conntypeset == 0 ) { | 165 | } else if ( conntypeset == 0 ) { |
156 | conntype = CONNECTION_TYPE_TRY_STARTTLS; | 166 | conntype = CONNECTION_TYPE_TRY_STARTTLS; |
157 | } | 167 | } |
158 | 168 | ||
159 | nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, conntype, NNTP_AUTH_TYPE_PLAIN, | 169 | nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, CONNECTION_TYPE_PLAIN, NNTP_AUTH_TYPE_PLAIN, |
160 | (char*)user,(char*)pass,0,0,0); | 170 | (char*)user,(char*)pass,0,0,0); |
161 | 171 | ||
162 | err = mailstorage_connect( m_nntp ); | 172 | err = mailstorage_connect( m_nntp ); |
163 | 173 | ||
164 | if (err != NEWSNNTP_NO_ERROR) { | 174 | if (err != NEWSNNTP_NO_ERROR) { |
165 | qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); | 175 | qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); |
166 | // Global::statusMessage(tr("Error initializing folder")); | 176 | // Global::statusMessage(tr("Error initializing folder")); |
167 | mailstorage_free(m_nntp); | 177 | mailstorage_free(m_nntp); |