Bug 241362

Summary: Disconnecting wlan prompts Konversation to terminate *localhost* connections aswell
Product: [Applications] konversation Reporter: Jonas Thiem <contact>
Component: generalAssignee: Konversation Developers <konversation-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 1.3   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jonas Thiem 2010-06-11 01:33:15 UTC
When my wlan interface went down due to the typical wlan connection issues, Konversation decided to close all connections to a locally running IRCd aswell with the hint "[Info] Network is down, will reconnect automatically when it is back up.".

This wasn't very helpful because I'm often, while chatting in the internet, also testing either Konversation or WeIRCd or both with a local server instance and consequently I got interrupted with my local testing because wlan for internet talk went down.

As testing is often time consuming and sometimes involves setting up more complex test situations which can be trashed by reconnects this behaviour is actually quite unfortunate for local tests on a machine with a wobbly wlan connection.
Comment 1 Peter Simonsson 2010-07-16 21:13:21 UTC
commit 631fa7e7264e843c1a202d0343e6ff965209256b
Author: Peter Simonsson <peter.simonsson@gmail.com>
Date:   Fri Jul 16 21:12:48 2010 +0200

    Ignore network up/down notifications for localhost connections.
    
    I'm sure I've missed something in this simple implementation, but it
    works for me<tm>
    
    BUG:241362

diff --git a/src/irc/server.cpp b/src/irc/server.cpp
index b4a70aa..89c25c3 100644
--- a/src/irc/server.cpp
+++ b/src/irc/server.cpp
@@ -3966,7 +3966,8 @@ void Server::sendChannelNickChangedSignals()
 
 void Server::involuntaryQuit()
 {
-    if(m_connectionState == Konversation::SSConnected || m_connectionState == Konversation::SSConnecting)
+    if((m_connectionState == Konversation::SSConnected || m_connectionState == Konversation::SSConnecting) &&
+       (m_socket->peerAddress() != QHostAddress(QHostAddress::LocalHost) && m_socket->peerAddress() != QHostAddress(QHostAddress::LocalHostIPv6)))
     {
         quitServer();
         updateConnectionState(Konversation::SSInvoluntarilyDisconnected);