~ubuntu-branches/ubuntu/wily/psi/wily-proposed

« back to all changes in this revision

Viewing changes to iris/src/xmpp/xmpp-core/connector.cpp

  • Committer: Package Import Robot
  • Author(s): Jan Niehusmann
  • Date: 2014-07-01 21:49:34 UTC
  • mfrom: (6.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20140701214934-gt4dkgm94byi4vnn
Tags: 0.15-1
* New upstream version
* set debhelper compat level to 9
* set Standards-Version to 3.9.5 (no further changes)
* add lintian override regarding license-problem-non-free-RFC
* use qconf to regenerate configure script
* implement hardening using buildflags instead of hardening-wrapper

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 *
15
15
 * You should have received a copy of the GNU Lesser General Public
16
16
 * License along with this library; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 *
19
19
 */
20
20
 
31
31
 
32
32
#include "xmpp.h"
33
33
 
34
 
#include <qpointer.h>
35
 
#include <qca.h>
 
34
#include <QPointer>
36
35
#include <QList>
37
36
#include <QUrl>
38
37
#include <QTimer>
39
 
#include "safedelete.h"
 
38
#include <qca.h>
40
39
#include <libidn/idna.h>
41
40
 
42
 
#include "ndns.h"
43
 
 
44
41
#include "bsocket.h"
45
42
#include "httpconnect.h"
46
43
#include "httppoll.h"
47
44
#include "socks.h"
48
 
#include "srvresolver.h"
49
45
 
50
46
//#define XMPP_DEBUG
51
47
 
 
48
#ifdef XMPP_DEBUG
 
49
# define XDEBUG (qDebug() << this << "#" << __FUNCTION__ << ":")
 
50
#endif
 
51
 
52
52
using namespace XMPP;
53
53
 
 
54
static const int XMPP_DEFAULT_PORT = 5222;
 
55
static const int XMPP_LEGACY_PORT = 5223;
 
56
static const char* XMPP_CLIENT_SRV = "xmpp-client";
 
57
static const char* XMPP_CLIENT_TRANSPORT = "tcp";
 
58
 
 
59
 
54
60
//----------------------------------------------------------------------------
55
61
// Connector
56
62
//----------------------------------------------------------------------------
195
201
//----------------------------------------------------------------------------
196
202
// AdvancedConnector
197
203
//----------------------------------------------------------------------------
198
 
enum { Idle, Connecting, Connected };
 
204
typedef enum { Idle, Connecting, Connected } Mode;
 
205
typedef enum { Force, Probe, Never } LegacySSL;
 
206
 
199
207
class AdvancedConnector::Private
200
208
{
201
209
public:
202
 
        int mode;
203
 
        ByteStream *bs;
204
 
        NDns dns;
205
 
        SrvResolver srv;
206
 
 
207
 
        QString server;
208
 
        QStringList opt_hosts;
209
 
        int opt_port;
210
 
        bool opt_probe, opt_ssl;
211
 
        Proxy proxy;
212
 
 
213
 
        QStringList hostsToTry;
214
 
        QString host;
215
 
        int port;
216
 
        QList<Q3Dns::Server> servers;
217
 
        int errorCode;
218
 
        QString connectHost;
219
 
 
220
 
        bool multi, using_srv;
221
 
        bool will_be_ssl;
222
 
        int probe_mode;
223
 
 
224
 
        bool aaaa;
225
 
        SafeDelete sd;
226
 
 
227
 
        QTimer connectTimeout;
 
210
        ByteStream *bs; //!< Socket to use
 
211
 
 
212
        /* configuration values / "options" */
 
213
        QString opt_host; //!< explicit host from config
 
214
        quint16 opt_port; //!< explicit port from config
 
215
        LegacySSL opt_ssl; //!< Whether to use legacy SSL support
 
216
        Proxy proxy; //!< Proxy configuration
 
217
 
 
218
        /* State tracking values */
 
219
        Mode mode; //!< Idle, Connecting, Connected
 
220
        QString host; //!< Host we currently try to connect to, set from connectToServer()
 
221
        int port; //!< Port we currently try to connect to, set from connectToServer() and bs_error()
 
222
        int errorCode; //!< Current error, if any
228
223
};
229
224
 
230
225
AdvancedConnector::AdvancedConnector(QObject *parent)
232
227
{
233
228
        d = new Private;
234
229
        d->bs = 0;
235
 
        connect(&d->dns, SIGNAL(resultsReady()), SLOT(dns_done()));
236
 
        connect(&d->srv, SIGNAL(resultsReady()), SLOT(srv_done()));
237
 
        connect(&d->connectTimeout, SIGNAL(timeout()), SLOT(t_timeout()));
238
 
        d->connectTimeout.setSingleShot(true);
239
 
        d->opt_probe = false;
240
 
        d->opt_ssl = false;
 
230
        d->opt_ssl = Never;
241
231
        cleanup();
242
232
        d->errorCode = 0;
243
233
}
252
242
{
253
243
        d->mode = Idle;
254
244
 
255
 
        // stop any dns
256
 
        if(d->dns.isBusy())
257
 
                d->dns.stop();
258
 
        if(d->srv.isBusy())
259
 
                d->srv.stop();
260
 
 
261
245
        // destroy the bytestream, if there is one
262
246
        delete d->bs;
263
247
        d->bs = 0;
264
248
 
265
 
        d->multi = false;
266
 
        d->using_srv = false;
267
 
        d->will_be_ssl = false;
268
 
        d->probe_mode = -1;
269
 
 
270
249
        setUseSSL(false);
271
250
        setPeerAddressNone();
272
251
}
278
257
        d->proxy = proxy;
279
258
}
280
259
 
281
 
void AdvancedConnector::setOptHostPort(const QString &host, quint16 _port)
 
260
void AdvancedConnector::setOptHostPort(const QString &_host, quint16 _port)
282
261
{
 
262
#ifdef XMPP_DEBUG
 
263
        XDEBUG << "h:" << _host << "p:" << _port;
 
264
#endif
 
265
 
283
266
        if(d->mode != Idle)
284
267
                return;
 
268
 
285
269
        // empty host means disable explicit host support
286
 
        if(host.isEmpty()) {
287
 
                d->opt_hosts.clear();
 
270
        if(_host.isEmpty()) {
 
271
                d->opt_host.clear();
288
272
                return;
289
273
        }
290
 
        d->opt_hosts = QStringList() << host;
291
 
        d->opt_port = _port;
292
 
}
293
 
 
294
 
void AdvancedConnector::setOptHostsPort(const QStringList &_hosts, quint16 _port)
295
 
{
296
 
        if(d->mode != Idle)
297
 
                return;
298
 
        d->opt_hosts = _hosts;
 
274
        d->opt_host = _host;
299
275
        d->opt_port = _port;
300
276
}
301
277
 
302
278
void AdvancedConnector::setOptProbe(bool b)
303
279
{
 
280
#ifdef XMPP_DEBUG
 
281
        XDEBUG << "b:" << b;
 
282
#endif
 
283
 
304
284
        if(d->mode != Idle)
305
285
                return;
306
 
        d->opt_probe = b;
 
286
        d->opt_ssl = (b ? Probe : Never);
307
287
}
308
288
 
309
289
void AdvancedConnector::setOptSSL(bool b)
310
290
{
 
291
#ifdef XMPP_DEBUG
 
292
        XDEBUG << "b:" << b;
 
293
#endif
 
294
 
311
295
        if(d->mode != Idle)
312
296
                return;
313
 
        d->opt_ssl = b;
 
297
        d->opt_ssl = (b ? Force : Never);
314
298
}
315
299
 
316
300
void AdvancedConnector::connectToServer(const QString &server)
317
301
{
 
302
#ifdef XMPP_DEBUG
 
303
        XDEBUG << "s:" << server;
 
304
#endif
 
305
 
318
306
        if(d->mode != Idle)
319
307
                return;
320
308
        if(server.isEmpty())
321
309
                return;
322
310
 
323
 
        d->hostsToTry.clear();
324
311
        d->errorCode = 0;
325
312
        d->mode = Connecting;
326
 
        d->aaaa = true;
327
 
        d->connectHost.clear();
328
313
 
329
314
        // Encode the servername
330
 
        d->server = QUrl::toAce(server);
331
 
        //char* server_encoded;
332
 
        //if (!idna_to_ascii_8z(server.utf8().data(), &server_encoded, 0)) {
333
 
        //      d->server = QString(server_encoded);
334
 
        //      free(server_encoded);
335
 
        //}
336
 
        //else {
337
 
        //      d->server = server;
338
 
        //}
 
315
        d->host = QUrl::toAce(server);
 
316
        if (d->host == QByteArray()) {
 
317
                /* server contains invalid characters for DNS name, but maybe valid characters for connecting, like "::1" */
 
318
                d->host = server;
 
319
        }
 
320
        d->port = XMPP_DEFAULT_PORT;
339
321
 
340
322
        if(d->proxy.type() == Proxy::HttpPoll) {
341
 
                // need SHA1 here
342
 
                //if(!QCA::isSupported(QCA::CAP_SHA1))
343
 
                //      QCA::insertProvider(createProviderHash());
344
 
 
345
323
                HttpPoll *s = new HttpPoll;
346
324
                d->bs = s;
 
325
 
347
326
                connect(s, SIGNAL(connected()), SLOT(bs_connected()));
348
327
                connect(s, SIGNAL(syncStarted()), SLOT(http_syncStarted()));
349
328
                connect(s, SIGNAL(syncFinished()), SLOT(http_syncFinished()));
350
329
                connect(s, SIGNAL(error(int)), SLOT(bs_error(int)));
 
330
 
351
331
                if(!d->proxy.user().isEmpty())
352
332
                        s->setAuth(d->proxy.user(), d->proxy.pass());
353
333
                s->setPollInterval(d->proxy.pollInterval());
358
338
                        s->connectToHost(d->proxy.host(), d->proxy.port(), d->proxy.url());
359
339
        }
360
340
        else if (d->proxy.type() == Proxy::HttpConnect) {
361
 
                if(!d->opt_hosts.isEmpty()) {
362
 
                        d->hostsToTry = d->opt_hosts;
363
 
                        d->host = d->hostsToTry.takeFirst();
364
 
                        d->port = d->opt_port;
365
 
                }
366
 
                else {
367
 
                        d->host = server;
368
 
                        d->port = 5222;
369
 
                }
370
 
                do_connect();
 
341
                HttpConnect *s = new HttpConnect;
 
342
                d->bs = s;
 
343
 
 
344
                connect(s, SIGNAL(connected()), SLOT(bs_connected()));
 
345
                connect(s, SIGNAL(error(int)), SLOT(bs_error(int)));
 
346
 
 
347
                if(!d->opt_host.isEmpty()) {
 
348
                        d->host = d->opt_host;
 
349
                        d->port = d->opt_port;
 
350
                }
 
351
 
 
352
                if(!d->proxy.user().isEmpty())
 
353
                        s->setAuth(d->proxy.user(), d->proxy.pass());
 
354
 
 
355
                s->connectToHost(d->proxy.host(), d->proxy.port(), d->host, d->port);
 
356
        }
 
357
        else if (d->proxy.type() == Proxy::Socks) {
 
358
                SocksClient *s = new SocksClient;
 
359
                d->bs = s;
 
360
 
 
361
                connect(s, SIGNAL(connected()), SLOT(bs_connected()));
 
362
                connect(s, SIGNAL(error(int)), SLOT(bs_error(int)));
 
363
 
 
364
                if(!d->opt_host.isEmpty()) {
 
365
                        d->host = d->opt_host;
 
366
                        d->port = d->opt_port;
 
367
                }
 
368
 
 
369
                if(!d->proxy.user().isEmpty())
 
370
                        s->setAuth(d->proxy.user(), d->proxy.pass());
 
371
 
 
372
                s->connectToHost(d->proxy.host(), d->proxy.port(), d->host, d->port);
371
373
        }
372
374
        else {
373
 
                if(!d->opt_hosts.isEmpty()) {
374
 
                        d->hostsToTry = d->opt_hosts;
375
 
                        d->host = d->hostsToTry.takeFirst();
 
375
                BSocket *s = new BSocket;
 
376
                d->bs = s;
 
377
#ifdef XMPP_DEBUG
 
378
                XDEBUG << "Adding socket:" << s;
 
379
#endif
 
380
 
 
381
                connect(s, SIGNAL(connected()), SLOT(bs_connected()));
 
382
                connect(s, SIGNAL(error(int)), SLOT(bs_error(int)));
 
383
 
 
384
                if(!d->opt_host.isEmpty()) {
 
385
                        d->host = d->opt_host;
376
386
                        d->port = d->opt_port;
377
 
                        do_resolve();
378
 
                }
379
 
                else {
380
 
                        d->multi = true;
381
 
 
382
 
                        QPointer<QObject> self = this;
383
 
                        srvLookup(d->server);
384
 
                        if(!self)
385
 
                                return;
386
 
 
387
 
                        d->srv.resolveSrvOnly(d->server, "xmpp-client", "tcp");
388
 
                }
 
387
                        s->connectToHost(d->host, d->port);
 
388
                        return;
 
389
                } else if (d->opt_ssl != Never) {
 
390
                        d->port = XMPP_LEGACY_PORT;
 
391
                }
 
392
 
 
393
                s->connectToHost(XMPP_CLIENT_SRV, XMPP_CLIENT_TRANSPORT, d->host, d->port);
389
394
        }
390
395
}
391
396
 
415
420
        return d->errorCode;
416
421
}
417
422
 
418
 
void AdvancedConnector::do_resolve()
419
 
{
420
 
        d->dns.resolve(d->host);
421
 
}
422
 
 
423
 
void AdvancedConnector::dns_done()
424
 
{
425
 
        bool failed = false;
426
 
        QHostAddress addr;
427
 
 
428
 
        if(d->dns.result().isNull ())
429
 
                failed = true;
430
 
        else
431
 
                addr = QHostAddress(d->dns.result());
432
 
 
433
 
        if(failed) {
434
 
#ifdef XMPP_DEBUG
435
 
                printf("dns1\n");
436
 
#endif
437
 
                // using proxy?  then try the unresolved host through the proxy
438
 
                if(d->proxy.type() != Proxy::None) {
439
 
#ifdef XMPP_DEBUG
440
 
                        printf("dns1.1\n");
441
 
#endif
442
 
                        do_connect();
443
 
                }
444
 
                else if(d->using_srv) {
445
 
#ifdef XMPP_DEBUG
446
 
                        printf("dns1.2\n");
447
 
#endif
448
 
                        if(d->servers.isEmpty()) {
449
 
#ifdef XMPP_DEBUG
450
 
                                printf("dns1.2.1\n");
451
 
#endif
452
 
                                cleanup();
453
 
                                d->errorCode = ErrConnectionRefused;
454
 
                                error();
455
 
                        }
456
 
                        else {
457
 
#ifdef XMPP_DEBUG
458
 
                                printf("dns1.2.2\n");
459
 
#endif
460
 
                                tryNextSrv();
461
 
                                return;
462
 
                        }
463
 
                }
464
 
                else {
465
 
#ifdef XMPP_DEBUG
466
 
                        printf("dns1.3\n");
467
 
#endif
468
 
                        if(!d->hostsToTry.isEmpty())
469
 
                        {
470
 
                                d->aaaa = true;
471
 
                                d->host = d->hostsToTry.takeFirst();
472
 
                                do_resolve();
473
 
                                return;
474
 
                        }
475
 
 
476
 
                        cleanup();
477
 
                        d->errorCode = ErrHostNotFound;
478
 
                        error();
479
 
                }
480
 
        }
481
 
        else {
482
 
#ifdef XMPP_DEBUG
483
 
                printf("dns2\n");
484
 
#endif
485
 
                d->connectHost = d->host;
486
 
                d->host = addr.toString();
487
 
                do_connect();
488
 
        }
489
 
}
490
 
 
491
 
void AdvancedConnector::do_connect()
492
 
{
493
 
        // 5 seconds to connect
494
 
        d->connectTimeout.start(5000);
495
 
 
496
 
#ifdef XMPP_DEBUG
497
 
        printf("trying %s:%d\n", d->host.latin1(), d->port);
498
 
#endif
499
 
        int t = d->proxy.type();
500
 
        if(t == Proxy::None) {
501
 
#ifdef XMPP_DEBUG
502
 
                printf("do_connect1\n");
503
 
#endif
504
 
                BSocket *s = new BSocket;
505
 
                d->bs = s;
506
 
                connect(s, SIGNAL(connected()), SLOT(bs_connected()));
507
 
                connect(s, SIGNAL(error(int)), SLOT(bs_error(int)));
508
 
                s->connectToHost(d->host, d->port);
509
 
        }
510
 
        else if(t == Proxy::HttpConnect) {
511
 
#ifdef XMPP_DEBUG
512
 
                printf("do_connect2\n");
513
 
#endif
514
 
                HttpConnect *s = new HttpConnect;
515
 
                d->bs = s;
516
 
                connect(s, SIGNAL(connected()), SLOT(bs_connected()));
517
 
                connect(s, SIGNAL(error(int)), SLOT(bs_error(int)));
518
 
                if(!d->proxy.user().isEmpty())
519
 
                        s->setAuth(d->proxy.user(), d->proxy.pass());
520
 
                s->connectToHost(d->proxy.host(), d->proxy.port(), d->host, d->port);
521
 
        }
522
 
        else if(t == Proxy::Socks) {
523
 
#ifdef XMPP_DEBUG
524
 
                printf("do_connect3\n");
525
 
#endif
526
 
                SocksClient *s = new SocksClient;
527
 
                d->bs = s;
528
 
                connect(s, SIGNAL(connected()), SLOT(bs_connected()));
529
 
                connect(s, SIGNAL(error(int)), SLOT(bs_error(int)));
530
 
                if(!d->proxy.user().isEmpty())
531
 
                        s->setAuth(d->proxy.user(), d->proxy.pass());
532
 
                s->connectToHost(d->proxy.host(), d->proxy.port(), d->host, d->port);
533
 
        }
534
 
}
535
 
 
536
 
void AdvancedConnector::tryNextSrv()
537
 
{
538
 
#ifdef XMPP_DEBUG
539
 
        printf("trying next srv\n");
540
 
#endif
541
 
        Q_ASSERT(!d->servers.isEmpty());
542
 
        d->host = d->servers.first().name;
543
 
        d->port = d->servers.first().port;
544
 
        d->servers.takeFirst();
545
 
        do_resolve();
546
 
}
547
 
 
548
 
void AdvancedConnector::srv_done()
549
 
{
550
 
        QPointer<QObject> self = this;
551
 
#ifdef XMPP_DEBUG
552
 
        printf("srv_done1\n");
553
 
#endif
554
 
        d->servers = d->srv.servers();
555
 
        if(d->servers.isEmpty()) {
556
 
                srvResult(false);
557
 
                if(!self)
558
 
                        return;
559
 
 
560
 
#ifdef XMPP_DEBUG
561
 
                printf("srv_done1.1\n");
562
 
#endif
563
 
                // fall back to A record
564
 
                d->using_srv = false;
565
 
                d->host = d->server;
566
 
                if(d->opt_probe) {
567
 
#ifdef XMPP_DEBUG
568
 
                        printf("srv_done1.1.1\n");
569
 
#endif
570
 
                        d->probe_mode = 0;
571
 
                        d->port = 5223;
572
 
                        d->will_be_ssl = true;
573
 
                }
574
 
                else {
575
 
#ifdef XMPP_DEBUG
576
 
                        printf("srv_done1.1.2\n");
577
 
#endif
578
 
                        d->probe_mode = 1;
579
 
                        d->port = 5222;
580
 
                }
581
 
                do_resolve();
582
 
                return;
583
 
        }
584
 
 
585
 
        srvResult(true);
586
 
        if(!self)
587
 
                return;
588
 
 
589
 
        d->using_srv = true;
590
 
        tryNextSrv();
591
 
}
592
 
 
593
423
void AdvancedConnector::bs_connected()
594
424
{
595
 
        d->connectTimeout.stop();
596
 
 
 
425
#ifdef XMPP_DEBUG
 
426
        XDEBUG;
 
427
#endif
597
428
        if(d->proxy.type() == Proxy::None) {
598
429
                QHostAddress h = (static_cast<BSocket*>(d->bs))->peerAddress();
599
430
                int p = (static_cast<BSocket*>(d->bs))->peerPort();
600
431
                setPeerAddress(h, p);
601
432
        }
602
433
 
603
 
        // only allow ssl override if proxy==poll or host:port
604
 
        if((d->proxy.type() == Proxy::HttpPoll || !d->opt_hosts.isEmpty()) && d->opt_ssl)
605
 
                setUseSSL(true);
606
 
        else if(d->will_be_ssl)
 
434
        bool ssl_disabled = d->proxy.type() == Proxy::None &&
 
435
                        (static_cast<BSocket*>(d->bs)->isPeerFromSrv() || d->port == XMPP_DEFAULT_PORT);
 
436
        // only allow ssl override if proxy==poll or host:port or when probing legacy ssl port
 
437
        if(d->proxy.type() != Proxy::HttpPoll  && d->opt_ssl != Never && !ssl_disabled)
607
438
                setUseSSL(true);
608
439
 
609
440
        d->mode = Connected;
610
 
        connected();
 
441
        emit connected();
611
442
}
612
443
 
613
444
void AdvancedConnector::bs_error(int x)
614
445
{
 
446
#ifdef XMPP_DEBUG
 
447
        XDEBUG << "e:" << x;
 
448
#endif
 
449
 
615
450
        if(d->mode == Connected) {
616
451
                d->errorCode = ErrStream;
617
 
                error();
 
452
                emit error();
618
453
                return;
619
454
        }
620
455
 
623
458
        int t = d->proxy.type();
624
459
 
625
460
#ifdef XMPP_DEBUG
626
 
        printf("bse1\n");
 
461
        qDebug("bse1");
627
462
#endif
628
463
 
629
464
        // figure out the error
679
514
                }
680
515
        }
681
516
 
682
 
        // try next host, if any
683
 
        if(!d->hostsToTry.isEmpty())
684
 
        {
685
 
                d->aaaa = true;
686
 
                d->host = d->hostsToTry.takeFirst();
687
 
                do_resolve();
688
 
                return;
689
 
        }
690
 
 
691
517
        // no-multi or proxy error means we quit
692
 
        if(!d->multi || proxyError) {
 
518
        if(proxyError) {
693
519
                cleanup();
694
520
                d->errorCode = err;
695
 
                error();
 
521
                emit error();
696
522
                return;
697
523
        }
698
524
 
699
 
        if(d->using_srv && !d->servers.isEmpty()) {
700
 
#ifdef XMPP_DEBUG
701
 
                printf("bse1.1\n");
702
 
#endif
703
 
                tryNextSrv();
704
 
        }
705
 
        else if(!d->using_srv && d->opt_probe && d->probe_mode == 0) {
706
 
#ifdef XMPP_DEBUG
707
 
                printf("bse1.2\n");
708
 
#endif
709
 
                d->probe_mode = 1;
710
 
                d->port = 5222;
711
 
                d->will_be_ssl = false;
712
 
                do_connect();
713
 
        }
 
525
        /*
 
526
                if we shall probe the ssl legacy port, and we just did that (port=legacy),
 
527
                then try to connect to the normal port instead
 
528
        */
 
529
        if(d->opt_ssl == Probe && d->port == XMPP_LEGACY_PORT) {
 
530
#ifdef XMPP_DEBUG
 
531
                qDebug("bse1.2");
 
532
#endif
 
533
                BSocket *s = static_cast<BSocket*>(d->bs);
 
534
                d->port = XMPP_DEFAULT_PORT;
 
535
                s->connectToHost(XMPP_CLIENT_SRV, XMPP_CLIENT_TRANSPORT, d->host, d->port);
 
536
        }
 
537
        /* otherwise we have no fallbacks and must have failed to connect */
714
538
        else {
715
539
#ifdef XMPP_DEBUG
716
 
                printf("bse1.3\n");
 
540
                qDebug("bse1.3");
717
541
#endif
718
542
                cleanup();
719
543
                d->errorCode = ErrConnectionRefused;
720
 
                error();
 
544
                emit error();
721
545
        }
722
546
}
723
547
 
733
557
 
734
558
void AdvancedConnector::t_timeout()
735
559
{
736
 
        // skip to next host, if there is one
737
 
        if(!d->hostsToTry.isEmpty())
738
 
        {
739
 
                delete d->bs;
740
 
                d->bs = 0;
741
 
 
742
 
                d->aaaa = true;
743
 
                d->host = d->hostsToTry.takeFirst();
744
 
                do_resolve();
745
 
        }
 
560
        //bs_error(-1);
746
561
}
747
562
 
748
563
QString AdvancedConnector::host() const
749
564
{
750
 
        return d->connectHost;
 
565
        return d->host;
751
566
}