These functions previously operated on the assumption that fgetc() would block; however it will not block on HttpServer streams because those are non-blocking. They now check error conditions properly before failing prematurely.