lua: honour size argument in recv() function
authorJo-Philipp Wich <jo@mein.io>
Wed, 24 Jan 2018 18:45:00 +0000 (19:45 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 24 Jan 2018 19:19:59 +0000 (20:19 +0100)
commitdb86175c2d90ba640b158e8eebd7409227544c4b
tree7bb6ccbedfbdbee93d41ebf23260569e90362f26
parenta235636a2687fafb9c474e4b134a59ff66425c92
lua: honour size argument in recv() function

The existing implementation incorrectly attempted to read the entire stdin
instead of fetching at most the given amount of bytes.

While we're at it, also make the size argument optional and let it default
to Luas internal buffer size.

Suggested-by: Bryan Mayland <bmayland+lede@capnbry.net>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
lua.c