Closed lunkwill42 closed 8 months ago
3 files 3 suites 25s :stopwatch: 249 tests 249 :heavy_check_mark: 0 :zzz: 0 :x: 747 runs 745 :heavy_check_mark: 2 :zzz: 0 :x:
Results for commit ca9d2939.
:recycle: This comment has been updated with latest results.
Kudos, no new issues were introduced!
0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
While manually testing the protocol implementation using simple tools like telnet or netcat,
data_received()
will usually receive full text lines from the transport, as these tools typically send a packet once Enter is pressed.However,
Protocol.data_received()
will in fact receive any old piece of binary data, which can potentially come in arbitrarily sized packets, depending on the client. As demonstrated by the legacy cuRitz client, which will for example dispatch the text data associated with aADDHIST
command as one large, multiline packet: This causes the naive implementation ofdata_received()
to fail and hang forever, as the multiline input mode will be waiting for a single packet containingb'.\r\n'
before it's satisfied that input has ended.This reworks
data_received()
to employ a simple bytearray buffer of incoming data, and moves most of the message parsing logic to a new methodmessage_received()
. The latter will only receive single, full lines of protocol data as string objects, with newlines and carriage returns stripped.