Changeset 9748 in ntrip
- Timestamp:
- Jun 1, 2022, 1:33:28 PM (3 years ago)
- Location:
- trunk/BNC/src/upload
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/upload/bncuploadcaster.cpp
r9746 r9748 105 105 } 106 106 if (_outSocket) { 107 disconnect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed()));108 107 delete _outSocket; 109 108 } … … 142 141 } 143 142 emit(newMessage(msg.toLatin1(), true)); 144 145 143 } 146 144 } … … 194 192 } 195 193 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; 204 200 205 201 double minDt = pow(2.0, _sOpenTrial); … … 217 213 _outSocket->setProxy(QNetworkProxy::NoProxy); 218 214 219 connect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed()));220 221 215 if (_sslIgnoreErrors) { 222 216 _outSocket->ignoreSslErrors(); 223 emit(newMessage("BNC ignores SSL errors during upload as configured", true));224 217 } else { 225 218 _outSocket->setSslConfiguration(BNC_SSL_CONFIG); … … 234 227 if (_ntripVersion == "1") { 235 228 emit(newMessage("No proxy support in Ntrip Version 1 upload!", true)); 236 _outSocket->close();229 delete _outSocket; _outSocket = 0; 237 230 return; 238 231 } … … 259 252 int l = ans.indexOf("\r\n", 0); 260 253 emit(newMessage("Proxy: Connection broken for " + _mountpoint.toLatin1() + ": " + ans.left(l), true)); 261 _outSocket->close();254 delete _outSocket; _outSocket = 0; 262 255 return; 263 256 } else { … … 271 264 + QString("%1) ").arg(_casterOutPort).toLatin1() 272 265 + _outSocket->errorString().toLatin1(), true)); 266 delete _outSocket; _outSocket = 0; 273 267 return; 274 268 } else { … … 290 284 + "Connection: close\r\n" + "Transfer-Encoding: chunked\r\n\r\n"; 291 285 } 292 //cout << msg.toStdString().c_str();293 286 _outSocket->write(msg); 294 287 _outSocket->waitForBytesWritten(); … … 298 291 299 292 if (ans.indexOf("200") == -1) { 300 _outSocket->close();293 delete _outSocket; _outSocket = 0; 301 294 int l = ans.indexOf("\r\n", 0); 302 295 emit(newMessage("Broadcaster: Connection broken for " + _mountpoint.toLatin1() + ": " + ans.left(l), true)); … … 319 312 + QString("%1) ").arg(outPort).toLatin1() 320 313 + _outSocket->errorString().toLatin1(), true)); 314 delete _outSocket; _outSocket = 0; 321 315 return false; 322 316 } else { … … 331 325 + QString("%1) ").arg(outPort).toLatin1() 332 326 + _outSocket->errorString().toLatin1(), true)); 327 delete _outSocket; _outSocket = 0; 333 328 return false; 334 329 } … … 338 333 339 334 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 37 37 void slotProxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*); 38 38 void slotSslErrors(QList<QSslError>); 39 void slotSslSocketConnectionClosed();40 39 41 40 private:
Note:
See TracChangeset
for help on using the changeset viewer.