Skip to content
  • Evan Hunt's avatar
    enable modules to store data in qctx · 81f58e2e
    Evan Hunt authored
    - added a 'hookdata' array to qctx to store pointers to up to
      16 blobs of data which are allocated by modules as needed.
      each module is assigned an ID number as it's loaded, and this
      is the index into the hook data array. this is to be used for
      holding persistent state between calls to a hook module for a
      specific query.
    - instead of using qctx->filter_aaaa, we now use qctx->hookdata.
      (this was the last piece of filter-aaaa specific code outside the
      module.)
    - added hook points for qctx initialization and destruction. we get
      a filter-aaaa data pointer from the mempool when initializing and
      store it in the qctx->hookdata table; return to to the mempool
      when destroying the qctx.
    - link the view to the qctx so that detaching the client doesn't cause
      hooks to fail
    - added a qctx_destroy() function which must be called after qctx_init;
      this calls the QCTX_DESTROY hook and detaches the view
    - general cleanup and comments
    81f58e2e