self.in_send_message seems like a potential source of bugs (can't see it being set to False on all branches here) and is also likely unnecessary.
General advice: 1. Simplify, simplify, simplify. 2. Unit tests (see https://twistedmatrix.com/documents/current/core/howto/trial.html).
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python