add http_keep_alive flag, plus minor cosmetic changes