Archive Index This month's Index

Subject: [c-ares] reinit implementation thoughts and questions

[c-ares] reinit implementation thoughts and questions

From: Nicolas Sterchele <sterchelen_at_gmail.com>
Date: Thu, 11 Jun 2020 20:48:22 +0200

Hi all,

This is would be my first contribution to the library and before starting to code, I would like to have your opinion on the following points:

I am thinking on implementing a "reinit" function based on the following closed PR (https://github.com/c-ares/c-ares/pull/272).
My main concern is to trigger a "reinit" when the content of the resolv.conf file has changed.

Ideas:
1. "ares_reinit" would be a public function, library consumers must have the possibility to trigger a reinit.
2. Is it possible to call the following functions "init_by_options", "init_by_env" or "init_by_resolv" without worrying to break
something on a channel? Would like to reuse those functions...
3. Based on the resolvconf scenario, we should call "reinit" when the file's "mtime" has changed. In order to track a change, a new variable would be added to the "ares_channeldata" struct.
3.1 Each time "ares_gethostbyname" is triggered, we should check if the file has changed (by comparing what we have in "ares_channeldata" and the actual "mtime").
4. Having c-ares to trigger a reinit by itself should be optional, the consumer of the library must be aware of that.

I look forward to have your feedback!

Nicolas.
Received on 2020-06-11