[http] Fix bug when downloading encrypted files.
Fix some compile warnings.