News for hackers. Stuff that matters.
Re:Mongrel2 v1.6 Released by zedshaw on Thursday May 12, 2011 @03:31PM (#2541990)
Yep, you have to anyway. It's to prevent buffer overflows so that you can't "cheat" and try to stream it. You have to read it, allocate, then save it. It also means you can abort after just reading the size and ':' if it's too big. Rather than designing your protocol to allow insane buffer sizes to "stream", just have things send reasonable easily buffered chunks. That's more reliable and easier to manage.

The other reason was so it was backward compatible with netstrings. The : was already used by netstrings, but the ',' wasn't so overloading that was easiest.

There are no comments on this comment yet.