Readapt the patch from #3803


git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/branches/linereceiver-complexity-6357@37887 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb