fix bug in http_functs.cpp