CO_FL_IDLE_LIST = 0x00000002, /* 2 = in idle_list, 3 = invalid */
CO_FL_LIST_MASK = 0x00000003, /* Is the connection in any server-managed list ? */
- /* unused : 0x00000004, 0x00000008 */
+ CO_FL_REVERSED = 0x00000004, /* connection has been reversed but not yet accepted */
+ /* unused : 0x00000008 */
/* unused : 0x00000010 */
/* unused : 0x00000020 */
/* Reverse a <conn> connection instance. This effectively moves the connection
* from frontend to backend side or vice-versa depending on its initial status.
*
+ * For active reversal, 'reverse' member points to the listener used as the new
+ * connection target. Once transition is completed, the connection needs to be
+ * accepted on the listener to instantiate its parent session before using
+ * streams.
+ *
* For passive reversal, 'reverse' member points to the server used as the new
* connection target. Once transition is completed, the connection appears as a
* normal backend connection.
conn_set_owner(conn, NULL, NULL);
}
else {
- ABORT_NOW();
+ conn_backend_deinit(conn);
+
+ conn->target = conn->reverse.target;
+ conn->flags |= CO_FL_REVERSED;
}
/* Invert source and destination addresses if already set. */