Changeset 1579 in ntrip


Ignore:
Timestamp:
Feb 12, 2009, 11:50:38 AM (15 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncnetqueryv1.cpp

    r1575 r1579  
    155155  // Read Caster Response
    156156  // --------------------
     157  bool proxyResponse = false;
    157158  QStringList response;
    158159  while (true) {
     
    166167    if (_socket->canReadLine()) {
    167168      QString line = _socket->readLine();
    168       response.push_back(line);
     169
     170      if (line.indexOf("ICY 200 OK") == -1 &&
     171          line.indexOf("HTTP")       != -1 &&
     172          line.indexOf("200 OK")     != -1 ) {
     173        proxyResponse = true;
     174      }
     175
     176      if (!proxyResponse) {
     177        response.push_back(line);
     178      }
     179
    169180      if (line.trimmed().isEmpty()) {
    170         break;
    171       }
    172       if (line.indexOf("200 OK") != -1 &&
     181        if (proxyResponse) {
     182          proxyResponse = false;
     183        }
     184        else {
     185          break;
     186        }
     187      }
     188
     189      if (!proxyResponse                    &&
     190          line.indexOf("200 OK")      != -1 &&
    173191          line.indexOf("SOURCETABLE") == -1) {
    174192        response.clear();
    175         break;
     193        break;
    176194      }
    177195    }
Note: See TracChangeset for help on using the changeset viewer.