Changeset 9713 in ntrip for trunk


Ignore:
Timestamp:
May 7, 2022, 11:57:34 PM (2 years ago)
Author:
stuerze
Message:

minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/upload/bncuploadcaster.cpp

    r9712 r9713  
    6060  if (_ntripVersion != "1") {
    6161    bncSettings settings;
     62
     63    _sslIgnoreErrors = (Qt::CheckState(settings.value("sslIgnoreErrors").toInt()) == Qt::Checked);
     64
    6265    _proxyHost = settings.value("proxyHost").toString();
    6366    _proxyPort = settings.value("proxyPort").toInt();
    64     _sslIgnoreErrors = (Qt::CheckState(settings.value("sslIgnoreErrors").toInt()) == Qt::Checked);
    6567    if (_secure) {
    6668      _casterOutPort = 443;
    67       _postExtension = QString("https://%1:%2").arg(_casterOutHost).arg(_casterOutPort);
     69      if (!_proxyHost.isEmpty()) {
     70        _postExtension = QString("https://%1:%2").arg(_casterOutHost).arg(_casterOutPort);
     71      }
    6872    }
    6973    else {
    70       _postExtension = QString("http://%1:%2").arg(_casterOutHost).arg(_casterOutPort);
     74      if (!_proxyHost.isEmpty()) {
     75        _postExtension = QString("http://%1:%2").arg(_casterOutHost).arg(_casterOutPort);
     76      }
    7177    }
    7278  }
     
    203209    }
    204210    else {
    205       cout << "open(): outSocketState: " << _outSocket->state() << endl;
    206211      emit(newMessage("Broadcaster: No connection for " + _mountpoint.toLatin1(), true));
    207212    }
     
    236241  }
    237242
     243  const int timeOut = 5000;  // 5 seconds
    238244  if (!_secure) {
    239245    _outSocket->connectToHost(_outHost, _outPort);
    240   }
    241   else {
    242     _outSocket->connectToHostEncrypted(_outHost, _outPort);
    243     if (!_outSocket->waitForEncrypted()) {
    244         cout << "waitForEncrypted: " << _outSocket->errorString().toStdString().c_str() << endl;;
    245         return;
    246     }
    247   }
    248 
    249   const int timeOut = 5000;  // 5 seconds
    250   if (!_outSocket->waitForConnected(timeOut)) {
    251     emit(newMessage("Broadcaster: Connect timeout for " + _mountpoint.toLatin1()
    252          + " (" + _outHost.toLatin1()+ ":" + QString("%1) ").arg(_outPort).toLatin1()
    253          + _outSocket->errorString().toLatin1(), true));
    254     delete _outSocket;
    255     _outSocket = 0;
    256     return;
    257   }
     246    if (!_outSocket->waitForConnected(timeOut)) {
     247      emit(newMessage("Broadcaster: Connect timeout for " + _mountpoint.toLatin1()
     248           + " (" + _outHost.toLatin1()+ ":" + QString("%1) ").arg(_outPort).toLatin1()
     249           + _outSocket->errorString().toLatin1(), true));
     250      delete _outSocket;
     251      _outSocket = 0;
     252      return;
     253    }
     254  }
     255  else {
     256   _outSocket->connectToHostEncrypted(_outHost, _outPort);
     257   if (!_outSocket->waitForEncrypted(timeOut)) {
     258     emit(newMessage("Broadcaster: Connect timeout for " + _mountpoint.toLatin1()
     259          + " (" + _outHost.toLatin1()+ ":" + QString("%1) ").arg(_outPort).toLatin1()
     260          + _outSocket->errorString().toLatin1(), true));
     261     delete _outSocket;
     262     _outSocket = 0;
     263     return;
     264   }
     265 }
    258266
    259267  QByteArray msg;
Note: See TracChangeset for help on using the changeset viewer.