Mostly made changes to allow client_gets to handle reading a buffer