Index: /trunk/BNC/src/upload/bncuploadcaster.cpp
===================================================================
--- /trunk/BNC/src/upload/bncuploadcaster.cpp	(revision 9731)
+++ /trunk/BNC/src/upload/bncuploadcaster.cpp	(revision 9732)
@@ -50,22 +50,18 @@
   _isToBeDeleted = false;
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)),
-  BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
-
-  if (BNC_CORE->_uploadTableItems.find(_iRow)
-      != BNC_CORE->_uploadTableItems.end()) {
+  connect(this, SIGNAL(newMessage(QByteArray,bool)), BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
+
+  if (BNC_CORE->_uploadTableItems.find(_iRow) != BNC_CORE->_uploadTableItems.end()) {
     connect(this, SIGNAL(newBytes(QByteArray,double)),
-    BNC_CORE->_uploadTableItems.value(iRow),
-        SLOT(slotNewBytes(const QByteArray,double)));
-  }
-  if (BNC_CORE->_uploadEphTableItems.find(_iRow)
-      != BNC_CORE->_uploadEphTableItems.end()) {
+            BNC_CORE->_uploadTableItems.value(iRow),
+            SLOT(slotNewBytes(const QByteArray,double)));
+  }
+  if (BNC_CORE->_uploadEphTableItems.find(_iRow) != BNC_CORE->_uploadEphTableItems.end()) {
     connect(this, SIGNAL(newBytes(QByteArray,double)),
-    BNC_CORE->_uploadEphTableItems.value(iRow),
-        SLOT(slotNewBytes(const QByteArray,double)));
-  }
-
-  _sslIgnoreErrors = (Qt::CheckState(settings.value("sslIgnoreErrors").toInt())
-      == Qt::Checked);
+            BNC_CORE->_uploadEphTableItems.value(iRow),
+            SLOT(slotNewBytes(const QByteArray,double)));
+  }
+
+  _sslIgnoreErrors = (Qt::CheckState(settings.value("sslIgnoreErrors").toInt()) == Qt::Checked);
 
   _proxyOutHost = settings.value("proxyHost").toString();
@@ -176,8 +172,6 @@
           _outSocket->flush();
         } else {
-          QString chunkSize = QString("%1").arg(_outBuffer.size(), 0, 16,
-              QLatin1Char('0'));
-          QByteArray chunkedData = chunkSize.toLatin1() + "\r\n" + _outBuffer
-              + "\r\n";
+          QString chunkSize = QString("%1").arg(_outBuffer.size(), 0, 16,  QLatin1Char('0'));
+          QByteArray chunkedData = chunkSize.toLatin1() + "\r\n" + _outBuffer  + "\r\n";
           _outSocket->write(chunkedData);
           _outSocket->flush();
@@ -205,5 +199,4 @@
   QByteArray msg;
 
-
   if (_mountpoint.isEmpty()) {
     return;
@@ -231,5 +224,4 @@
   _outSocket->setProxy(QNetworkProxy::NoProxy);
   _outSocket->setSslConfiguration(sslConfig);
-
   connect(_outSocket, SIGNAL(disconnected()), this, SLOT(slotSslSocketConnectionClosed()));
   connect(_outSocket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(slotSslErrors(QList<QSslError>)));
@@ -262,24 +254,20 @@
       _outSocket->waitForBytesWritten();
       _outSocket->waitForReadyRead();
-      QByteArray ans = _outSocket->readLine();      cout << ans.toStdString().c_str() << endl;
+      QByteArray ans = _outSocket->readAll();      cout << ans.toStdString().c_str() << endl;
       if (ans.indexOf("200") == -1) {
-        emit(newMessage(
-            "Proxy: Connection broken for " + _mountpoint.toLatin1()
-                + ": " + ans.left(ans.length() - 2), true));
+        emit(newMessage("Proxy: Connection broken for " + _mountpoint.toLatin1()
+                        + ": " + ans.left(ans.length() - 2), true));
         _outSocket->close();
         return;
       } else {
-        emit(newMessage(
-            "Proxy: Connection opened for " + _mountpoint.toLatin1()
-                + ": " + ans.left(ans.length() - 2), true));
+        emit(newMessage("Proxy: Connection established for " + _mountpoint.toLatin1(), true));
         _sOpenTrial = 0;
         _outSocket->setPeerVerifyName(_casterOutHost);
         _outSocket->startClientEncryption();
         if (!_outSocket->waitForEncrypted(timeOut)) {
-          emit(newMessage(
-              "Proxy/Caster: Encrypt timeout for " + _mountpoint.toLatin1() + " ("
-                  + _casterOutHost.toLatin1() + ":"
-                  + QString("%1) ").arg(_casterOutPort).toLatin1()
-                  + _outSocket->errorString().toLatin1(), true));
+          emit(newMessage("Proxy/Caster: Encrypt timeout for " + _mountpoint.toLatin1() + " ("
+                          + _casterOutHost.toLatin1() + ":"
+                          + QString("%1) ").arg(_casterOutPort).toLatin1()
+                          + _outSocket->errorString().toLatin1(), true));
           return;
         } else {
@@ -301,5 +289,5 @@
         + "Connection: close\r\n" + "Transfer-Encoding: chunked\r\n\r\n";
   }
-  cout << msg.toStdString().c_str();
+  //cout << msg.toStdString().c_str();
   _outSocket->write(msg);
   _outSocket->waitForBytesWritten();
@@ -308,16 +296,13 @@
    QByteArray ans = "";
   if (_outSocket->canReadLine()) {
-    ans = _outSocket->readLine();  cout << "ans: " << ans.toStdString().c_str() << endl;
+    ans = _outSocket->readLine();  //cout << "ans: " << ans.toStdString().c_str() << endl;
   }
 
   if (ans.indexOf("200") == -1) {
     _outSocket->close();
-    emit(newMessage(
-        "Broadcaster: Connection broken for " + _mountpoint.toLatin1() + ": "
-            + ans.left(ans.length() - 2), true));
-  } else {
-    emit(newMessage(
-        "Broadcaster: Connection opened for " + _mountpoint.toLatin1() + ": "
-            + ans.left(ans.length() - 2), true));
+    emit(newMessage("Broadcaster: Connection broken for " + _mountpoint.toLatin1() + ": "
+                    + ans.left(ans.length() - 2), true));
+  } else {
+    emit(newMessage("Broadcaster: Connection opened for " + _mountpoint.toLatin1(), true));
     _sOpenTrial = 0;
   }
