Changeset 9739 in ntrip


Ignore:
Timestamp:
May 31, 2022, 2:42:18 PM (4 weeks ago)
Author:
stuerze
Message:

minor changes

Location:
trunk/BNC/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bnccore.h

    r9738 r9739  
    3030#include "bncrawfile.h"
    3131#include "bncephuser.h"
    32 #include "bncsslconfig.h"
    3332
    3433class bncComb;
     
    5756  QDateTime         dateAndTimeGPS() const;
    5857  void              setDateAndTimeGPS(QDateTime dateTime);
    59   void              setSslConfiguration(const bncSslConfig& sslConfig) {_sslConfig = sslConfig;}
     58  void              setConfFileName(const QString& confFileName);
    6059  QString           confFileName() const {return _confFileName;}
    61   void              setConfFileName(const QString& confFileName);
    62   bncSslConfig      sslConfiguration() const {return _sslConfig;}
    63 
    6460  void              writeRawData(const QByteArray& data, const QByteArray& staID,
    6561                                 const QByteArray& format);
     
    150146  QList<QTcpSocket*>*    _socketsCorr;
    151147  bncCaster*             _caster;
    152   bncSslConfig           _sslConfig;
    153148  QString                _confFileName;
    154149  QDate                  _fileDate;
  • trunk/BNC/src/bncmain.cpp

    r9738 r9739  
    8181  bool       displaySet   = false;
    8282#endif
    83   QByteArray   rawFileName;
    84   QString      confFileName;
    85   bncSslConfig sslConfig;
     83  QByteArray rawFileName;
     84  QString    confFileName;
    8685
    8786  QByteArray printHelp =
     
    394393  BNC_CORE->setConfFileName( confFileName );
    395394
    396   BNC_CORE->setSslConfiguration( sslConfig );
    397 
    398395  bncSettings settings;
    399396
  • trunk/BNC/src/bncnetqueryv2.cpp

    r9738 r9739  
    135135  // ---------------
    136136  QNetworkRequest request;
    137   request.setSslConfiguration(BNC_CORE->sslConfiguration());
     137  request.setSslConfiguration(BNC_SSL_CONFIG);
    138138  request.setUrl(_url);
    139139  request.setRawHeader("Host"         , _url.host().toLatin1());
     
    238238    msg += err.errorString();
    239239  }
     240  BNC_CORE->slotMessage(msg.toLatin1(), true);
    240241
    241242  if (_sslIgnoreErrors) {
     
    244245  }
    245246  else {
    246     BNC_CORE->slotMessage(msg.toLatin1(), true);
    247247    stop();
    248248  }
  • trunk/BNC/src/bncsslconfig.cpp

    r8252 r9739  
    1111 * Created:    22-Aug-2011
    1212 *
    13  * Changes:   
     13 * Changes:
    1414 *
    1515 * -----------------------------------------------------------------------*/
     
    2424#include "bncsettings.h"
    2525
     26
     27// Singleton
     28////////////////////////////////////////////////////////////////////////////
     29bncSslConfig bncSslConfig::instance() {
     30  static bncSslConfig _sslConfig;
     31  return _sslConfig;
     32}
     33
    2634// Constructor
    2735////////////////////////////////////////////////////////////////////////////
    28 bncSslConfig::bncSslConfig() : 
    29   QSslConfiguration(QSslConfiguration::defaultConfiguration()) 
     36bncSslConfig::bncSslConfig() :
     37  QSslConfiguration(QSslConfiguration::defaultConfiguration())
    3038{
    31  
     39
    3240  bncSettings settings;
    3341  QString dirName = settings.value("sslCaCertPath").toString();
     
    5058    caCerts += QSslCertificate::fromPath(dirName+QDir::separator()+fileName);
    5159  }
    52  
     60
    5361  this->setCaCertificates(caCerts);
    5462}
     
    6270////////////////////////////////////////////////////////////////////////////
    6371QString bncSslConfig::defaultPath() {
    64   return QDir::homePath() + QDir::separator() 
     72  return QDir::homePath() + QDir::separator()
    6573         + ".config" + QDir::separator() + qApp->organizationName();
    6674}
  • trunk/BNC/src/bncsslconfig.h

    r8252 r9739  
    1010  bncSslConfig();
    1111  ~bncSslConfig();
     12  static bncSslConfig instance();
    1213  static QString defaultPath();
    1314 private:
    1415};
    1516
     17#define BNC_SSL_CONFIG (bncSslConfig::instance())
     18
    1619#endif
  • trunk/BNC/src/upload/bncuploadcaster.cpp

    r9738 r9739  
    219219
    220220  _outSocket = new QSslSocket();
    221   _outSocket->setSslConfiguration(BNC_CORE->sslConfiguration());
    222221  _outSocket->setProxy(QNetworkProxy::NoProxy);
    223 
     222  _outSocket->setSslConfiguration(BNC_SSL_CONFIG);
    224223  connect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed()));
    225224  connect(_outSocket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slotSslErrors(QList<QSslError>)));
     
    337336
    338337void bncUploadCaster::slotSslSocketConnectionClosed() {
    339 //  disconnect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed()));
    340 //  disconnect(_outSocket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slotSslErrors(QList<QSslError>)));
     338  disconnect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed()));
     339  disconnect(_outSocket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slotSslErrors(QList<QSslError>)));
    341340  emit(newMessage("slotSslSocketConnectionClosed", true));
    342341  if (_outSocket) {
Note: See TracChangeset for help on using the changeset viewer.