Index: /trunk/BNC/bncnetqueryv1.cpp
===================================================================
--- /trunk/BNC/bncnetqueryv1.cpp	(revision 1384)
+++ /trunk/BNC/bncnetqueryv1.cpp	(revision 1385)
@@ -18,7 +18,5 @@
 #include <iomanip>
 
-#include "bncsocket.h"
-#include "bncapp.h"
-#include "bncutils.h"
+#include "bncnetqueryv1.h"
 
 using namespace std;
@@ -53,6 +51,20 @@
 void bncNetQueryV1::startRequest(const QUrl& url, const QByteArray& gga) {
 
+  const int timeOut = 5000;
+
+  _status = running;
+
   delete _socket;
   _socket = new QTcpSocket();
+
+  // Default scheme and path
+  // -----------------------
+  QUrl urlLoc(url);
+  if (urlLoc.scheme().isEmpty()) {
+    urlLoc.setScheme("http");
+  }
+  if (urlLoc.path().isEmpty()) {
+    urlLoc.setPath("/");
+  }
 
   // Connect the Socket
@@ -63,5 +75,5 @@
  
   if ( proxyHost.isEmpty() ) {
-    _socket->connectToHost(mountPoint.host(), mountPoint.port());
+    _socket->connectToHost(urlLoc.host(), urlLoc.port());
   }
   else {
@@ -69,38 +81,31 @@
   }
   if (!_socket->waitForConnected(timeOut)) {
-    msg += "Connect timeout\n";
     delete _socket; 
     _socket = 0;
-    return failure;
+    _status = error;
+    return;
   }
 
   // Send Request
   // ------------
-  QString uName = QUrl::fromPercentEncoding(mountPoint.userName().toAscii());
-  QString passW = QUrl::fromPercentEncoding(mountPoint.password().toAscii());
+  QString uName = QUrl::fromPercentEncoding(urlLoc.userName().toAscii());
+  QString passW = QUrl::fromPercentEncoding(urlLoc.password().toAscii());
   QByteArray userAndPwd;
 
-  if(!uName.isEmpty() || !passW.isEmpty())
-  {
+  if(!uName.isEmpty() || !passW.isEmpty()) {
     userAndPwd = "Authorization: Basic " + (uName.toAscii() + ":" +
     passW.toAscii()).toBase64() + "\r\n";
   }
 
-  QUrl hlp;
-  hlp.setScheme("http");
-  hlp.setHost(mountPoint.host());
-  hlp.setPort(mountPoint.port());
-  hlp.setPath(mountPoint.path());
-
   QByteArray reqStr;
   if ( proxyHost.isEmpty() ) {
-    if (hlp.path().indexOf("/") != 0) hlp.setPath("/");
-    reqStr = "GET " + hlp.path().toAscii() + " HTTP/1.0\r\n"
+    if (urlLoc.path().indexOf("/") != 0) urlLoc.setPath("/");
+    reqStr = "GET " + urlLoc.path().toAscii() + " HTTP/1.0\r\n"
              + "User-Agent: NTRIP BNC/" BNCVERSION "\r\n"
              + userAndPwd + "\r\n";
   } else {
-    reqStr = "GET " + hlp.toEncoded() + " HTTP/1.0\r\n"
+    reqStr = "GET " + urlLoc.toEncoded() + " HTTP/1.0\r\n"
              + "User-Agent: NTRIP BNC/" BNCVERSION "\r\n"
-             + "Host: " + hlp.host().toAscii() + "\r\n"
+             + "Host: " + urlLoc.host().toAscii() + "\r\n"
              + userAndPwd + "\r\n";
   }
@@ -108,20 +113,15 @@
   // NMEA string to handle VRS stream
   // --------------------------------
-  if ((nmea == "yes") && (hlp.path().length() > 2) && (hlp.path().indexOf(".skl") < 0)) {
-    reqStr += ggaString(latitude, longitude) + "\r\n";
+  if (!gga.isEmpty()) {
+    reqStr += gga + "\r\n";
   }
-
-  msg += reqStr;
 
   _socket->write(reqStr, reqStr.length());
 
   if (!_socket->waitForBytesWritten(timeOut)) {
-    msg += "Write timeout\n";
     delete _socket;
     _socket = 0;
-    return failure;
+    _status = error;
   }
-
-  return success;
 }
 
