sync with upstream avhttp