Changeset 9732 in ntrip
- Timestamp:
- May 27, 2022, 12:27:30 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNC/src/upload/bncuploadcaster.cpp ¶
r9731 r9732 50 50 _isToBeDeleted = false; 51 51 52 connect(this, SIGNAL(newMessage(QByteArray,bool)), 53 BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 54 55 if (BNC_CORE->_uploadTableItems.find(_iRow) 56 != BNC_CORE->_uploadTableItems.end()) { 52 connect(this, SIGNAL(newMessage(QByteArray,bool)), BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 53 54 if (BNC_CORE->_uploadTableItems.find(_iRow) != BNC_CORE->_uploadTableItems.end()) { 57 55 connect(this, SIGNAL(newBytes(QByteArray,double)), 58 BNC_CORE->_uploadTableItems.value(iRow), 59 SLOT(slotNewBytes(const QByteArray,double))); 60 } 61 if (BNC_CORE->_uploadEphTableItems.find(_iRow) 62 != BNC_CORE->_uploadEphTableItems.end()) { 56 BNC_CORE->_uploadTableItems.value(iRow), 57 SLOT(slotNewBytes(const QByteArray,double))); 58 } 59 if (BNC_CORE->_uploadEphTableItems.find(_iRow) != BNC_CORE->_uploadEphTableItems.end()) { 63 60 connect(this, SIGNAL(newBytes(QByteArray,double)), 64 BNC_CORE->_uploadEphTableItems.value(iRow), 65 SLOT(slotNewBytes(const QByteArray,double))); 66 } 67 68 _sslIgnoreErrors = (Qt::CheckState(settings.value("sslIgnoreErrors").toInt()) 69 == Qt::Checked); 61 BNC_CORE->_uploadEphTableItems.value(iRow), 62 SLOT(slotNewBytes(const QByteArray,double))); 63 } 64 65 _sslIgnoreErrors = (Qt::CheckState(settings.value("sslIgnoreErrors").toInt()) == Qt::Checked); 70 66 71 67 _proxyOutHost = settings.value("proxyHost").toString(); … … 176 172 _outSocket->flush(); 177 173 } else { 178 QString chunkSize = QString("%1").arg(_outBuffer.size(), 0, 16, 179 QLatin1Char('0')); 180 QByteArray chunkedData = chunkSize.toLatin1() + "\r\n" + _outBuffer 181 + "\r\n"; 174 QString chunkSize = QString("%1").arg(_outBuffer.size(), 0, 16, QLatin1Char('0')); 175 QByteArray chunkedData = chunkSize.toLatin1() + "\r\n" + _outBuffer + "\r\n"; 182 176 _outSocket->write(chunkedData); 183 177 _outSocket->flush(); … … 205 199 QByteArray msg; 206 200 207 208 201 if (_mountpoint.isEmpty()) { 209 202 return; … … 231 224 _outSocket->setProxy(QNetworkProxy::NoProxy); 232 225 _outSocket->setSslConfiguration(sslConfig); 233 234 226 connect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed())); 235 227 connect(_outSocket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slotSslErrors(QList<QSslError>))); … … 262 254 _outSocket->waitForBytesWritten(); 263 255 _outSocket->waitForReadyRead(); 264 QByteArray ans = _outSocket->read Line(); cout << ans.toStdString().c_str() << endl;256 QByteArray ans = _outSocket->readAll(); cout << ans.toStdString().c_str() << endl; 265 257 if (ans.indexOf("200") == -1) { 266 emit(newMessage( 267 "Proxy: Connection broken for " + _mountpoint.toLatin1() 268 + ": " + ans.left(ans.length() - 2), true)); 258 emit(newMessage("Proxy: Connection broken for " + _mountpoint.toLatin1() 259 + ": " + ans.left(ans.length() - 2), true)); 269 260 _outSocket->close(); 270 261 return; 271 262 } else { 272 emit(newMessage( 273 "Proxy: Connection opened for " + _mountpoint.toLatin1() 274 + ": " + ans.left(ans.length() - 2), true)); 263 emit(newMessage("Proxy: Connection established for " + _mountpoint.toLatin1(), true)); 275 264 _sOpenTrial = 0; 276 265 _outSocket->setPeerVerifyName(_casterOutHost); 277 266 _outSocket->startClientEncryption(); 278 267 if (!_outSocket->waitForEncrypted(timeOut)) { 279 emit(newMessage( 280 "Proxy/Caster: Encrypt timeout for " + _mountpoint.toLatin1() + " (" 281 + _casterOutHost.toLatin1() + ":" 282 + QString("%1) ").arg(_casterOutPort).toLatin1() 283 + _outSocket->errorString().toLatin1(), true)); 268 emit(newMessage("Proxy/Caster: Encrypt timeout for " + _mountpoint.toLatin1() + " (" 269 + _casterOutHost.toLatin1() + ":" 270 + QString("%1) ").arg(_casterOutPort).toLatin1() 271 + _outSocket->errorString().toLatin1(), true)); 284 272 return; 285 273 } else { … … 301 289 + "Connection: close\r\n" + "Transfer-Encoding: chunked\r\n\r\n"; 302 290 } 303 cout << msg.toStdString().c_str();291 //cout << msg.toStdString().c_str(); 304 292 _outSocket->write(msg); 305 293 _outSocket->waitForBytesWritten(); … … 308 296 QByteArray ans = ""; 309 297 if (_outSocket->canReadLine()) { 310 ans = _outSocket->readLine(); cout << "ans: " << ans.toStdString().c_str() << endl;298 ans = _outSocket->readLine(); //cout << "ans: " << ans.toStdString().c_str() << endl; 311 299 } 312 300 313 301 if (ans.indexOf("200") == -1) { 314 302 _outSocket->close(); 315 emit(newMessage( 316 "Broadcaster: Connection broken for " + _mountpoint.toLatin1() + ": " 317 + ans.left(ans.length() - 2), true)); 318 } else { 319 emit(newMessage( 320 "Broadcaster: Connection opened for " + _mountpoint.toLatin1() + ": " 321 + ans.left(ans.length() - 2), true)); 303 emit(newMessage("Broadcaster: Connection broken for " + _mountpoint.toLatin1() + ": " 304 + ans.left(ans.length() - 2), true)); 305 } else { 306 emit(newMessage("Broadcaster: Connection opened for " + _mountpoint.toLatin1(), true)); 322 307 _sOpenTrial = 0; 323 308 }
Note:
See TracChangeset
for help on using the changeset viewer.