[ovs-dev] [PATCH v2] python: Fix decoding error when the received data is larger than 4096.

Guoshuai Li ligs at dtdream.com
Mon Feb 26 06:02:05 UTC 2018


> On Sun, Feb 18, 2018 at 08:51:16PM +0800, Guoshuai Li wrote:
>> It can only receive 4096 bytes of data each time in jsonrpc,
>> when there are similar and Chinese characters occupy multiple bytes,
>> it may receive half a character, this time the decoding will be abnormal.
>> We need to receive the completed character to decode.
>>
>> Signed-off-by: Guoshuai Li <ligs at dtdream.com>
> Thanks for finding and fixing the problem.
>
> I am worried that, with this patch, any genuine encoding errors will be
> ignored.  For example, bytes 0xc0 and 0xc1 never appear in a valid UTF-8
> sequence, yet I believe that this code will silently ignore them, along
> with whatever other data appears along with them.  Do you have an idea
> for how to deal with that?
>
> Thanks,
>
> Ben.

Hello Ben

I sent a new version:
https://mail.openvswitch.org/pipermail/ovs-dev/2018-February/344705.html
But I am not satisfied with it.
This patch can not solve the received data length is exactly a multiple 
of 4096, and with 0xc0 and 0xc1.
I do not know how to judge that I have received all the data.
I think I need more people's help.

Thanks~!





More information about the dev mailing list