Bug 85528 - infinite loop when nick in use
Summary: infinite loop when nick in use
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: 0.15
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-20 03:54 UTC by Jorg Pitts
Modified: 2005-09-27 09: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 Jorg Pitts 2004-07-20 03:54:21 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc (GCC) 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6) 
OS:                Linux

I am using dialup
I use pppd, so whenever the connect drops it dials right back.

Was in konversation all was normal. I have my nicks setup as jorgp,jorgp2,jorgp3,jorgp4

logged in as jorgp
when connection dropped and it dialed back, I got 2+ pages of 
[08:39 pm] *** You are now known as jorgp.
[08:39 pm] *** You are now known as jorgp.
[08:39 pm] *** You are now known as jorgp.
[08:39 pm] *** You are now known as jorgp.
[08:39 pm] *** You are now known as jorgp.
[08:39 pm] *** You are now known as jorgp.
[08:39 pm] *** You are now known as jorgp.
[08:39 pm] *** You are now known as jorgp.
[08:39 pm] *** You are now known as jorgp.
[08:39 pm] *** You are now known as jorgp.

and the loop continued until I clicked on the nick box to change nick to jorgp2, then all was fine again.

on the irc.kde.org channel I got this:
[08:39 pm] [Nick] Nickname already in use. Trying jorgp.
[08:39 pm] [Nick] Nickname already in use. Trying jorgp.
[08:39 pm] [Nick] Nickname already in use. Trying jorgp.
[08:39 pm] [Nick] Nickname already in use. Trying jorgp.
[08:39 pm] [Nick] Nickname already in use. Trying jorgp.
[08:39 pm] [Nick] Nickname already in use. Trying jorgp.
[08:39 pm] [Nick] Nickname already in use. Trying jorgp.
[08:39 pm] [Nick] Nickname already in use. Trying jorgp.
[08:39 pm] [Nick] Nickname already in use. Trying jorgp.

which it clearly is not trying my alt nicks.
Comment 1 Peter Simonsson 2004-08-27 10:47:59 UTC
I've been unable to reproduce this...
Comment 2 John Tapsell 2004-09-09 15:27:19 UTC
Thank you for your bug report.
You have not provided enough information for us to be able to reproduce
the bug. Please provide a detailed account of the steps required to
trigger and reproduce the bug. Without this information, we will not be
able to reproduce, identify and fix the bug.

Cvs has changed quite a lot in the last few weeks - chances are this has been 
fixed.  Please reopen if needed.

Comment 3 Sander Koning 2005-02-21 20:35:46 UTC
Reopened to draw attention, but go ahead and re-close if desired.

Exactly the same happens here (Konversation 0.15.1 from Debian testing).
When a ping timeout to a server occurs (sometimes flaky DSL connection) and Konversation returns too quickly, the nick remains in use and it does not try to change the nick:

[20:21:14] [error] Closing Link: fia220-25.dsl.hccnet.nl (Connection timed out)
[20:21:14] [Error] Connection to Server irc.oftc.net lost. Trying to reconnect.
[20:21:19] [Info] Looking for server irc.oftc.net:6667...
[20:21:19] [Info] Server found, connecting...
[20:21:20] [Info] Connected; logging in...
[20:21:20] [Notice] -- *** Looking up your hostname...
[20:21:20] [Notice] -- *** Checking Ident
[20:21:20] [Notice] -- *** Found your hostname
[20:21:31] [Notice] -- *** No Ident response
[20:21:31] [Nick] Nickname already in use. Trying ask.
[20:21:31] [Nick] Nickname already in use. Trying ask.
[20:21:31] [Nick] Nickname already in use. Trying ask.
[20:21:31] [Nick] Nickname already in use. Trying ask.
[20:21:31] [Nick] Nickname already in use. Trying ask.

--- SNIPPED --- (about 3-5 tries per second)

[20:21:48] [Nick] Nickname already in use. Trying ask.
[20:21:48] [Nick] Nickname already in use. Trying ask.
[20:21:48] [Nick] Nickname already in use. Trying ask.
[20:21:49] [Nick] Nickname already in use. Trying ask.
[20:21:49] [Nick] Nickname already in use. Trying ask.
[20:21:49] [Welcome] Welcome to the OFTC Internet Relay Chat Network ask_

(at that point I did a manual "/nick ask_").

Can't tell you how to reproduce other than to make your internet connection have a 'hiccup'...
Comment 4 Ismail Donmez 2005-03-30 18:50:37 UTC
This weird bug happened once here too
Comment 5 Alexander Rigbo 2005-09-26 23:08:09 UTC
I tried to connect to IRCNet with the nickname 'alex'. Needless to say the nickname was used so i got this:

[23:09] [Nick] Nickname already in use. Trying _alex.
[23:09] [Nick] Nickname already in use. Trying alex_.
[23:09] [Nick] Nickname already in use. Trying _alex_.
[23:10] [Nick] Nickname already in use. Trying _alex__.
[23:10] [Nick] Nickname already in use. Trying _alex__.
[23:10] [Nick] Nickname already in use. Trying _alex__.
[23:10] [Nick] Nickname already in use. Trying _alex__.
[23:10] [Nick] Nickname already in use. Trying _alex__.
[23:10] [Nick] Nickname already in use. Trying _alex__.

and so on.
Comment 6 Ismail Donmez 2005-09-27 09:20:53 UTC
Just tried now with the nick alex on irc.dal.net and it works fine. Are you sure you are using the latest stable konversation which is 0.18? Else send me your konversationrc after you remove your passwords from it.
Comment 7 Ismail Donmez 2005-09-27 09:50:08 UTC
SVN commit 464393 by cartman:

Really fix nickname in use infinite loop.
BUG:85528



 M  +9 -2      identity.cpp  
 M  +2 -2      identity.h  
 M  +4 -9      server.cpp  


--- trunk/extragear/network/konversation/src/identity.cpp #464392:464393
@@ -80,9 +80,16 @@
 void Identity::setIdent(const QString& newIdent)        { ident=newIdent; }
 QString Identity::getIdent() const                      { return ident; }
 
-void Identity::setNickname(int index,const QString& newName) { nicknameList[index]=newName; }
-QString Identity::getNickname(int index) const          { return nicknameList[index]; }
+void Identity::setNickname(uint index,const QString& newName) { nicknameList[index]=newName; }
 
+QString Identity::getNickname(uint index) const 
+{
+  if(index < nicknameList.count())
+    return nicknameList[index];
+  else
+    return QString::null;
+}
+
 void Identity::setBot(const QString& newBot)            { bot=newBot; }
 QString Identity::getBot() const                        { return bot; }
 
--- trunk/extragear/network/konversation/src/identity.h #464392:464393
@@ -46,8 +46,8 @@
         void setIdent(const QString& ident);
         QString getIdent() const;
 
-        void setNickname(int index,const QString& nick);
-        QString getNickname(int index) const;
+        void setNickname(uint index,const QString& nick);
+        QString getNickname(uint index) const;
 
         void setBot(const QString& bot);
         QString getBot() const;
--- trunk/extragear/network/konversation/src/server.cpp #464392:464393
@@ -990,16 +990,11 @@
 
 QString Server::getNextNickname()
 {
-    QString newNick = getNickname();
+    QString newNick = getIdentity()->getNickname(++tryNickNumber);
 
-    if(tryNickNumber != 4)
-    {
-        tryNickNumber++;
-        if (tryNickNumber == 4)
-            newNick = getNickname()+"_";
-        else
-            newNick = getIdentity()->getNickname(tryNickNumber);
-    }
+    if(newNick.isEmpty())
+       newNick = getNickname()+"_";
+
     return newNick;
 }