This code is copied from git@github.com:mongodb/mongo-c-driver.git version 1.25.0.
