void (*accept)(int fd); /* generic accept function */
int (*listen)(struct listener *l, char *errmsg, int errlen); /* start a listener */
int (*enable_all)(struct protocol *proto); /* enable all bound listeners */
- int (*disable_all)(struct protocol *proto); /* disable all bound listeners */
int (*connect)(struct connection *, int flags); /* connect function if any, see below for flags values */
int (*drain)(int fd); /* indicates whether we can safely close the fd */
int (*pause)(struct listener *l); /* temporarily pause this listener for a soft restart */
.connect = &sockpair_connect_server,
.listen = sockpair_bind_listener,
.enable_all = enable_all_listeners,
- .disable_all = disable_all_listeners,
.pause = NULL,
.add = sockpair_add_listener,
.listeners = LIST_HEAD_INIT(proto_sockpair.listeners),
.connect = &uxst_connect_server,
.listen = uxst_bind_listener,
.enable_all = enable_all_listeners,
- .disable_all = disable_all_listeners,
.pause = uxst_pause_listener,
.add = uxst_add_listener,
.listeners = LIST_HEAD_INIT(proto_unix.listeners),
return err;
}
-/* disables all listeners of all registered protocols. This may be used before
- * a fork() to avoid duplicating poll lists. Returns a composition of ERR_NONE,
- * ERR_RETRYABLE, ERR_FATAL.
- */
-int protocol_disable_all(void)
-{
- struct protocol *proto;
- int err;
-
- err = 0;
- HA_SPIN_LOCK(PROTO_LOCK, &proto_lock);
- list_for_each_entry(proto, &protocols, list) {
- if (proto->disable_all) {
- err |= proto->disable_all(proto);
- }
- }
- HA_SPIN_UNLOCK(PROTO_LOCK, &proto_lock);
- return err;
-}
-
/*
* Local variables:
* c-indent-level: 8