Code extracted from: https://github.com/bagder/curl.git at commit 1a7f66a3de2625d10f65415e6eb3e56067dc0555 (curl-7_44_0).