Poprawki, warunek petli http, cast long to int, delete[]