Index: trunk/BNC/bncgetthread.cpp
===================================================================
--- trunk/BNC/bncgetthread.cpp	(revision 1366)
+++ trunk/BNC/bncgetthread.cpp	(revision 1367)
@@ -323,74 +323,76 @@
     // Read Caster Response
     // --------------------
-    _socket->waitForReadyRead(_timeOut);
-    if (_socket->canReadLine()) {
-      QString line = _socket->readLine();
-    
-      // Skip messages from proxy server
-      // -------------------------------
-      if (line.indexOf("ICY 200 OK") == -1 && 
-          line.indexOf("200 OK")     != -1 ) {
-        bool proxyRespond = true;
-        while (true) {
-          if (_socket->canReadLine()) {
-            line = _socket->readLine();
-            if (!proxyRespond) {
-              break;
-            }
-            if (line.trimmed().isEmpty()) {
-              proxyRespond = false;
-            }
-          }
-          else {
-            _socket->waitForReadyRead(_timeOut);
-            if (_socket->bytesAvailable() <= 0) {
-              break;
-            }
-          }
-        }
-      }
-    
-      if (line.indexOf("Unauthorized") != -1) {
-        QStringList table;
-        bncTableDlg::getFullTable(_mountPoint.host(), _mountPoint.port(), 
-                                  _ntripVersion, table);
-        QString net;
-        QStringListIterator it(table);
-        while (it.hasNext()) {
-          QString line = it.next();
-          if (line.indexOf("STR") == 0) {
-            QStringList tags = line.split(";");
-            if (tags.at(1) == _staID_orig) {
-              net = tags.at(7);
-              break;
-            }
-          }
-        }
-    
-        QString reg;
-        it.toFront();
-        while (it.hasNext()) {
-          QString line = it.next();
-          if (line.indexOf("NET") == 0) {
-            QStringList tags = line.split(";");
-            if (tags.at(1) == net) {
-              reg = tags.at(7);
-              break;
-            }          
-          }
-        }
-        emit(newMessage((_staID + ": Caster Response: " + line + 
-                         "          Adjust User-ID and Password Register, see"
-                         "\n          " + reg).toAscii(), true));
-        return fatal;
-      }
-      if (line.indexOf("ICY 200 OK") != 0) {
-        emit(newMessage((_staID + ": Wrong Caster Response:\n" + line).toAscii(), true));
+    if (_ntripVersion == "1") {
+      _socket->waitForReadyRead(_timeOut);
+      if (_socket->canReadLine()) {
+        QString line = _socket->readLine();
+      
+        // Skip messages from proxy server
+        // -------------------------------
+        if (line.indexOf("ICY 200 OK") == -1 && 
+            line.indexOf("200 OK")     != -1 ) {
+          bool proxyRespond = true;
+          while (true) {
+            if (_socket->canReadLine()) {
+              line = _socket->readLine();
+              if (!proxyRespond) {
+                break;
+              }
+              if (line.trimmed().isEmpty()) {
+                proxyRespond = false;
+              }
+            }
+            else {
+              _socket->waitForReadyRead(_timeOut);
+              if (_socket->bytesAvailable() <= 0) {
+                break;
+              }
+            }
+          }
+        }
+      
+        if (line.indexOf("Unauthorized") != -1) {
+          QStringList table;
+          bncTableDlg::getFullTable(_mountPoint.host(), _mountPoint.port(), 
+                                    _ntripVersion, table);
+          QString net;
+          QStringListIterator it(table);
+          while (it.hasNext()) {
+            QString line = it.next();
+            if (line.indexOf("STR") == 0) {
+              QStringList tags = line.split(";");
+              if (tags.at(1) == _staID_orig) {
+                net = tags.at(7);
+                break;
+              }
+            }
+          }
+      
+          QString reg;
+          it.toFront();
+          while (it.hasNext()) {
+            QString line = it.next();
+            if (line.indexOf("NET") == 0) {
+              QStringList tags = line.split(";");
+              if (tags.at(1) == net) {
+                reg = tags.at(7);
+                break;
+              }          
+            }
+          }
+          emit(newMessage((_staID + ": Caster Response: " + line + 
+                           "          Adjust User-ID and Password Register, see"
+                           "\n          " + reg).toAscii(), true));
+          return fatal;
+        }
+        if (line.indexOf("ICY 200 OK") != 0) {
+          emit(newMessage((_staID + ": Wrong Caster Response:\n" + line).toAscii(), true));
+          return failure;
+        }
+      }
+      else {
+        emit(newMessage(_staID + ": Response Timeout", true));
         return failure;
       }
-    }
-    else {
-      emit(newMessage(_staID + ": Response Timeout", true));
-      return failure;
     }
   }
Index: trunk/BNC/bncsocket.cpp
===================================================================
--- trunk/BNC/bncsocket.cpp	(revision 1366)
+++ trunk/BNC/bncsocket.cpp	(revision 1367)
@@ -5,5 +5,5 @@
  * Class:      bncSocket
  *
- * Purpose:    Combines QTcpSocket (NTRIP v1) and  QNetworkReply (NTRIP v2)
+ * Purpose:    Combines QTcpSocket (NTRIP v1) and QHttp (NTRIP v2)
  *
  * Author:     L. Mervart
@@ -17,4 +17,6 @@
 #include <iostream>
 #include <iomanip>
+
+#include <string.h>
 
 #include "bncsocket.h"
@@ -46,5 +48,13 @@
 ////////////////////////////////////////////////////////////////////////////
 QAbstractSocket::SocketState bncSocket::state() const {
-  if (_socket) {
+  if      (_http) {
+    if (_http->state() != QHttp::Unconnected) {
+      return QAbstractSocket::ConnectedState;
+    }
+    else {
+      return QAbstractSocket::UnconnectedState;
+    }
+  }
+  else if (_socket) {
     return _socket->state();
   }
@@ -136,5 +146,10 @@
 ////////////////////////////////////////////////////////////////////////////
 qint64 bncSocket::read(char* data, qint64 maxlen) {
-  if (_socket) {
+  if      (_http) {
+    strncpy(data, _buffer.data(), maxlen);
+    _buffer = _buffer.right(_buffer.size()-maxlen);
+    return maxlen; 
+  }
+  else if (_socket) {
     return _socket->read(data, maxlen);
   }
