added a "socket options" option to rsyncd.conf. This option will
authorAndrew Tridgell <tridge@samba.org>
Fri, 15 May 1998 13:25:19 +0000 (13:25 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 15 May 1998 13:25:19 +0000 (13:25 +0000)
provide hours of fun for those people who like to tune their systems
to the utmost degree.

clientserver.c
loadparm.c
rsyncd.conf.yo
socket.c

index 121252b..3647718 100644 (file)
@@ -271,6 +271,8 @@ static int start_daemon(int fd)
        }
 
        set_socket_options(fd,"SO_KEEPALIVE");
+       set_socket_options(fd,lp_socket_options());
+       
 
        io_printf(fd,"@RSYNCD: %d\n", PROTOCOL_VERSION);
 
index 482b41b..a302f46 100644 (file)
@@ -101,6 +101,7 @@ typedef struct
        char *lock_file;
        int syslog_facility;
        int max_connections;
+       char *socket_options;
 } global;
 
 static global Globals;
@@ -230,6 +231,7 @@ static struct parm_struct parm_table[] =
   {"motd file",        P_STRING,  P_GLOBAL, &Globals.motd_file,    NULL,   0},
   {"lock file",        P_STRING,  P_GLOBAL, &Globals.lock_file,    NULL,   0},
   {"syslog facility",  P_ENUM,    P_GLOBAL, &Globals.syslog_facility, enum_facilities,0},
+  {"socket options",   P_STRING,  P_GLOBAL, &Globals.socket_options,NULL,  0},
 
   {"name",             P_STRING,  P_LOCAL,  &sDefault.name,        NULL,   0},
   {"comment",          P_STRING,  P_LOCAL,  &sDefault.comment,     NULL,   0},
@@ -294,8 +296,10 @@ static void init_locals(void)
 
 FN_GLOBAL_STRING(lp_motd_file, &Globals.motd_file)
 FN_GLOBAL_STRING(lp_lock_file, &Globals.lock_file)
+FN_GLOBAL_STRING(lp_socket_options, &Globals.socket_options)
 FN_GLOBAL_INTEGER(lp_max_connections, &Globals.max_connections)
 FN_GLOBAL_INTEGER(lp_syslog_facility, &Globals.syslog_facility)
+
 FN_LOCAL_STRING(lp_name, name)
 FN_LOCAL_STRING(lp_comment, comment)
 FN_LOCAL_STRING(lp_path, path)
index 8b741b0..05994f9 100644 (file)
@@ -99,6 +99,13 @@ ftp, kern, lpr, mail, news, security, syslog, user, uucp, local0,
 local1, local2, local3, local4, local5, local6 and local7. The default
 is daemon. 
 
+dit(bf(socket options)) This option can provide endless fun for people
+who like to tune their systems to the utmost degree. You can set all
+sorts of socket options which may make transfers faster (or
+slower!). Read the man page for the setsockopt() system call for
+details on some of the options you may be able to set. By default no
+special socket options are set.
+
 enddit()
 
 
index 27260a1..3c876ed 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -216,6 +216,8 @@ set user socket options
 void set_socket_options(int fd, char *options)
 {
        char *tok;
+       if (!options || !*options) return;
+
        options = strdup(options);
        
        if (!options) out_of_memory("set_socket_options");