-
Notifications
You must be signed in to change notification settings - Fork 13
fake ares
I've implemented and posted to the CURL team some patches allowing to have a custom asynchronous name resolver linked to the CURL library.
Unfortunately, I've noticed that my patches posted to the CURL team was not applied to the CURL sources, so they either was rejected, or not interesting for CURL developers, so I need to find another way to embed s3eInetLookup resolver into the CURL. I've found a way and implemented it.
Now the custom asynchronous resolver is implemented as a replacement for the c-ares library which is able to be linked to the CURL as an option. As a result, the CURL library uses my replacement, and passes all resolving jobs to it.
Inside a replacement, I've organized some kind of two-dimentional queue of resolving queries to imitate c-ares behaviour. Really resolving jobs are evaluated one-by-one (as an only available option of the s3eInetLookup call), but never block the main thread because of using callbacks.
I am going to implement build option to select, whether the replacement, or the original c-ares library also ported for the AirplaySDK, should be linked against libcurl. Note that the original c-ares port always uses Google public DNS server at 8.8.8.8 and can not use internal DNS features of the hosting device.