From 902e2ee8e61acb18d2819e8a59a28921f85bbd77 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Tue, 13 Dec 2011 14:52:46 +0000
Subject: Avoid crash due to misuse of XMPPLayer


diff --git a/Swiften/Network/HTTPConnectProxiedConnection.cpp b/Swiften/Network/HTTPConnectProxiedConnection.cpp
index 3e6c986..edbdd82 100644
--- a/Swiften/Network/HTTPConnectProxiedConnection.cpp
+++ b/Swiften/Network/HTTPConnectProxiedConnection.cpp
@@ -85,6 +85,7 @@ void HTTPConnectProxiedConnection::handleConnectionConnectFinished(bool error) {
 			append(data, createSafeByteArray("\r\n"));
 		}
 		append(data, createSafeByteArray("\r\n"));
+		SWIFT_LOG(debug) << "HTTP Proxy send headers: " << byteArrayToString(ByteArray(data.begin(), data.end())) << std::endl;
 		connection_->write(data);
 	}
 	else {
diff --git a/Swiften/StreamStack/HighLayer.cpp b/Swiften/StreamStack/HighLayer.cpp
index dc17c2a..0f76f22 100644
--- a/Swiften/StreamStack/HighLayer.cpp
+++ b/Swiften/StreamStack/HighLayer.cpp
@@ -19,8 +19,10 @@ HighLayer::~HighLayer() {
 }
 
 void HighLayer::writeDataToChildLayer(const SafeByteArray& data) {
-	assert(childLayer);
-	childLayer->writeData(data);
+	//assert(childLayer);
+	if (childLayer) {
+		childLayer->writeData(data);
+	}
 }
 
 }
-- 
cgit v0.10.2-6-g49f6