3 ms·
if ( msg.total_length > MAX_ALLOWED_SIZE ) { reset_parser(); }? Should take care of any resource depletion issues, and do it way faster than eating data waitin
by m_eiman 14y ago
if ( msg.total_length > MAX_ALLOWED_SIZE ) { reset_parser(); }?
Should take care of any resource depletion issues, and do it way faster than eating data waiting for an end of field marker would.
- mcherm 14y agoBut it produces a protocol which is incapable of handling messages greater than a certain length. The marketplace is littered with such protocols, but they're all useless since they can no longer even transmit a single wordprocessing document now that a page of text takes up megabytes of overhead.
- m_eiman 14y agoIt's not every protocol that must handle arbitrary messages, that doesn't make them useless. Having a 9600 baud half duplex connection for messaging that requires low latency is quite different from 1Gbps Ethernet, and that makes every byte count.