Modified because last commit for htsp_server.c had some changes missing