Accounts e-mail HP

GT's chat buffer increased to 1436 bytes

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.

GT's chat buffer increased to 1436 bytes

Postby Davide » Tue May 14, 2013 8:45 am

KG reported me that when he typed very long messages into GT's chat the server would disconnect him for half a minute.
That sounds like a curious symptom to investigate at. I found out that freeciv's chat messages are capped at a size of 1536 bytes, which is meant to exactly fit into a single TCP packet. The problem resided in the GT script / binary interface, which was configured to accept payloads into a buffer limited to 1024 bytes. So, when a text message longer that 1024 characters was fired into the chat console, the freeciv-server binary would segfault instantly and get restarted after some seconds by a watchdog, causing a temporary disconnection of the user lasting about those 30 seconds reported by KG.

I have increased the interface buffer to 4096 bytes, which provide the full space for a 1536-bytes chat message, which is anyway internally capped at 1436 because of overhead transporting the message's headers (defined to 100 bytes).

So this solves the problem.. Happy chatting :)
User avatar
Posts: 864
Joined: Sat Mar 24, 2012 12:34 am

Return to General discussion

Who is online

Users browsing this forum: No registered users and 2 guests