Skip to content
Snippets Groups Projects
  1. Jun 28, 2017
  2. Jun 26, 2017
  3. Sep 29, 2016
  4. Sep 27, 2016
  5. Sep 26, 2016
  6. Sep 24, 2016
    • David Drysdale's avatar
      api: add ARES_OPT_NOROTATE optmask value · dd7a9bc8
      David Drysdale authored
      Fix up a couple of problems with configuring whether c-ares rotates
      between different name servers between requests.
      
      Firstly, ares_save_options() returns (in *optmask) the value of
      (channel->optmask & ARES_OPT_ROTATE), which doesn't necessarily
      indicate whether the channel is or is not actually doing rotation.
      This can be confusing/incorrect if:
       - the channel was originally configured without ARES_OPT_ROTATE
         (so it appears that the channel is not rotating)
       - the /etc/resolv.conf file includes the 'rotate' option
         (so the channel is actually performing rotation).
      
      Secondly, it is not possible to reliably configure a channel
      to not-rotate; leaving off ARES_OPT_ROTATE is not enough, since
      a 'rotate' option in /etc/resolv.conf will turn it on again.
      
      Therefore:
       - add an ARES_OPT_NOROTATE optmask value to allow explicit
         configuration of no-rotate behaviour
       - in ares_save_options(), report the value of channel->rotate
         as exactly one of (optmask & ARES_OPT_ROTATE) or
         (optmask & ARES_OPT_NOROTATE).
      
      In terms of back-compatibility:
       - existing apps that set ARES_OPT_ROTATE will continue to rotate,
         and to have ARES_OPT_ROTATE reported back from ares_save_options()
       - existing apps that don't set ARES_OPT_ROTATE will continue to
         use local config/defaults to decide whether to rotate, and will
         now get ARES_OPT_ROTATE or ARES_OPT_NOROTATE reported back from
         ares_save_options() rather than 0.
      dd7a9bc8
    • David Drysdale's avatar
      ares_init_options: only propagate init failures from options · 55bbe926
      David Drysdale authored
      Commit 46bb820b ("ares_init_options: don't lose init failure")
      changed init behaviour so that earlier errors in initialization
      weren't lost.  In particular, if the user passes in specific
      options but they are not applied (e.g. because of an allocation
      failure), that failure needs to be reported back to the user; this
      also applies when duplicating a channel with ares_dup().
      
      However, other initialization failures can be ignored and
      overridden -- in particular, if init_by_resolv_conf() or
      init_by_environment() fail, then falling back to default values
      is OK.
      
      So only preserve failures from the init_by_options() stage, not
      from all initialization stages.
      
      Fixes issue 60.
      55bbe926
  7. Sep 23, 2016
  8. Aug 21, 2016
  9. Aug 19, 2016
  10. Aug 17, 2016
  11. Aug 16, 2016
Loading