[telepathy-gabble/master] add BytestreamS5BRelayBugged

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Apr 3 08:41:33 PDT 2009


---
 tests/twisted/bytestream.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tests/twisted/bytestream.py b/tests/twisted/bytestream.py
index 757872c..08bc33a 100644
--- a/tests/twisted/bytestream.py
+++ b/tests/twisted/bytestream.py
@@ -517,6 +517,14 @@ class BytestreamS5BRelay(BytestreamS5B):
     def wait_bytestream_closed(self):
         pass
 
+
+class BytestreamS5BRelayBugged(BytestreamS5BRelay):
+    """Simulate bugged ejabberd (< 2.0.2) proxy sending wrong CONNECT reply"""
+    def _send_connect_reply(self):
+        # send a 6 bytes wrong reply
+        connect_reply = '\x05\x00\x00\x00\x00\x00'
+        self.transport.write(connect_reply)
+
 class S5BProtocol(Protocol):
     def connectionMade(self):
         self.factory.event_func(Event('s5b-connected',
-- 
1.5.6.5




More information about the telepathy-commits mailing list