Some more fixes
authorManuel Nickschas <sputnick@quassel-irc.org>
Fri, 16 Jan 2009 20:15:47 +0000 (21:15 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 16 Jan 2009 20:18:26 +0000 (21:18 +0100)
src/core/core.cpp

index 75d0bcb..46a0d6c 100644 (file)
@@ -267,26 +267,30 @@ bool Core::startListening() {
               success = true;
             } else
               quWarning() << qPrintable(
-                tr("Could not open GUI client interface %1:%2: %3")
+                tr("Could not open IPv4 interface %1:%2: %3")
                   .arg(addr.toString())
                   .arg(port)
                   .arg(_server.errorString()));
             break;
           case QAbstractSocket::IPv6Protocol:
-            if (_v6server.listen(addr, port)) {
+            if(_v6server.listen(addr, port)) {
               quInfo() << qPrintable(
                 tr("Listening for GUI clients on IPv6 %1 port %2 using protocol version %3")
                   .arg(addr.toString())
-                  .arg(_server.serverPort())
+                  .arg(_v6server.serverPort())
                   .arg(Quassel::buildInfo().protocolVersion)
               );
               success = true;
-            } else
-              quWarning() << qPrintable(
-              tr("Could not open GUI client interface %1:%2: %3")
-              .arg(addr.toString())
-              .arg(port)
-              .arg(_server.errorString()));
+            } else {
+              // if v4 succeeded on Any, the port will be already in use - don't display the error then
+              // FIXME: handle this more sanely, make sure we can listen to both v4 and v6 by default!
+              if(!success || _v6server.serverError() != QAbstractSocket::AddressInUseError)
+                quWarning() << qPrintable(
+                  tr("Could not open IPv6 interface %1:%2: %3")
+                  .arg(addr.toString())
+                  .arg(port)
+                  .arg(_v6server.errorString()));
+            }
             break;
           default:
             qCritical() << qPrintable(
@@ -392,7 +396,7 @@ void Core::processClientMessage(QTcpSocket *socket, const QVariantMap &msg) {
 #ifdef HAVE_SSL
     SslServer *sslServer = qobject_cast<SslServer *>(&_server);
     QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket);
-    bool supportSsl = (bool)sslServer && (bool)sslSocket && sslServer->certIsValid();
+    bool supportSsl = (bool)sslServer && (bool)sslSocket && sslServer->isCertValid();
 #else
     bool supportSsl = false;
 #endif