Changeset 9748 in ntrip


Ignore:
Timestamp:
Jun 1, 2022, 1:33:28 PM (23 months ago)
Author:
stuerze
Message:

minor changes

Location:
trunk/BNC/src/upload
Files:
2 edited

Legend:

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

    r9746 r9748  
    105105  }
    106106  if (_outSocket) {
    107     disconnect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed()));
    108107    delete _outSocket;
    109108  }
     
    142141    }
    143142    emit(newMessage(msg.toLatin1(), true));
    144 
    145143  }
    146144}
     
    194192  }
    195193
    196   if (_outSocket) {
    197     if( _outSocket->state() == QAbstractSocket::ConnectedState) {
    198       return;
    199     }
    200     disconnect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed()));
    201   }
    202   delete _outSocket;
    203   _outSocket = 0;
     194  if (_outSocket != 0 &&
     195      _outSocket->state() == QAbstractSocket::ConnectedState) {
     196    return;
     197  }
     198
     199  delete _outSocket; _outSocket = 0;
    204200
    205201  double minDt = pow(2.0, _sOpenTrial);
     
    217213  _outSocket->setProxy(QNetworkProxy::NoProxy);
    218214
    219   connect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed()));
    220 
    221215  if (_sslIgnoreErrors) {
    222216    _outSocket->ignoreSslErrors();
    223     emit(newMessage("BNC ignores SSL errors during upload as configured", true));
    224217  } else {
    225218    _outSocket->setSslConfiguration(BNC_SSL_CONFIG);
     
    234227    if (_ntripVersion == "1") {
    235228      emit(newMessage("No proxy support in Ntrip Version 1 upload!", true));
    236       _outSocket->close();
     229      delete _outSocket; _outSocket = 0;
    237230      return;
    238231    }
     
    259252        int l = ans.indexOf("\r\n", 0);
    260253        emit(newMessage("Proxy: Connection broken for " + _mountpoint.toLatin1() + ": "  + ans.left(l), true));
    261         _outSocket->close();
     254        delete _outSocket; _outSocket = 0;
    262255        return;
    263256      } else {
     
    271264                          + QString("%1) ").arg(_casterOutPort).toLatin1()
    272265                          + _outSocket->errorString().toLatin1(), true));
     266          delete _outSocket; _outSocket = 0;
    273267          return;
    274268        } else {
     
    290284        + "Connection: close\r\n" + "Transfer-Encoding: chunked\r\n\r\n";
    291285  }
    292   //cout << msg.toStdString().c_str();
    293286  _outSocket->write(msg);
    294287  _outSocket->waitForBytesWritten();
     
    298291
    299292  if (ans.indexOf("200") == -1) {
    300     _outSocket->close();
     293    delete _outSocket; _outSocket = 0;
    301294    int l = ans.indexOf("\r\n", 0);
    302295    emit(newMessage("Broadcaster: Connection broken for " + _mountpoint.toLatin1() + ": " + ans.left(l), true));
     
    319312              + QString("%1) ").arg(outPort).toLatin1()
    320313              + _outSocket->errorString().toLatin1(), true));
     314      delete _outSocket; _outSocket = 0;
    321315      return false;
    322316    } else {
     
    331325              + QString("%1) ").arg(outPort).toLatin1()
    332326              + _outSocket->errorString().toLatin1(), true));
     327      delete _outSocket; _outSocket = 0;
    333328      return false;
    334329    }
     
    338333
    339334
    340 void bncUploadCaster::slotSslSocketConnectionClosed() {
    341   disconnect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed()));
    342   if (_outSocket) {
    343     delete _outSocket;
    344     _outSocket = 0;
    345   }
    346 }
    347 
    348 
    349 
    350 
  • trunk/BNC/src/upload/bncuploadcaster.h

    r9727 r9748  
    3737  void slotProxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*);
    3838  void slotSslErrors(QList<QSslError>);
    39   void slotSslSocketConnectionClosed();
    4039
    4140 private:
Note: See TracChangeset for help on using the changeset viewer.