Index: trunk/BNC/bncnetqueryv1.cpp
===================================================================
--- trunk/BNC/bncnetqueryv1.cpp	(revision 1847)
+++ trunk/BNC/bncnetqueryv1.cpp	(revision 1848)
@@ -28,6 +28,7 @@
 ////////////////////////////////////////////////////////////////////////////
 bncNetQueryV1::bncNetQueryV1() {
-  _socket  = 0;
-  _timeOut = 20000;
+  _socket    = 0;
+  _eventLoop = new QEventLoop(this);
+  _timeOut   = 20000;
 }
 
@@ -36,4 +37,5 @@
 bncNetQueryV1::~bncNetQueryV1() {
   delete _socket;
+  delete _eventLoop;
 }
 
@@ -41,4 +43,5 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncNetQueryV1::stop() {
+  _eventLoop->quit();
 #ifndef sparc
   if (_socket) {
@@ -49,7 +52,31 @@
 }
 
+// End of Request
+////////////////////////////////////////////////////////////////////////////
+void bncNetQueryV1::slotFinished() {
+  _eventLoop->quit();
+  if (_socket) { 
+    _outData = _socket->readAll();
+    _status = finished;
+  }
+}
+
 // 
 ////////////////////////////////////////////////////////////////////////////
-void bncNetQueryV1::waitForRequestResult(const QUrl&, QByteArray&) {
+void bncNetQueryV1::waitForRequestResult(const QUrl& url, QByteArray& outData){
+
+  delete _socket;
+  _socket = new QTcpSocket();
+
+  connect(_socket, SIGNAL(disconnected()), this, SLOT(slotFinished()));
+
+  startRequestPrivate(url, "", true);
+
+  _eventLoop->exec();
+
+  delete _socket; _socket = 0;
+
+  outData = _outData;
+  _outData.clear();
 }
 
@@ -83,9 +110,19 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncNetQueryV1::startRequest(const QUrl& url, const QByteArray& gga) {
+  startRequestPrivate(url, gga, false);
+}
+
+// Connect to Caster, send the Request
+////////////////////////////////////////////////////////////////////////////
+void bncNetQueryV1::startRequestPrivate(const QUrl& url, 
+                                        const QByteArray& gga, 
+                                        bool sendRequestOnly) {
 
   _status = running;
 
-  delete _socket;
-  _socket = new QTcpSocket();
+  if (!sendRequestOnly) {
+    delete _socket;
+    _socket = new QTcpSocket();
+  }
 
   // Default scheme and path
@@ -161,60 +198,62 @@
   // Read Caster Response
   // --------------------
-  bool proxyResponse = false;
-  QStringList response;
-  while (true) {
-    if (_socket->canReadLine()) {
-      QString line = _socket->readLine();
-
-      if (line.indexOf("ICY 200 OK") == -1 && 
-          line.indexOf("HTTP")       != -1 && 
-          line.indexOf("200 OK")     != -1 ) {
-        proxyResponse = true;
-      }
-
-      if (!proxyResponse && !line.trimmed().isEmpty()) {
-        response.push_back(line);
-      }
-
-      if (line.trimmed().isEmpty()) {
-        if (proxyResponse) {
-          proxyResponse = false;
-	}
-	else {
+  if (!sendRequestOnly) {
+    bool proxyResponse = false;
+    QStringList response;
+    while (true) {
+      if (_socket->canReadLine()) {
+        QString line = _socket->readLine();
+    
+        if (line.indexOf("ICY 200 OK") == -1 && 
+            line.indexOf("HTTP")       != -1 && 
+            line.indexOf("200 OK")     != -1 ) {
+          proxyResponse = true;
+        }
+    
+        if (!proxyResponse && !line.trimmed().isEmpty()) {
+          response.push_back(line);
+        }
+    
+        if (line.trimmed().isEmpty()) {
+          if (proxyResponse) {
+            proxyResponse = false;
+    	}
+    	else {
+            break;
+    	}
+        }
+    
+        if (line.indexOf("Unauthorized") != -1) {
           break;
-	}
-      }
-
-      if (line.indexOf("Unauthorized") != -1) {
-        break;
-      }
-
-      if (!proxyResponse                    &&
-          line.indexOf("200 OK")      != -1 &&
-          line.indexOf("SOURCETABLE") == -1) {
-        response.clear();
-        if (_socket->canReadLine()) {
-          _socket->readLine();
-	}
-	break;
+        }
+    
+        if (!proxyResponse                    &&
+            line.indexOf("200 OK")      != -1 &&
+            line.indexOf("SOURCETABLE") == -1) {
+          response.clear();
+          if (_socket->canReadLine()) {
+            _socket->readLine();
+    	}
+    	break;
+        }
+      }
+      else if (!_socket->waitForReadyRead(_timeOut)) {
+        delete _socket;
+        _socket = 0;
+        _status = error;
+        emit newMessage(_url.path().toAscii().replace(0,1,"") 
+                        + ": Response timeout", true);
+        return;
       }
     }
-    else if (!_socket->waitForReadyRead(_timeOut)) {
+    if (response.size() > 0) {
       delete _socket;
       _socket = 0;
       _status = error;
       emit newMessage(_url.path().toAscii().replace(0,1,"") 
-                      + ": Response timeout", true);
-      return;
+                      + ": Wrong caster response\n" 
+                      + response.join("").toAscii(), true);
     }
   }
-  if (response.size() > 0) {
-    delete _socket;
-    _socket = 0;
-    _status = error;
-    emit newMessage(_url.path().toAscii().replace(0,1,"") 
-                    + ": Wrong caster response\n" 
-                    + response.join("").toAscii(), true);
-  }
-}
-
+}
+
Index: trunk/BNC/bncnetqueryv1.h
===================================================================
--- trunk/BNC/bncnetqueryv1.h	(revision 1847)
+++ trunk/BNC/bncnetqueryv1.h	(revision 1848)
@@ -5,4 +5,6 @@
 
 class bncNetQueryV1 : public bncNetQuery {
+ Q_OBJECT
+
  public:
   bncNetQueryV1();
@@ -14,6 +16,13 @@
   virtual void waitForReadyRead(QByteArray& outData);
 
+ private slots:
+  void slotFinished();
+
  private:
+  void startRequestPrivate(const QUrl& url, const QByteArray& gga, 
+                           bool sendRequestOnly);
+  QEventLoop* _eventLoop;
   QTcpSocket* _socket;
+  QByteArray  _outData;
 };
 
Index: trunk/BNC/bncrinex.cpp
===================================================================
--- trunk/BNC/bncrinex.cpp	(revision 1847)
+++ trunk/BNC/bncrinex.cpp	(revision 1848)
@@ -54,5 +54,5 @@
 #include "bnctabledlg.h"
 #include "bncgetthread.h"
-#include "bncnetqueryv2.h"
+#include "bncnetqueryv1.h"
 #include "bncsettings.h"
 #include "RTCM3/rtcm3torinex.h"
@@ -162,5 +162,5 @@
     }
 
-    bncNetQueryV2 query;
+    bncNetQueryV1 query;
     QByteArray outData;
     query.waitForRequestResult(url, outData);
Index: trunk/BNC/bnctabledlg.cpp
===================================================================
--- trunk/BNC/bnctabledlg.cpp	(revision 1847)
+++ trunk/BNC/bnctabledlg.cpp	(revision 1848)
@@ -43,5 +43,5 @@
 #include "bnctabledlg.h"
 #include "bncgetthread.h"
-#include "bncnetqueryv2.h"
+#include "bncnetqueryv1.h"
 #include "bncsettings.h"
 
@@ -196,5 +196,5 @@
   url.setPath("/");
 
-  bncNetQueryV2 query;
+  bncNetQueryV1 query;
   QByteArray outData;
   query.waitForRequestResult(url, outData);
@@ -448,5 +448,5 @@
   url.setPath("/");
 
-  bncNetQueryV2 query;
+  bncNetQueryV1 query;
   QByteArray outData;
   query.waitForRequestResult(url, outData);
