Bug 98801 - knode freezes with empty password
Summary: knode freezes with empty password
Status: RESOLVED FIXED
Alias: None
Product: knode
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-07 20:41 UTC by Richard Lärkäng
Modified: 2005-02-12 13:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Lärkäng 2005-02-07 20:41:33 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

When I try to read a newsgroup from a server which requires authentication, and supply a username but an empty password knode stops at 6% and nothing happens. Almost all the time it will freeze too but not always. But those times when it doesn't freeze, it is still impossible to cancel the request.

I removed the comments on some of the debug-output, and here's the relevent part (I hope):
knode: KNNetAccess::startJobNntp(): job started
knode: KNFolderManager::setCurrentFolder() : folder changed
knode: KNProtocolClient::openConnection(): opening connection
knode: KNProtocolClient::closeConnection(): closing connection
knode: KNNetAccess::threadDoneNntp(): job done
knode: KNNetAccess::threadDoneNntp(): authentication error
knode: KNNetAccess::threadDoneNntp(): trying again with authentication data
knode: KNProtocolClient::openConnection(): opening connection
knode: user: larkang
knode: Password required
Very strange! got a DCOPReply opcode, but we were not waiting for a reply!

This is with kdepim from yesterday, but I've seen this for a while.
Comment 1 Volker Krause 2005-02-12 13:50:45 UTC
CVS commit by vkrause: 

Prevent wallet operations from the network thread, this causes the thread to hang.

BUG: 98801


  M +6 -4      knserverinfo.cpp   1.30
  M +3 -0      knserverinfo.h   1.16


--- kdepim/knode/knserverinfo.cpp  #1.29:1.30
@@ -31,7 +31,8 @@ using namespace KWallet;
 #include <qwidget.h>
 
-KNServerInfo::KNServerInfo()
-  : t_ype(STnntp), i_d(-1), p_ort(119), h_old(300),
-    t_imeout(60), n_eedsLogon(false), p_assDirty(false)
+KNServerInfo::KNServerInfo() :
+  t_ype(STnntp), i_d(-1), p_ort(119), h_old(300),
+  t_imeout(60), n_eedsLogon(false), p_assDirty(false),
+  mPassLoaded( false )
 {
 }
@@ -135,5 +136,5 @@ const QString &KNServerInfo::pass()
 {
   // if we need to load the password, load all of them
-  if (n_eedsLogon && p_ass.isEmpty())
+  if (n_eedsLogon && !mPassLoaded && p_ass.isEmpty() )
     knGlobals.accountManager()->loadPasswords();
 
@@ -186,4 +187,5 @@ void KNServerInfo::readPassword()
   if (!n_eedsLogon)
     return;
+  mPassLoaded = true;
 
   // check wether there is a chance to find our password at all

--- kdepim/knode/knserverinfo.h  #1.15:1.16
@@ -81,4 +81,7 @@ class KNServerInfo {
     bool n_eedsLogon,
          p_assDirty;
+    /** Prevent loading the password multiple times since wallet operations
+        from the I/O thread don't work. */
+    bool mPassLoaded;
 
   private: