Bug 241362 - Disconnecting wlan prompts Konversation to terminate *localhost* connections aswell
Summary: Disconnecting wlan prompts Konversation to terminate *localhost* connections ...
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: 1.3
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-11 01:33 UTC by Jonas Thiem
Modified: 2010-07-16 21:13 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 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);