The patches for 3.3.0.
[rsync-patches.git] / congestion.diff
index d00373157154e15dd07db1001feace9715ceaad7..3049959e30cdbc59481b51243afceecd0f4b575d 100644 (file)
@@ -27,87 +27,30 @@ To use this patch, run these commands for a successful build:
     ./configure                         (optional if already run)
     make
 
-based-on: abef92c03767d0c5dc9070eba15805f0f7075e6c
-diff --git a/loadparm.c b/loadparm.c
---- a/loadparm.c
-+++ b/loadparm.c
-@@ -121,6 +121,7 @@ typedef struct {
-       char *auth_users;
-       char *charset;
-       char *comment;
-+      char *congestion_alg;
-       char *dont_compress;
-       char *exclude;
-       char *exclude_from;
-@@ -149,6 +150,7 @@ typedef struct {
-       BOOL auth_users_EXP;
-       BOOL charset_EXP;
-       BOOL comment_EXP;
-+      BOOL congestion_alg_EXP;
-       BOOL dont_compress_EXP;
-       BOOL exclude_EXP;
-       BOOL exclude_from_EXP;
-@@ -173,6 +175,7 @@ typedef struct {
-       BOOL temp_dir_EXP;
-       BOOL uid_EXP;
+based-on: 6c8ca91c731b7bf2b081694bda85b7dadc2b7aff
+diff --git a/daemon-parm.txt b/daemon-parm.txt
+--- a/daemon-parm.txt
++++ b/daemon-parm.txt
+@@ -18,6 +18,7 @@ Locals: =================================================================
+ STRING        auth_users              NULL
+ STRING        charset                 NULL
+ STRING        comment                 NULL
++STRING        congestion_alg          NULL
+ STRING        dont_compress           DEFAULT_DONT_COMPRESS
+ STRING        early_exec              NULL
+ STRING        exclude                 NULL
+@@ -45,6 +46,7 @@ STRING       uid                     NULL
+ PATH  path                    NULL
+ PATH  temp_dir                NULL
  
-+      int diffserv;
-       int max_connections;
-       int max_verbosity;
-       int syslog_facility;
-@@ -235,6 +238,7 @@ static const all_vars Defaults = {
-  /* auth_users; */            NULL,
-  /* charset; */               NULL,
-  /* comment; */               NULL,
-+ /* congestion_alg; */                NULL,
-  /* dont_compress; */         DEFAULT_DONT_COMPRESS,
-  /* exclude; */                       NULL,
-  /* exclude_from; */          NULL,
-@@ -262,6 +266,7 @@ static const all_vars Defaults = {
-  /* auth_users_EXP; */                False,
-  /* charset_EXP; */           False,
-  /* comment_EXP; */           False,
-+ /* congestion_alg_EXP; */    False,
-  /* dont_compress_EXP; */     False,
-  /* exclude_EXP; */           False,
-  /* exclude_from_EXP; */      False,
-@@ -286,6 +291,7 @@ static const all_vars Defaults = {
-  /* temp_dir_EXP; */          False,
-  /* uid_EXP; */                       False,
-+ /* diffserv; */              8,
-  /* max_connections; */               0,
-  /* max_verbosity; */         1,
-  /* syslog_facility; */               LOG_DAEMON,
-@@ -403,6 +409,8 @@ static struct parm_struct parm_table[] =
-  {"auth users",        P_STRING, P_LOCAL, &Vars.l.auth_users,          NULL,0},
-  {"charset",           P_STRING, P_LOCAL, &Vars.l.charset,             NULL,0},
-  {"comment",           P_STRING, P_LOCAL, &Vars.l.comment,             NULL,0},
-+ {"congestion alg",    P_STRING, P_LOCAL, &Vars.l.congestion_alg,      NULL,0},
-+ {"diffserv",          P_INTEGER,P_LOCAL, &Vars.l.diffserv,            NULL,0},
-  {"dont compress",     P_STRING, P_LOCAL, &Vars.l.dont_compress,       NULL,0},
-  {"exclude from",      P_STRING, P_LOCAL, &Vars.l.exclude_from,        NULL,0},
-  {"exclude",           P_STRING, P_LOCAL, &Vars.l.exclude,             NULL,0},
-@@ -542,6 +550,7 @@ FN_GLOBAL_INTEGER(lp_rsync_port, rsync_port)
- FN_LOCAL_STRING(lp_auth_users, auth_users)
- FN_LOCAL_STRING(lp_charset, charset)
- FN_LOCAL_STRING(lp_comment, comment)
-+FN_LOCAL_STRING(lp_congestion_alg, congestion_alg)
- FN_LOCAL_STRING(lp_dont_compress, dont_compress)
- FN_LOCAL_STRING(lp_exclude, exclude)
- FN_LOCAL_STRING(lp_exclude_from, exclude_from)
-@@ -566,6 +575,7 @@ FN_LOCAL_STRING(lp_syslog_tag, syslog_tag)
- FN_LOCAL_STRING(lp_temp_dir, temp_dir)
- FN_LOCAL_STRING(lp_uid, uid)
-+FN_LOCAL_INTEGER(lp_diffserv, diffserv)
- FN_LOCAL_INTEGER(lp_max_connections, max_connections)
- FN_LOCAL_INTEGER(lp_max_verbosity, max_verbosity)
- FN_LOCAL_INTEGER(lp_syslog_facility, syslog_facility)
++INTEGER       diffserv                8
+ INTEGER       max_connections         0
+ INTEGER       max_verbosity           1
+ INTEGER       timeout                 0
 diff --git a/options.c b/options.c
 --- a/options.c
 +++ b/options.c
-@@ -74,6 +74,8 @@ int delete_during = 0;
+@@ -79,6 +79,8 @@ int delete_during = 0;
  int delete_before = 0;
  int delete_after = 0;
  int delete_excluded = 0;
@@ -116,17 +59,8 @@ diff --git a/options.c b/options.c
  int remove_source_files = 0;
  int one_file_system = 0;
  int protocol_version = PROTOCOL_VERSION;
-@@ -807,6 +809,8 @@ void usage(enum logcode F)
-   rprintf(F,"     --address=ADDRESS       bind address for outgoing socket to daemon\n");
-   rprintf(F,"     --port=PORT             specify double-colon alternate port number\n");
-   rprintf(F,"     --sockopts=OPTIONS      specify custom TCP options\n");
-+  rprintf(F,"     --diffserv=[0-63]       specify diffserv setting \n");
-+  rprintf(F,"     --congestion-alg=STRING choose a congestion algo\n");
-   rprintf(F,"     --blocking-io           use blocking I/O for the remote shell\n");
-   rprintf(F,"     --stats                 give some file-transfer stats\n");
-   rprintf(F," -8, --8-bit-output          leave high-bit chars unescaped in output\n");
-@@ -1080,6 +1084,8 @@ static struct poptOption long_options[] = {
- #endif
+@@ -832,6 +834,8 @@ static struct poptOption long_options[] = {
+   {"outbuf",           0,  POPT_ARG_STRING, &outbuf_mode, 0, 0, 0 },
    {"remote-option",   'M', POPT_ARG_STRING, 0, 'M', 0, 0 },
    {"protocol",         0,  POPT_ARG_INT,    &protocol_version, 0, 0, 0 },
 +  {"congestion-alg",   0,  POPT_ARG_STRING, &congestion_alg, 0, 0, 0 },
@@ -134,22 +68,25 @@ diff --git a/options.c b/options.c
    {"checksum-seed",    0,  POPT_ARG_INT,    &checksum_seed, 0, 0, 0 },
    {"server",           0,  POPT_ARG_NONE,   0, OPT_SERVER, 0, 0 },
    {"sender",           0,  POPT_ARG_NONE,   0, OPT_SENDER, 0, 0 },
-@@ -1107,6 +1113,8 @@ static void daemon_usage(enum logcode F)
-   rprintf(F,"     --log-file=FILE         override the \"log file\" setting\n");
-   rprintf(F,"     --log-file-format=FMT   override the \"log format\" setting\n");
-   rprintf(F,"     --sockopts=OPTIONS      specify custom TCP options\n");
-+  rprintf(F,"     --diffserv=[0-63]       specify diffserv setting \n");
-+  rprintf(F,"     --congestion-alg=STRING choose a congestion algo\n");
-   rprintf(F," -v, --verbose               increase verbosity\n");
-   rprintf(F," -4, --ipv4                  prefer IPv4\n");
-   rprintf(F," -6, --ipv6                  prefer IPv6\n");
+diff --git a/rsync.1.md b/rsync.1.md
+--- a/rsync.1.md
++++ b/rsync.1.md
+@@ -531,6 +531,8 @@ has its own detailed description later in this manpage.
+ --address=ADDRESS        bind address for outgoing socket to daemon
+ --port=PORT              specify double-colon alternate port number
+ --sockopts=OPTIONS       specify custom TCP options
++--diffserv=[0-63]        specify diffserv setting
++--congestion-alg=STRING  choose a congestion algo
+ --blocking-io            use blocking I/O for the remote shell
+ --outbuf=N|L|B           set out buffering to None, Line, or Block
+ --stats                  give some file-transfer stats
 diff --git a/socket.c b/socket.c
 --- a/socket.c
 +++ b/socket.c
-@@ -38,6 +38,8 @@ extern char *bind_address;
- extern char *sockopts;
+@@ -40,6 +40,8 @@ extern char *sockopts;
  extern int default_af_hint;
  extern int connect_timeout;
+ extern int pid_file_fd;
 +extern int diffserv;
 +extern char *congestion_alg;
  
@@ -193,7 +130,7 @@ diff --git a/socket.c b/socket.c
  /* Open a socket to a tcp remote host with the specified port.
   *
   * Based on code from Warren.  Proxy support by Stephen Rothwell.
-@@ -275,6 +308,7 @@ int open_socket_out(char *host, int port, const char *bind_addr,
+@@ -272,6 +305,7 @@ int open_socket_out(char *host, int port, const char *bind_addr, int af_hint)
                        alarm(connect_timeout);
                }
  
@@ -201,7 +138,7 @@ diff --git a/socket.c b/socket.c
                set_socket_options(s, sockopts);
                while (connect(s, res->ai_addr, res->ai_addrlen) < 0) {
                        if (connect_timeout < 0)
-@@ -449,6 +483,7 @@ static int *open_socket_in(int type, int port, const char *bind_addr,
+@@ -440,6 +474,7 @@ static int *open_socket_in(int type, int port, const char *bind_addr,
                        continue;
                }