Changeset 645 in ntrip for trunk/BNC/bncgetthread.cpp


Ignore:
Timestamp:
Dec 19, 2007, 10:07:55 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncgetthread.cpp

    r629 r645  
    132132}
    133133
     134#define AGENTVERSION "1.5"
    134135// Connect to Caster, send the Request (static)
    135136////////////////////////////////////////////////////////////////////////////
     
    162163  QString uName = QUrl::fromPercentEncoding(mountPoint.userName().toAscii());
    163164  QString passW = QUrl::fromPercentEncoding(mountPoint.password().toAscii());
    164   QByteArray userAndPwd = uName.toAscii() + ":" + passW.toAscii();
     165  QByteArray userAndPwd;
     166
     167  if(!uName.isEmpty() || !passW.isEmpty())
     168  {
     169    userAndPwd = "Authorization: Basic " + (uName.toAscii() + ":" +
     170    passW.toAscii()).toBase64() + "\r\n";
     171  }
    165172
    166173  QUrl hlp;
     
    173180  if ( proxyHost.isEmpty() ) {
    174181   if (hlp.path().indexOf("/") != 0) hlp.setPath("/");
    175    reqStr = "GET " + hlp.path().toAscii() +
    176             " HTTP/1.0\r\n"
    177             "User-Agent: NTRIP BNC 1.5\r\n"
    178             "Authorization: Basic " +
    179             userAndPwd.toBase64() + "\r\n";
     182     reqStr = "GET " + hlp.path().toAscii() + " HTTP/1.0\r\n";
    180183   } else {
    181    reqStr = "GET " + hlp.toEncoded() +
    182             " HTTP/1.0\r\n"
    183             "User-Agent: NTRIP BNC 1.5\r\n"
    184             "Authorization: Basic " +
    185             userAndPwd.toBase64() + "\r\n";
    186   }
    187   if (hlp.path().indexOf(".skl") > 0) { reqStr += "Host: " + hlp.host().toAscii() + "\r\n"; }
    188   reqStr += "\r\n";
     184     reqStr = "GET " + hlp.toEncoded() + " HTTP/1.0\r\n";
     185  }
     186  reqStr += "User-Agent: NTRIP BNC/" AGENTVERSION "\r\n"
     187  "Host: " + hlp.host().toAscii() + "\r\n"
     188  + userAndPwd + "\r\n";
    189189
    190190// NMEA string to handle VRS stream
Note: See TracChangeset for help on using the changeset viewer.