The patches for 3.3.0.
[rsync-patches.git] / congestion.diff
index 079cabd6cc365735d339a932b95de06f49a4a566..3049959e30cdbc59481b51243afceecd0f4b575d 100644 (file)
@@ -27,71 +27,30 @@ To use this patch, run these commands for a successful build:
     ./configure                         (optional if already run)
     make
 
-based-on: f8d2ecd223eedabdf3174762b64c77cb01cc403b
-diff --git a/loadparm.c b/loadparm.c
---- a/loadparm.c
-+++ b/loadparm.c
-@@ -109,6 +109,7 @@ typedef struct {
-       char *auth_users;
-       char *charset;
-       char *comment;
-+      char *congestion_alg;
-       char *dont_compress;
-       char *exclude;
-       char *exclude_from;
-@@ -134,6 +135,7 @@ typedef struct {
- /* NOTE: update this macro if the last char* variable changes! */
- #define LOCAL_STRING_COUNT() (offsetof(local_vars, uid) / sizeof (char*) + 1)
+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;
-@@ -185,6 +187,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,
-@@ -208,6 +211,7 @@ static const all_vars Defaults = {
-  /* temp_dir; */              NULL,
-  /* uid; */                   NULL,
-+ /* diffserv; */              8,
-  /* max_connections; */               0,
-  /* max_verbosity; */         1,
-  /* syslog_facility; */               LOG_DAEMON,
-@@ -322,6 +326,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},
-@@ -454,6 +460,7 @@ FN_GLOBAL_INTEGER(lp_rsync_port, &Vars.g.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)
-@@ -477,6 +484,7 @@ FN_LOCAL_STRING(lp_secrets_file, secrets_file)
- 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
-@@ -71,6 +71,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;
@@ -100,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;
-@@ -780,6 +782,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");
-@@ -1040,6 +1044,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 },
@@ -118,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 },
-@@ -1067,6 +1073,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;
  
@@ -177,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);
                }
  
@@ -185,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;
                }