Console: Bad net protocol

Bug #492429 reported by Nick Chadwick
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
IVLE
Fix Released
Medium
David Coles

Bug Description

Console (and wherever else we use a custom non-HTTP socket connection
protocol) has an issue.

We simply loop and read all bytes till there are no bytes left in the pipe,
and assume that's the end of the message.

What happens if some bytes are written and there is a delay? We should be
waiting for the rest of the message.

What happens if two messages come at the same time? We should stop after
the first one and read the second.

We can fix this in two ways. Firstly, we could attach a length to the front
of the message. Secondly, if it's always a JSON dictionary, we could read
until we see a '}' character outside of a string. The second way is pretty
messy so I advocate length field.

Revision history for this message
Nick Chadwick (chadnickbok) wrote :

Date: 2008-02-28 18:31
mattgiuca says:
'Tom what does chat do now? Is it a good citizen?

Lowering this priority to 3, but it may actually be fixed or unnecessary.'

Date: 2008-02-28 18:35
drtomc says:
'We should attach a length.'

Revision history for this message
David Coles (dcoles) wrote :

Chat now talks uses Netstrings (http://en.wikipedia.org/wiki/Netstrings) - basically just prepending a length to the message. Fixed when we noticed it was causing issues for very long messages.

Changed in ivle:
milestone: none → 1.0
assignee: nobody → David Coles (dcoles)
status: Triaged → Fix Committed
William Grant (wgrant)
Changed in ivle:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.