forked from pool/rsync
99 lines
4.0 KiB
Diff
99 lines
4.0 KiB
Diff
diff -Naurp rsync-3.0.6pre1/clientserver.c rsync-3.0.6pre1-slp//clientserver.c
|
|
--- rsync-3.0.6pre1/clientserver.c 2009-05-05 14:24:50.000000000 +0200
|
|
+++ rsync-3.0.6pre1-slp//clientserver.c 2009-05-05 14:29:01.000000000 +0200
|
|
@@ -1065,7 +1065,7 @@ int daemon_main(void)
|
|
* local address??? */
|
|
|
|
#ifdef HAVE_LIBSLP
|
|
- if (register_services()) {
|
|
+ if (lp_use_slp() && register_services() != 0) {
|
|
rprintf(FINFO,
|
|
"Couldn't register with service discovery protocol, continuing anyway\n");
|
|
}
|
|
diff -Naurp rsync-3.0.6pre1/loadparm.c rsync-3.0.6pre1-slp//loadparm.c
|
|
--- rsync-3.0.6pre1/loadparm.c 2009-05-05 14:24:50.000000000 +0200
|
|
+++ rsync-3.0.6pre1-slp//loadparm.c 2009-05-05 14:29:01.000000000 +0200
|
|
@@ -112,6 +112,10 @@ typedef struct
|
|
#ifdef HAVE_LIBSLP
|
|
int slp_refresh;
|
|
#endif
|
|
+
|
|
+#ifdef HAVE_LIBSLP
|
|
+ BOOL use_slp;
|
|
+#endif
|
|
} global;
|
|
|
|
static global Globals;
|
|
@@ -307,6 +311,9 @@ static struct parm_struct parm_table[] =
|
|
{"slp refresh", P_INTEGER,P_GLOBAL,&Globals.slp_refresh, NULL,0},
|
|
#endif
|
|
{"socket options", P_STRING, P_GLOBAL,&Globals.socket_options, NULL,0},
|
|
+#ifdef HAVE_LIBSLP
|
|
+ {"use slp", P_BOOL, P_GLOBAL,&Globals.use_slp, NULL,0},
|
|
+#endif
|
|
|
|
{"auth users", P_STRING, P_LOCAL, &sDefault.auth_users, NULL,0},
|
|
{"charset", P_STRING, P_LOCAL, &sDefault.charset, NULL,0},
|
|
@@ -360,6 +367,7 @@ static struct parm_struct parm_table[] =
|
|
static void init_globals(void)
|
|
{
|
|
memset(&Globals, 0, sizeof Globals);
|
|
+ Globals.use_slp = True;
|
|
}
|
|
|
|
/***************************************************************************
|
|
@@ -404,6 +412,10 @@ FN_GLOBAL_INTEGER(lp_rsync_port, &Global
|
|
FN_GLOBAL_INTEGER(lp_slp_refresh, &Globals.slp_refresh)
|
|
#endif
|
|
|
|
+#ifdef HAVE_LIBSLP
|
|
+FN_GLOBAL_BOOL(lp_use_slp, &Globals.use_slp)
|
|
+#endif
|
|
+
|
|
FN_LOCAL_STRING(lp_auth_users, auth_users)
|
|
FN_LOCAL_STRING(lp_charset, charset)
|
|
FN_LOCAL_STRING(lp_comment, comment)
|
|
diff -Naurp rsync-3.0.6pre1/rsyncd.conf.yo rsync-3.0.6pre1-slp//rsyncd.conf.yo
|
|
--- rsync-3.0.6pre1/rsyncd.conf.yo 2009-05-05 14:24:50.000000000 +0200
|
|
+++ rsync-3.0.6pre1-slp//rsyncd.conf.yo 2009-05-05 14:54:01.000000000 +0200
|
|
@@ -104,6 +104,10 @@ details on some of the options you may b
|
|
special socket options are set. These settings can also be specified
|
|
via the bf(--sockopts) command-line option.
|
|
|
|
+dit(bf(use slp)) This parameter is used to determine if the module names are
|
|
+advertised via slp. The default is for this to be enabled, which will
|
|
+advertise your public modules.
|
|
+
|
|
dit(bf(slp refresh)) This parameter is used to determine how long service
|
|
advertisements are valid (measured in seconds), and is only applicable if
|
|
you have Service Location Protocol support compiled in. If this is
|
|
diff -Naurp rsync-3.0.6pre1/rsyncd.conf.5 rsync-3.0.6pre1-slp//rsyncd.conf.5
|
|
--- rsync-3.0.6pre1/rsyncd.conf.5 2009-05-05 14:24:50.000000000 +0200
|
|
+++ rsync-3.0.6pre1-slp//rsyncd.conf.5 2009-05-05 14:55:31.000000000 +0200
|
|
@@ -121,7 +121,12 @@ details on some of the options you may b
|
|
special socket options are set. These settings can also be specified
|
|
via the \fB\-\-sockopts\fP command-line option.
|
|
.IP
|
|
-.IP "\fBslp refresh\fP"
|
|
+.IP "\fBuse slp\fP"
|
|
+This parameter is used to determine if the module names are
|
|
+advertised via slp. The default is for this to be enabled, which will
|
|
+advertise your public modules.
|
|
+.IP
|
|
+.IP "\fBslp refresh\fP"
|
|
This parameter is used to determine how long service
|
|
advertisements are valid (measured in seconds), and is only applicable if
|
|
you have Service Location Protocol support compiled in. If this is
|
|
diff -Naurp rsync-3.0.6pre1/socket.c rsync-3.0.6pre1-slp//socket.c
|
|
--- rsync-3.0.6pre1/socket.c 2009-05-05 14:24:50.000000000 +0200
|
|
+++ rsync-3.0.6pre1-slp//socket.c 2009-05-05 14:29:01.000000000 +0200
|
|
@@ -532,7 +532,7 @@ void start_accept_loop(int port, int (*f
|
|
int *sp, maxfd, i;
|
|
#ifdef HAVE_LIBSLP
|
|
time_t next_slp_refresh;
|
|
- short slp_timeout = lp_slp_refresh();
|
|
+ short slp_timeout = lp_use_slp() ? lp_slp_refresh() : 0;
|
|
if (slp_timeout) {
|
|
if (slp_timeout < SLP_MIN_TIMEOUT)
|
|
slp_timeout = SLP_MIN_TIMEOUT;
|