adapted lhttpc version
removed some warnings