mirror of
https://github.com/SwallowOS/xorg_lib_libxtrans
synced 2025-11-03 21:42:11 +08:00
Add TRANS(Listen) function to re-enable specific listen sockets
This will allow a server to disable listeners by default and then let later configuration re-enable them. In particular, this lets the X server disable inet and unix listen sockets by default while still providing a '-listen' command line option to re-enable them later on. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
25
Xtrans.c
25
Xtrans.c
@@ -803,6 +803,31 @@ TRANS(NoListen) (const char * protocol)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
TRANS(Listen) (const char * protocol)
|
||||
{
|
||||
Xtransport *trans;
|
||||
int i = 0, ret = 0;
|
||||
|
||||
if ((trans = TRANS(SelectTransport)(protocol)) == NULL)
|
||||
{
|
||||
prmsg (1,"TransListen: unable to find transport: %s\n",
|
||||
protocol);
|
||||
|
||||
return -1;
|
||||
}
|
||||
if (trans->flags & TRANS_ALIAS) {
|
||||
if (trans->nolisten)
|
||||
while (trans->nolisten[i]) {
|
||||
ret |= TRANS(Listen)(trans->nolisten[i]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
trans->flags &= ~TRANS_NOLISTEN;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
TRANS(IsListening) (const char * protocol)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user