You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
filters: Use context rather than connection to track c_next
This is another API/ABI change to filters, but that doesn't matter.
Instead of having a 1:1 correspondence of automatic backend context to
the current connection (which means filters.c has to consult GET_CONN
on every action), switch things so that a given context tracks the
next context. This requires another signature change to the internal
backend_open and backend_reopen functions, as well as a public change
to the type of the argument handed to filter .open calls. A given
connection now only needs to track the top_context, and we no longer
need get_context()/set_context(). Internally, nbdkit_context and
nbdkit_next are the same type, but the public interface for filters
keeps them separate for type-safety reasons (assigning a backend
handle to the current filter's context is different than calling into
the backend via next_ops/nxdata as the backend's context).
A few filters were already using the typedef name 'nbdkit_backend *'
instead of 'void *'; while they would still compile as-is, updating
their type makes it look nicer. A later patch will force type-safety
on all the remaining filters, but it's better to save that mechanical
churn separately from this ABI change. Also, with this in place, an
upcoming patch can finally allow filters to open up a context
independently of the current client connection.
0 commit comments