minor optimizations in http_get_hostpath()