implement close, imporve bytes_download()

Signed-off-by: Jack <jack.wgm@gmail.com>