twisted / twisted

Event-driven networking engine written in Python.
https://twisted.org
Other
5.62k stars 1.18k forks source link

lineLengthExceeded behaviour varies between LineReceiver and LineOnlyReceiver #3353

Open twisted-trac opened 16 years ago

twisted-trac commented 16 years ago
spiv's avatar spiv reported
Trac ID trac#3353
Type defect
Created 2008-07-13 14:18:20Z

I'm experimenting with a patch to improve the tests for LineReceiver/LineOnlyReceiver, based on how bzrlib tests some things. Specifically, I'm applying the same test case to two different implementations of the one interface: LineOnlyReceiver and LineReceiver.

This has revealed some inconsistencies with how LineReceiver and LineOnlyReceiver handle lineLengthExceeded:

The attached patch to test_protocols shows these test failures. (This patch is relative to my patch on [#3277](https://github.com/twisted/twisted/issues/3277), but it's also a bzr merge directive with full history vs. trunk).

As mentioned in #3277, I think lineLengthExceeded isn't a fully baked API, and these inconsistencies are symptoms of that.

Attachments:

Searchable metadata ``` trac-id__3353 3353 type__defect defect reporter__spiv spiv priority__normal normal milestone__ branch__ branch_author__ status__new new resolution__None None component__core core keywords__ time__1215958700000000 1215958700000000 changetime__1246348604000000 1246348604000000 version__None None owner__ cc__ivank ```
twisted-trac commented 15 years ago
glyph's avatar @glyph set owner to spiv
twisted-trac commented 13 years ago
Automation's avatar Automation removed owner
twisted-trac commented 16 years ago
amaury's avatar amaury commented

LineOnlyReceiver.lineLengthExceeded doesn't actually call loseConnection

I think it should; is there any reason why LineOnlyReceiver and LineReceiver differ on this point?

The corresponding test has to be changed as well: the last line of testLineTooLong() could be:

self.assertTrue(a.transport.closed)