~ubuntu-branches/ubuntu/trusty/quassel/trusty-proposed

« back to all changes in this revision

Viewing changes to src/core/corenetwork.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2014-02-18 23:18:25 UTC
  • mto: This revision was merged to the branch mainline in revision 98.
  • Revision ID: package-import@ubuntu.com-20140218231825-hfgaeo3nmszt2pth
Tags: upstream-0.10~beta1
ImportĀ upstreamĀ versionĀ 0.10~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *   Copyright (C) 2005-2013 by the Quassel Project                        *
 
2
 *   Copyright (C) 2005-2014 by the Quassel Project                        *
3
3
 *   devel@quassel-irc.org                                                 *
4
4
 *                                                                         *
5
5
 *   This program is free software; you can redistribute it and/or modify  *
44
44
    _requestedUserModes('-')
45
45
{
46
46
    _autoReconnectTimer.setSingleShot(true);
47
 
    _socketCloseTimer.setSingleShot(true);
48
47
    connect(&_socketCloseTimer, SIGNAL(timeout()), this, SLOT(socketCloseTimeout()));
49
48
 
50
49
    setPingInterval(networkConfig()->pingInterval());
183
182
        socket.setProxy(QNetworkProxy::NoProxy);
184
183
    }
185
184
 
 
185
    enablePingTimeout();
 
186
 
186
187
#ifdef HAVE_SSL
187
188
    socket.setProtocol((QSsl::SslProtocol)server.sslVersion);
188
189
    if (server.useSsl) {
437
438
    if (server.useSsl && !socket.isEncrypted())
438
439
        return;
439
440
#endif
440
 
 
 
441
#if QT_VERSION >= 0x040600
 
442
    socket.setSocketOption(QAbstractSocket::KeepAliveOption, true);
 
443
#endif
441
444
    CoreIdentity *identity = identityPtr();
442
445
    if (!identity) {
443
446
        qCritical() << "Identity invalid!";
447
450
 
448
451
    emit socketInitialized(identity, localAddress(), localPort(), peerAddress(), peerPort());
449
452
 
450
 
    enablePingTimeout();
451
 
 
452
453
    // TokenBucket to avoid sending too much at once
453
454
    _messageDelay = 2200;  // this seems to be a safe value (2.2 seconds delay)
454
455
    _burstSize = 5;