Index: source/ariba/utility/transport/StreamTransport/StreamTransport.cpp
===================================================================
--- source/ariba/utility/transport/StreamTransport/StreamTransport.cpp	(revision 12060)
+++ source/ariba/utility/transport/StreamTransport/StreamTransport.cpp	(revision 12773)
@@ -366,5 +366,6 @@
         parent(parent),
         out_queues(8), //TODO How much priorities shall we have?
-        sending(false)
+        sending(false),
+        MAGIC_NUMBER(424242)
 {
         header.length = 0;
@@ -594,10 +595,30 @@
     bool restart_sending = false;
     
+	// FIXME Mario DEBUGGING  --  copy !!
+	reboost::shared_buffer_t buff = packet.linearize();
+	reboost::message_t msg;
+	msg.push_back(buff);
+	assert ( msg.MAGIC_NUMBER == 421337 );
+	// [ DEBUGGING ]
+	
+	
     // enqueue packet  [locked]
     {
-        unique_lock(out_queues_lock);
-        
-        assert( priority < out_queues.size() );
-        out_queues[priority].push(packet);
+        boost::mutex::scoped_lock lock(out_queues_lock);
+		
+		int debuggingA = out_queues[priority].size();
+// 		assert ( debuggingA < 1000 ); // XXX
+		
+		assert ( this->valid );
+        
+        assert( priority < out_queues.size() );  // NOTE: actual assert, not in context with the extended debugging..
+//         out_queues[priority].push(packet);  // FIXME Mario
+		out_queues[priority].push(msg);		   // FIXME Mario
+		
+		// XXX
+		int debuggingB = out_queues[priority].size();
+		int magic = out_queues[priority].back().MAGIC_NUMBER;
+		assert ( debuggingB == debuggingA + 1 );
+		assert ( magic == 421337 );
         
         if ( ! sending )
@@ -622,11 +643,27 @@
     bool found = false;
 
+	// XXX Mario: Debugging
+	if ( ! this->valid )
+	{
+		this->sending = false;
+		cout << "/// StreamConnection::send_next_package() on INVALID STREAM" << endl;
+		return;
+	}
+	
     // find packet with highest priority  [locked]
     {
-        unique_lock(out_queues_lock);
+        boost::mutex::scoped_lock lock(out_queues_lock);
+		
+		assert ( this->valid ); // XXX TODO ggf. in if (valid) Ã€ndern...
+		assert ( this->sending );
+		assert ( this->MAGIC_NUMBER == 424242 );
+		assert ( this->out_queues.size() == 8 );
         
         for ( vector<OutQueue>::iterator it = out_queues.begin();
                 it != out_queues.end(); it++ )
         {
+			int debugging = it->size();  // XXX debugging
+// 			assert ( debugging < 1000 );
+			
             if ( !it->empty() )
             {
Index: source/ariba/utility/transport/StreamTransport/StreamTransport.hpp
===================================================================
--- source/ariba/utility/transport/StreamTransport/StreamTransport.hpp	(revision 12060)
+++ source/ariba/utility/transport/StreamTransport/StreamTransport.hpp	(revision 12773)
@@ -64,5 +64,11 @@
         StreamConnection(boost::asio::io_service& io_service, StreamTransportPtr parent);
         
-        virtual ~StreamConnection() {}
+        virtual ~StreamConnection()
+		{
+			// XXX MARIO Debugging
+			std::cout << "/// ~StreamConnection(): " << this << ", SENDING: " << this->sending << ", VALID: " << this->valid << std::endl;
+			
+			assert ( this->valid == false );
+		}
         
         /// Inherited from transport_connection
@@ -127,4 +133,7 @@
         shared_buffer_t buffy;
         
+		
+		// XXX Mario: Debugging
+		const int MAGIC_NUMBER;
     private:
         std::vector<ariba::utility::LinkID*> communication_links;
Index: source/ariba/utility/transport/messages/message.hpp
===================================================================
--- source/ariba/utility/transport/messages/message.hpp	(revision 12060)
+++ source/ariba/utility/transport/messages/message.hpp	(revision 12773)
@@ -11,4 +11,5 @@
 #include<boost/shared_ptr.hpp>
 #include<cstring>
+#include <cassert>
 
 #include "shared_buffer.hpp"
@@ -68,11 +69,19 @@
 	/// Create a new message
 	inline message_t() :
-		imsg() {
+		imsg(),
+		MAGIC_IDENTIFIER("!!message_t-MAGIC_IDENTIFIER!!"), // XXX Mario: Debugging
+		MAGIC_NUMBER(421337) // XXX Mario: Debugging
+	{
 	}
 
 	/// Copy message
 	inline message_t(const message_t& msg) :
-		imsg(msg.imsg)
+		imsg(msg.imsg),
+		MAGIC_IDENTIFIER(msg.MAGIC_IDENTIFIER),  // XXX
+		MAGIC_NUMBER(msg.MAGIC_NUMBER) // XXX
+
 	{
+		assert ( msg.MAGIC_NUMBER == 421337 ); // XXX
+		
 	    if ( imsg )
 	        imsg->owner = NULL;
@@ -85,7 +94,19 @@
 
 	/// Assign another message
-	inline message_t& operator=(const message_t& msg) {
-		msg.imsg->owner = NULL;
-		imsg = msg.imsg;
+	inline message_t& operator=(const message_t& msg)
+	{
+		assert ( msg.MAGIC_NUMBER == 421337 ); // XXX
+		
+		if ( msg.imsg )
+		{
+			msg.imsg->owner = NULL;
+			imsg = msg.imsg;
+		}
+		else
+		{
+			// TODO: is this a valid state? (since it can definitely been reached...)
+			imsg.reset();
+		}
+		
 		return *this;
 	}
@@ -252,10 +273,22 @@
 		shared_buffer_t buffers[message_max_buffers];
 		mlength_t index, length;
+		
+		// XXX Mario: Debugging
+		const std::string MAGIC_IDENTIFIER;
+		const int MAGIC_NUMBER;
 	public:
 		inline imsg_t() :
-			index(0), length(0) {
+			owner(NULL),
+			index(0),
+			length(0),
+			MAGIC_IDENTIFIER("!!imsg_t-MAGIC_IDENTIFIER!!"), // XXX Mario: Debugging
+			MAGIC_NUMBER(133742)
+		{
 		}
 		inline imsg_t(const imsg_t& imsg) :
-			index(imsg.index), length(imsg.length) {
+			index(imsg.index), length(imsg.length),
+			MAGIC_IDENTIFIER(imsg.MAGIC_IDENTIFIER),  // XXX
+			MAGIC_NUMBER(imsg.MAGIC_NUMBER) // XXX
+		{
 			for (mlength_t i = 0; i < length; i++)
 				at(index + i) = imsg.at(index + i);
@@ -336,4 +369,9 @@
 	}
 	boost::shared_ptr<imsg_t> imsg;
+	
+	// XXX Mario: Debugging
+public:
+	const std::string MAGIC_IDENTIFIER;
+	const int MAGIC_NUMBER;
 };
 
