orlyatomics/orly — pull request #123 by cmaloney (2014-06-18 00:22:26+00:00)
Title: Websockets: Add 'get_source' command

This adds a 'get_source' command.

While implementing I noticed in some cases we didn't generate proper JSON (Particularly when an exception happens). The always return valid json fixes this.

In all of this I add two utility functions.

1. AsStr() which captures our oft-repeated ostringstream oss; oss << foo; return oss.str() pattern. Over time things should migrate to the non-member AsStr() rather than the member AsStr() functions which do the same thing.
2. ReadAll() which takes an Fd and reads all the data in from it.

@mpark: Do what you