CLD: use "auto" keyword
PATCH 1/3 CLD: use "auto" keyword
The current implementation of automatic listening ports was configured implicitly by adding <PortFile> clause. This turned out to be a silly idea. A special keyword for <Port> is more convenient. See how much nicer the test/start-daemon script looks now.
The configuration is not strictly speaking compatible, but since nobody should be using auto ports in production anyway, impact on installations should be nil. Builds are interdependent though.
server/cld.h +1 -2
@@ -112,9 +112,8 @@ struct server {char *pid_file;/* PID file */ int pid_fd; -char *port;/* bind port */ +char *port;/* bind port, NULL means auto */ char *port_file;/* Port file to write */ -bool port_set;struct cldb cldb;/* database info */
server/server.c +36 -21
121 lines not on this page · raw message
test/start-daemon +2 -4
@@ -7,11 +7,9 @@ then fi ## Static port -# cldport=18181 -# echo $cldport > cld.port -# ../server/cld -P cld.pid -d "$PWD/data" -p $cldport -E +# ../server/cld -P cld.pid -d "$PWD/data" -p 18181 --port-file=cld.port -E ## Dynamic port -../server/cld -P cld.pid -d "$PWD/data" --port-file=cld.port -E +../server/cld -P cld.pid -d "$PWD/data" -p auto --port-file=cld.port -E sleep 3
Jeff Garzik
AppliedQuoted 10 lines · Pete Zaitcev
The current implementation of automatic listening ports was configured implicitly by adding<PortFile> clause. This turned out to be a silly idea. A special keyword for<Port> is more convenient. See how much nicer the test/start-daemon script looks now.
The configuration is not strictly speaking compatible, but since nobody should be using auto ports in production anyway, impact on installations should be nil. Builds are interdependent though.
Signed-off-by Pete Zaitcev<[email protected]>
applied