Changeset 1367 in ntrip for trunk/BNC/bncgetthread.cpp
- Timestamp:
- Dec 27, 2008, 11:22:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncgetthread.cpp
r1353 r1367 323 323 // Read Caster Response 324 324 // -------------------- 325 _socket->waitForReadyRead(_timeOut); 326 if (_socket->canReadLine()) { 327 QString line = _socket->readLine(); 328 329 // Skip messages from proxy server 330 // ------------------------------- 331 if (line.indexOf("ICY 200 OK") == -1 && 332 line.indexOf("200 OK") != -1 ) { 333 bool proxyRespond = true; 334 while (true) { 335 if (_socket->canReadLine()) { 336 line = _socket->readLine(); 337 if (!proxyRespond) { 338 break; 339 } 340 if (line.trimmed().isEmpty()) { 341 proxyRespond = false; 342 } 343 } 344 else { 345 _socket->waitForReadyRead(_timeOut); 346 if (_socket->bytesAvailable() <= 0) { 347 break; 348 } 349 } 350 } 351 } 352 353 if (line.indexOf("Unauthorized") != -1) { 354 QStringList table; 355 bncTableDlg::getFullTable(_mountPoint.host(), _mountPoint.port(), 356 _ntripVersion, table); 357 QString net; 358 QStringListIterator it(table); 359 while (it.hasNext()) { 360 QString line = it.next(); 361 if (line.indexOf("STR") == 0) { 362 QStringList tags = line.split(";"); 363 if (tags.at(1) == _staID_orig) { 364 net = tags.at(7); 365 break; 366 } 367 } 368 } 369 370 QString reg; 371 it.toFront(); 372 while (it.hasNext()) { 373 QString line = it.next(); 374 if (line.indexOf("NET") == 0) { 375 QStringList tags = line.split(";"); 376 if (tags.at(1) == net) { 377 reg = tags.at(7); 378 break; 379 } 380 } 381 } 382 emit(newMessage((_staID + ": Caster Response: " + line + 383 " Adjust User-ID and Password Register, see" 384 "\n " + reg).toAscii(), true)); 385 return fatal; 386 } 387 if (line.indexOf("ICY 200 OK") != 0) { 388 emit(newMessage((_staID + ": Wrong Caster Response:\n" + line).toAscii(), true)); 325 if (_ntripVersion == "1") { 326 _socket->waitForReadyRead(_timeOut); 327 if (_socket->canReadLine()) { 328 QString line = _socket->readLine(); 329 330 // Skip messages from proxy server 331 // ------------------------------- 332 if (line.indexOf("ICY 200 OK") == -1 && 333 line.indexOf("200 OK") != -1 ) { 334 bool proxyRespond = true; 335 while (true) { 336 if (_socket->canReadLine()) { 337 line = _socket->readLine(); 338 if (!proxyRespond) { 339 break; 340 } 341 if (line.trimmed().isEmpty()) { 342 proxyRespond = false; 343 } 344 } 345 else { 346 _socket->waitForReadyRead(_timeOut); 347 if (_socket->bytesAvailable() <= 0) { 348 break; 349 } 350 } 351 } 352 } 353 354 if (line.indexOf("Unauthorized") != -1) { 355 QStringList table; 356 bncTableDlg::getFullTable(_mountPoint.host(), _mountPoint.port(), 357 _ntripVersion, table); 358 QString net; 359 QStringListIterator it(table); 360 while (it.hasNext()) { 361 QString line = it.next(); 362 if (line.indexOf("STR") == 0) { 363 QStringList tags = line.split(";"); 364 if (tags.at(1) == _staID_orig) { 365 net = tags.at(7); 366 break; 367 } 368 } 369 } 370 371 QString reg; 372 it.toFront(); 373 while (it.hasNext()) { 374 QString line = it.next(); 375 if (line.indexOf("NET") == 0) { 376 QStringList tags = line.split(";"); 377 if (tags.at(1) == net) { 378 reg = tags.at(7); 379 break; 380 } 381 } 382 } 383 emit(newMessage((_staID + ": Caster Response: " + line + 384 " Adjust User-ID and Password Register, see" 385 "\n " + reg).toAscii(), true)); 386 return fatal; 387 } 388 if (line.indexOf("ICY 200 OK") != 0) { 389 emit(newMessage((_staID + ": Wrong Caster Response:\n" + line).toAscii(), true)); 390 return failure; 391 } 392 } 393 else { 394 emit(newMessage(_staID + ": Response Timeout", true)); 389 395 return failure; 390 396 } 391 }392 else {393 emit(newMessage(_staID + ": Response Timeout", true));394 return failure;395 397 } 396 398 }
Note:
See TracChangeset
for help on using the changeset viewer.