double json_value buffer size and add error messages in sock_connect()