Changeset 9739 in ntrip for trunk/BNC/src
- Timestamp:
- May 31, 2022, 2:42:18 PM (2 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bnccore.h
r9738 r9739 30 30 #include "bncrawfile.h" 31 31 #include "bncephuser.h" 32 #include "bncsslconfig.h"33 32 34 33 class bncComb; … … 57 56 QDateTime dateAndTimeGPS() const; 58 57 void setDateAndTimeGPS(QDateTime dateTime); 59 void set SslConfiguration(const bncSslConfig& sslConfig) {_sslConfig = sslConfig;}58 void setConfFileName(const QString& confFileName); 60 59 QString confFileName() const {return _confFileName;} 61 void setConfFileName(const QString& confFileName);62 bncSslConfig sslConfiguration() const {return _sslConfig;}63 64 60 void writeRawData(const QByteArray& data, const QByteArray& staID, 65 61 const QByteArray& format); … … 150 146 QList<QTcpSocket*>* _socketsCorr; 151 147 bncCaster* _caster; 152 bncSslConfig _sslConfig;153 148 QString _confFileName; 154 149 QDate _fileDate; -
trunk/BNC/src/bncmain.cpp
r9738 r9739 81 81 bool displaySet = false; 82 82 #endif 83 QByteArray rawFileName; 84 QString confFileName; 85 bncSslConfig sslConfig; 83 QByteArray rawFileName; 84 QString confFileName; 86 85 87 86 QByteArray printHelp = … … 394 393 BNC_CORE->setConfFileName( confFileName ); 395 394 396 BNC_CORE->setSslConfiguration( sslConfig );397 398 395 bncSettings settings; 399 396 -
trunk/BNC/src/bncnetqueryv2.cpp
r9738 r9739 135 135 // --------------- 136 136 QNetworkRequest request; 137 request.setSslConfiguration(BNC_ CORE->sslConfiguration());137 request.setSslConfiguration(BNC_SSL_CONFIG); 138 138 request.setUrl(_url); 139 139 request.setRawHeader("Host" , _url.host().toLatin1()); … … 238 238 msg += err.errorString(); 239 239 } 240 BNC_CORE->slotMessage(msg.toLatin1(), true); 240 241 241 242 if (_sslIgnoreErrors) { … … 244 245 } 245 246 else { 246 BNC_CORE->slotMessage(msg.toLatin1(), true);247 247 stop(); 248 248 } -
trunk/BNC/src/bncsslconfig.cpp
r8252 r9739 11 11 * Created: 22-Aug-2011 12 12 * 13 * Changes: 13 * Changes: 14 14 * 15 15 * -----------------------------------------------------------------------*/ … … 24 24 #include "bncsettings.h" 25 25 26 27 // Singleton 28 //////////////////////////////////////////////////////////////////////////// 29 bncSslConfig bncSslConfig::instance() { 30 static bncSslConfig _sslConfig; 31 return _sslConfig; 32 } 33 26 34 // Constructor 27 35 //////////////////////////////////////////////////////////////////////////// 28 bncSslConfig::bncSslConfig() : 29 QSslConfiguration(QSslConfiguration::defaultConfiguration()) 36 bncSslConfig::bncSslConfig() : 37 QSslConfiguration(QSslConfiguration::defaultConfiguration()) 30 38 { 31 39 32 40 bncSettings settings; 33 41 QString dirName = settings.value("sslCaCertPath").toString(); … … 50 58 caCerts += QSslCertificate::fromPath(dirName+QDir::separator()+fileName); 51 59 } 52 60 53 61 this->setCaCertificates(caCerts); 54 62 } … … 62 70 //////////////////////////////////////////////////////////////////////////// 63 71 QString bncSslConfig::defaultPath() { 64 return QDir::homePath() + QDir::separator() 72 return QDir::homePath() + QDir::separator() 65 73 + ".config" + QDir::separator() + qApp->organizationName(); 66 74 } -
trunk/BNC/src/bncsslconfig.h
r8252 r9739 10 10 bncSslConfig(); 11 11 ~bncSslConfig(); 12 static bncSslConfig instance(); 12 13 static QString defaultPath(); 13 14 private: 14 15 }; 15 16 17 #define BNC_SSL_CONFIG (bncSslConfig::instance()) 18 16 19 #endif -
trunk/BNC/src/upload/bncuploadcaster.cpp
r9738 r9739 219 219 220 220 _outSocket = new QSslSocket(); 221 _outSocket->setSslConfiguration(BNC_CORE->sslConfiguration());222 221 _outSocket->setProxy(QNetworkProxy::NoProxy); 223 222 _outSocket->setSslConfiguration(BNC_SSL_CONFIG); 224 223 connect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed())); 225 224 connect(_outSocket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slotSslErrors(QList<QSslError>))); … … 337 336 338 337 void 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>))); 341 340 emit(newMessage("slotSslSocketConnectionClosed", true)); 342 341 if (_outSocket) {
Note:
See TracChangeset
for help on using the changeset viewer.