author | alwin <alwin> | 2004-01-06 22:30:50 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-01-06 22:30:50 (UTC) |
commit | a545ea9b957c14bdf9d8aa20e64457b64841ce7f (patch) (side-by-side diff) | |
tree | aae2cd99718cd0378bf0a53613e2a663d2dd2add | |
parent | a24b39a49ac49d2d3b0f2ff53f0f3b7839447d6e (diff) | |
download | opie-a545ea9b957c14bdf9d8aa20e64457b64841ce7f.zip opie-a545ea9b957c14bdf9d8aa20e64457b64841ce7f.tar.gz opie-a545ea9b957c14bdf9d8aa20e64457b64841ce7f.tar.bz2 |
some more debug infos
memleaks fixed
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index 00181ff..4764b77 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp @@ -540,3 +540,3 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT { - char *server, *user, *pass; + const char *server, *user, *pass; bool ssl; @@ -548,3 +548,3 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT server = user = pass = 0; - server = strdup( smtp->getServer().latin1() ); + server = smtp->getServer().latin1(); ssl = smtp->getSSL(); @@ -563,3 +563,3 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT } - if ( err != MAILSMTP_NO_ERROR ) {result = 0;goto free_mem_session;} + if ( err != MAILSMTP_NO_ERROR ) {qDebug("Error init connection");result = 0;goto free_mem_session;} @@ -571,2 +571,3 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT if ( smtp->getLogin() ) { + qDebug("smtp with auth"); if ( smtp->getUser().isEmpty() || smtp->getPassword().isEmpty() ) { @@ -577,4 +578,4 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT // ok - user = strdup( login.getUser().latin1() ); - pass = strdup( login.getPassword().latin1() ); + user = login.getUser().latin1(); + pass = login.getPassword().latin1(); } else { @@ -583,9 +584,11 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size, SMT } else { - user = strdup( smtp->getUser().latin1() ); - pass = strdup( smtp->getPassword().latin1() ); + user = smtp->getUser().latin1(); + pass = smtp->getPassword().latin1(); } qDebug( "session->auth: %i", session->auth); - err = mailsmtp_auth( session, user, pass ); + err = mailsmtp_auth( session, (char*)user, (char*)pass ); if ( err == MAILSMTP_NO_ERROR ) qDebug("auth ok"); qDebug( "Done auth!" ); + } else { + qDebug("SMTP without auth"); } @@ -606,7 +609,2 @@ free_mem_session: free_mem: - if (server) free( server ); - if ( smtp->getLogin() ) { - free( user ); - free( pass ); - } return result; |