mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
port: a listening socket reserved while the configuration is read
port tcp|udp [ip:]port [socket_options] opens, binds and listens at the time the line is read, so a privileged port can be taken before setuid and chroot drop the rights to open it: a service of the configuration on the same address, of the same type, takes the socket over when it starts, instead of binding one of its own, and a port no service takes stays reserved until the configuration is left. A reservation of the configuration before holds the port over a reload: the new one shares its socket, each dropping its hold with its configuration. The socket is what the reservation made of it: the options which act only before bind() cannot follow a service's wishes on a socket already bound, so the service takes it as it is, its other options set on it. The reservation is built from the same default address a service is, so it matches in every byte a listener is compared by.
This commit is contained in:
1 parent
37dfb863fb
commit
17306f63f9
6 files changed
+316
-23
No files matched your search
+11
-3
@@ -965,9 +965,16 @@ struct threadpool {
|
||||
extern struct threadpool tpool;
|
||||
|
||||
struct filemon {
|
||||
char * path;
|
||||
struct stat sb;
|
||||
struct filemon *next;
|
||||
char * path;
|
||||
struct stat sb;
|
||||
struct filemon *next;
|
||||
};
|
||||
|
||||
/* A port the configuration reserved with the port command: its listener,
|
||||
opaque here, held until the configuration is left */
|
||||
struct portreservation {
|
||||
struct portreservation *next;
|
||||
void *listener;
|
||||
};
|
||||
|
||||
|
||||
@@ -1022,6 +1029,7 @@ struct extparam {
|
||||
int refs;
|
||||
struct hashtable pwl_table; /* users */
|
||||
int resolvmode; /* RESOLVE_*: the last read, each service taking the one read before it */
|
||||
struct portreservation *reservations; /* the port command's, dropped with the configuration */
|
||||
};
|
||||
|
||||
struct property {
|
||||
|
||||
Reference in new issue
Block a user