FAForever / server

The servercode for the Forged Alliance Forever lobby

Home Page:http://www.faforever.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Messages using SimpleJsonProtocol are limited to 64 KiB (LimitOverrunError)

Askaholic opened this issue · comments

The default limit for StreamReader.readline is to stop after 64 KiB. It seems that this limit is sometimes being reached:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/streams.py", line 540, in readline
    line = await self.readuntil(sep)
  File "/usr/local/lib/python3.9/asyncio/streams.py", line 635, in readuntil
    raise exceptions.LimitOverrunError(
asyncio.exceptions.LimitOverrunError: Separator is found, but chunk is longer than limit

This probably never happened with the QDataStream protocol because it doesn't use readline, instead implementing the message deserialization in python using readexactly.

There are some messages that the client sends which can be pretty large, in particular the GameStats message contains a large JSON structure which can probably exceed the 64 KiB limit. We probably need to increase that limit to something much higher.

We don't seem to have encountered this error for quite some time now, so I'm closing this issue.