This series is composed of 3 preparatory patches related to the on_disconnect() callback, which then allows us to make flush_commands() in red-worker.c simpler. The first one is the bigger one, but is mostly code movement. Christophe