diff -u -r --new-file --exclude=CVS rsync-2.4.3/acconfig.h rsync-2.4.4/acconfig.h --- rsync-2.4.3/acconfig.h Fri Mar 31 00:23:00 2000 +++ rsync-2.4.4/acconfig.h Sat Jul 29 15:05:08 2000 @@ -10,5 +10,6 @@ #undef HAVE_SHORT_INO_T #undef HAVE_GETOPT_LONG #undef REPLACE_INET_NTOA +#undef REPLACE_INET_ATON #undef HAVE_GETTIMEOFDAY_TZ #undef HAVE_SOCKETPAIR diff -u -r --new-file --exclude=CVS rsync-2.4.3/backup.c rsync-2.4.4/backup.c --- rsync-2.4.3/backup.c Sun Jan 30 12:02:01 2000 +++ rsync-2.4.4/backup.c Sat Jul 29 15:05:08 2000 @@ -197,7 +197,7 @@ if (do_stat (fname, &st)) return 1; #endif - file = make_file (0, fname); + file = make_file (0, fname, 0); /* make a complete pathname for backup file */ if (strlen(backup_dir) + strlen(fname) > (MAXPATHLEN - 1)) { diff -u -r --new-file --exclude=CVS rsync-2.4.3/config.h.in rsync-2.4.4/config.h.in --- rsync-2.4.3/config.h.in Fri Mar 31 00:23:01 2000 +++ rsync-2.4.4/config.h.in Sat Jul 29 15:05:08 2000 @@ -62,6 +62,7 @@ #undef HAVE_SHORT_INO_T #undef HAVE_GETOPT_LONG #undef REPLACE_INET_NTOA +#undef REPLACE_INET_ATON #undef HAVE_GETTIMEOFDAY_TZ #undef HAVE_SOCKETPAIR @@ -94,9 +95,6 @@ /* Define if you have the glob function. */ #undef HAVE_GLOB - -/* Define if you have the inet_aton function. */ -#undef HAVE_INET_ATON /* Define if you have the lchown function. */ #undef HAVE_LCHOWN diff -u -r --new-file --exclude=CVS rsync-2.4.3/configure rsync-2.4.4/configure --- rsync-2.4.3/configure Fri Mar 31 00:23:01 2000 +++ rsync-2.4.4/configure Sat Jul 29 15:05:08 2000 @@ -2782,7 +2782,7 @@ fi done -for ac_func in strlcat strlcpy inet_aton +for ac_func in strlcat strlcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2789: checking for $ac_func" >&5 @@ -3247,17 +3247,17 @@ #include main() { struct in_addr ip; ip.s_addr = 0x12345678; if (strcmp(inet_ntoa(ip),"18.52.86.120") && - strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } -exit(1);} + strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(1); } +exit(0);} EOF if { (eval echo configure:3254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then - rsync_cv_REPLACE_INET_NTOA=yes + rsync_cv_REPLACE_INET_NTOA=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* - rsync_cv_REPLACE_INET_NTOA=no + rsync_cv_REPLACE_INET_NTOA=yes fi rm -fr conftest* fi @@ -3272,11 +3272,54 @@ fi + +echo $ac_n "checking for broken inet_aton""... $ac_c" 1>&6 +echo "configure:3278: checking for broken inet_aton" >&5 +if eval "test \"`echo '$''{'rsync_cv_REPLACE_INET_ATON'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +if test "$cross_compiling" = yes; then + rsync_cv_REPLACE_INET_ATON=cross +else + cat > conftest.$ac_ext < +#include +#include +#include +main() { struct in_addr ip; +if (inet_aton("example", &ip) == 0) exit(0); exit(1);} +EOF +if { (eval echo configure:3297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + rsync_cv_REPLACE_INET_ATON=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + rsync_cv_REPLACE_INET_ATON=yes +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$rsync_cv_REPLACE_INET_ATON" 1>&6 +if test x"$rsync_cv_REPLACE_INET_ATON" = x"yes"; then + cat >> confdefs.h <<\EOF +#define REPLACE_INET_ATON 1 +EOF + +fi + # # The following test was mostly taken from the tcl/tk plus patches # echo $ac_n "checking whether -c -o works""... $ac_c" 1>&6 -echo "configure:3280: checking whether -c -o works" >&5 +echo "configure:3323: checking whether -c -o works" >&5 if eval "test \"`echo '$''{'rsync_cv_DASHC_WORKS_WITH_DASHO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else diff -u -r --new-file --exclude=CVS rsync-2.4.3/configure.in rsync-2.4.4/configure.in --- rsync-2.4.3/configure.in Fri Mar 31 00:23:01 2000 +++ rsync-2.4.4/configure.in Sat Jul 29 15:05:08 2000 @@ -97,7 +97,7 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strdup strerror chown chmod mknod) AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes strftime) AC_CHECK_FUNCS(memmove lchown vsnprintf snprintf setsid glob strpbrk) -AC_CHECK_FUNCS(strlcat strlcpy inet_aton) +AC_CHECK_FUNCS(strlcat strlcpy) AC_CACHE_CHECK([for working socketpair],rsync_cv_HAVE_SOCKETPAIR,[ AC_TRY_RUN([#include @@ -210,11 +210,25 @@ #include main() { struct in_addr ip; ip.s_addr = 0x12345678; if (strcmp(inet_ntoa(ip),"18.52.86.120") && - strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } -exit(1);}], - rsync_cv_REPLACE_INET_NTOA=yes,rsync_cv_REPLACE_INET_NTOA=no,rsync_cv_REPLACE_INET_NTOA=cross)]) + strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(1); } +exit(0);}], + rsync_cv_REPLACE_INET_NTOA=no,rsync_cv_REPLACE_INET_NTOA=yes,rsync_cv_REPLACE_INET_NTOA=cross)]) if test x"$rsync_cv_REPLACE_INET_NTOA" = x"yes"; then AC_DEFINE(REPLACE_INET_NTOA) +fi + + +AC_CACHE_CHECK([for broken inet_aton],rsync_cv_REPLACE_INET_ATON,[ +AC_TRY_RUN([ +#include +#include +#include +#include +main() { struct in_addr ip; +if (inet_aton("example", &ip) == 0) exit(0); exit(1);}], + rsync_cv_REPLACE_INET_ATON=no,rsync_cv_REPLACE_INET_ATON=yes,rsync_cv_REPLACE_INET_ATON=cross)]) +if test x"$rsync_cv_REPLACE_INET_ATON" = x"yes"; then + AC_DEFINE(REPLACE_INET_ATON) fi # diff -u -r --new-file --exclude=CVS rsync-2.4.3/cvs.log rsync-2.4.4/cvs.log --- rsync-2.4.3/cvs.log Sun Apr 9 12:54:04 2000 +++ rsync-2.4.4/cvs.log Sat Jul 29 15:05:43 2000 @@ -11213,3 +11213,262 @@ Log Message: preparing for release of 2.4.3 + +**************************************** +Date: Wednesday April 19, 2000 @ 15:33 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv21552 + +Modified Files: + loadparm.c +Log Message: +by default don't gzip .iso images + + + +**************************************** +Date: Wednesday April 19, 2000 @ 15:33 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv27658 + +Modified Files: + acconfig.h config.h.in configure configure.in +Log Message: +autoconf test for broken solaris inet_aton() + + + + +**************************************** +Date: Wednesday April 19, 2000 @ 15:33 +Author: tridge + +Update of /data/cvs/rsync/lib +In directory samba:/tmp/cvs-serv27658/lib + +Modified Files: + compat.c +Log Message: +autoconf test for broken solaris inet_aton() + + + + +**************************************** +Date: Wednesday April 19, 2000 @ 15:44 +Author: tridge + +Update of /data/cvs/rsync/lib +In directory samba:/tmp/cvs-serv12638/lib + +Modified Files: + compat.c +Log Message: +test was the wrong way around + + + + + +**************************************** +Date: Wednesday April 19, 2000 @ 15:49 +Author: tridge + +Update of /data/cvs/rsync/lib +In directory samba:/tmp/cvs-serv17391 + +Modified Files: + compat.c +Log Message: +fixed bug in replacement inet_aton() + + + +**************************************** +Date: Saturday May 20, 2000 @ 0:58 +Author: dwd + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv6668 + +Modified Files: + rsync.1 rsync.yo +Log Message: +Do better job at describing exclude/include in man page. Based on suggestions +from Harry Putnam . + + + +**************************************** +Date: Wednesday June 7, 2000 @ 7:13 +Author: dwd + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv25517 + +Modified Files: + io.c options.c rsync.1 rsync.yo +Log Message: +Add --bwlimit option contributed by Matthew Demicco and Jamie Gritton. + + + +**************************************** +Date: Friday June 23, 2000 @ 23:50 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv22689 + +Modified Files: + options.c util.c +Log Message: +added --blocking-io option + + +**************************************** +Date: Friday June 23, 2000 @ 23:54 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv21676 + +Modified Files: + generator.c +Log Message: +get rid of annoying symlink error messages + + + +**************************************** +Date: Friday June 23, 2000 @ 23:54 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv23403 + +Modified Files: + util.c +Log Message: +added some comments on blocking-io + + + + +**************************************** +Date: Saturday June 24, 2000 @ 23:19 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv4329 + +Modified Files: + main.c +Log Message: +if the remote shell is rsh then use blocking IO + + + +**************************************** +Date: Saturday June 24, 2000 @ 23:19 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv4797 + +Modified Files: + util.c +Log Message: +added insure debug support + + + + +**************************************** +Date: Saturday June 24, 2000 @ 23:20 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv1106 + +Modified Files: + loadparm.c rsyncd.conf.5 rsyncd.conf.yo +Log Message: +added *.bz2 and *.tbz to default dont compress list + + + + + +**************************************** +Date: Saturday July 29, 2000 @ 14:41 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv7827 + +Modified Files: + rsync.yo +Log Message: +added blocking-io docs + + +**************************************** +Date: Saturday July 29, 2000 @ 14:52 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv5195 + +Modified Files: + backup.c flist.c main.c proto.h rsync.h +Log Message: +optimisations from Rich Salz + + + + +**************************************** +Date: Saturday July 29, 2000 @ 14:58 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv11547 + +Modified Files: + main.c +Log Message: +fix from T.J.Adye@rl.ac.uk for final goodbye message with new protocol + + + + +**************************************** +Date: Saturday July 29, 2000 @ 15:05 +Author: rsync-bu + +Update of /data/cvs/rsync +In directory samba:/data/people/rsync-bugs/rsync + +Modified Files: + version.h +Log Message: +preparing for release of 2.4.4 + + +**************************************** +Date: Saturday July 29, 2000 @ 15:05 +Author: rsync-bu + +Update of /data/cvs/rsync/packaging/redhat/5.0 +In directory samba:/data/people/rsync-bugs/rsync/packaging/redhat/5.0 + +Modified Files: + rsync.spec +Log Message: +preparing for release of 2.4.4 + diff -u -r --new-file --exclude=CVS rsync-2.4.3/flist.c rsync-2.4.4/flist.c --- rsync-2.4.3/flist.c Fri Mar 31 00:23:02 2000 +++ rsync-2.4.4/flist.c Sat Jul 29 15:05:08 2000 @@ -51,8 +51,60 @@ static struct exclude_struct **local_exclude_list; +static struct file_struct null_file; + static void clean_flist(struct file_list *flist, int strip_root); +struct string_area *string_area_new(int size) +{ + struct string_area *a; + + if (size <= 0) size = ARENA_SIZE; + a = malloc(sizeof(*a)); + if (!a) out_of_memory("string_area_new"); + a->current = a->base = malloc(size); + if (!a->current) out_of_memory("string_area_new buffer"); + a->end = a->base + size; + a->next = 0; + + return a; +} + +void string_area_free(struct string_area *a) +{ + struct string_area *next; + + for ( ; a ; a = next) { + next = a->next; + free(a->base); + } +} + +char *string_area_malloc(struct string_area **ap, int size) +{ + char *p; + struct string_area *a; + + /* does the request fit into the current space? */ + a = *ap; + if (a->current + size >= a->end) { + /* no; get space, move new string_area to front of the list */ + a = string_area_new(size > ARENA_SIZE ? size : ARENA_SIZE); + a->next = *ap; + *ap = a; + } + + /* have space; do the "allocation." */ + p = a->current; + a->current += size; + return p; +} + +char *string_area_strdup(struct string_area **ap, const char *src) +{ + char* dest = string_area_malloc(ap, strlen(src) + 1); + return strcpy(dest, src); +} static void list_file_entry(struct file_struct *f) { @@ -413,8 +465,11 @@ return (st2.st_dev != filesystem_dev); } +#define STRDUP(ap, p) (ap ? string_area_strdup(ap, p) : strdup(p)) +#define MALLOC(ap, i) (ap ? string_area_malloc(ap, i) : malloc(i)) + /* create a file_struct for a named file */ -struct file_struct *make_file(int f, char *fname) +struct file_struct *make_file(int f, char *fname, struct string_area **ap) { struct file_struct *file; STRUCT_STAT st; @@ -468,14 +523,14 @@ if (lastdir && strcmp(fname, lastdir)==0) { file->dirname = lastdir; } else { - file->dirname = strdup(fname); + file->dirname = STRDUP(ap, fname); lastdir = file->dirname; } - file->basename = strdup(p+1); + file->basename = STRDUP(ap, p+1); *p = '/'; } else { file->dirname = NULL; - file->basename = strdup(fname); + file->basename = STRDUP(ap, fname); } file->modtime = st.st_mtime; @@ -491,12 +546,12 @@ #if SUPPORT_LINKS if (S_ISLNK(st.st_mode)) { - file->link = strdup(linkbuf); + file->link = STRDUP(ap, linkbuf); } #endif if (always_checksum) { - file->sum = (char *)malloc(MD4_SUM_LENGTH); + file->sum = (char *)MALLOC(ap, MD4_SUM_LENGTH); if (!file->sum) out_of_memory("md4 sum"); /* drat. we have to provide a null checksum for non-regular files in order to be compatible with earlier versions @@ -513,7 +568,7 @@ if (lastdir && strcmp(lastdir, flist_dir)==0) { file->basedir = lastdir; } else { - file->basedir = strdup(flist_dir); + file->basedir = STRDUP(ap, flist_dir); lastdir = file->basedir; } } else { @@ -533,7 +588,7 @@ { struct file_struct *file; - file = make_file(f,fname); + file = make_file(f,fname, &flist->string_area); if (!file) return; @@ -623,7 +678,6 @@ } - struct file_list *send_file_list(int f,int argc,char *argv[]) { int i,l; @@ -640,14 +694,7 @@ start_write = stats.total_written; - flist = (struct file_list *)malloc(sizeof(flist[0])); - if (!flist) out_of_memory("send_file_list"); - - flist->count=0; - flist->malloced = 1000; - flist->files = (struct file_struct **)malloc(sizeof(flist->files[0])* - flist->malloced); - if (!flist->files) out_of_memory("send_file_list"); + flist = flist_new(); if (f != -1) { io_start_buffering(f); @@ -935,22 +982,47 @@ if (file->basename) free(file->basename); if (file->link) free(file->link); if (file->sum) free(file->sum); - memset((char *)file, 0, sizeof(*file)); + *file = null_file; } /* + * allocate a new file list + */ +struct file_list *flist_new() +{ + struct file_list *flist; + + flist = (struct file_list *)malloc(sizeof(flist[0])); + if (!flist) out_of_memory("send_file_list"); + + flist->count=0; + flist->malloced = 1000; + flist->files = (struct file_struct **)malloc(sizeof(flist->files[0])* + flist->malloced); + if (!flist->files) out_of_memory("send_file_list"); +#if ARENA_SIZE > 0 + flist->string_area = string_area_new(0); +#else + flist->string_area = 0; +#endif + return flist; +} +/* * free up all elements in a flist */ void flist_free(struct file_list *flist) { int i; for (i=1;icount;i++) { - free_file(flist->files[i]); + if (!flist->string_area) + free_file(flist->files[i]); free(flist->files[i]); } memset((char *)flist->files, 0, sizeof(flist->files[0])*flist->count); free(flist->files); + if (flist->string_area) + string_area_free(flist->string_area); memset((char *)flist, 0, sizeof(*flist)); free(flist); } @@ -979,7 +1051,13 @@ if (verbose > 1 && !am_server) rprintf(FINFO,"removing duplicate name %s from file list %d\n", f_name(flist->files[i-1]),i-1); - free_file(flist->files[i]); + /* it's not great that the flist knows the semantics of the + * file memory usage, but i'd rather not add a flag byte + * to that struct. XXX can i use a bit in the flags field? */ + if (flist->string_area) + flist->files[i][0] = null_file; + else + free_file(flist->files[i]); } } diff -u -r --new-file --exclude=CVS rsync-2.4.3/generator.c rsync-2.4.4/generator.c --- rsync-2.4.3/generator.c Sat Jan 29 22:35:03 2000 +++ rsync-2.4.4/generator.c Sat Jul 29 15:05:08 2000 @@ -246,8 +246,8 @@ return; } } + delete_file(fname); } - delete_file(fname); if (do_symlink(file->link,fname) != 0) { rprintf(FERROR,"symlink %s -> %s : %s\n", fname,file->link,strerror(errno)); diff -u -r --new-file --exclude=CVS rsync-2.4.3/io.c rsync-2.4.4/io.c --- rsync-2.4.3/io.c Sun Apr 9 12:53:30 2000 +++ rsync-2.4.4/io.c Sat Jul 29 15:05:08 2000 @@ -27,6 +27,8 @@ /* if no timeout is specified then use a 60 second select timeout */ #define SELECT_TIMEOUT 60 +extern int bwlimit; + static int io_multiplexing_out; static int io_multiplexing_in; static int multiplex_in_fd; @@ -388,6 +390,19 @@ exit_cleanup(RERR_STREAMIO); } + /* Sleep after writing to limit I/O bandwidth */ + if (bwlimit) + { + tv.tv_sec = 0; + tv.tv_usec = ret * 1000 / bwlimit; + while (tv.tv_usec > 1000000) + { + tv.tv_sec++; + tv.tv_usec -= 1000000; + } + select(0, NULL, NULL, NULL, &tv); + } + total += ret; if (io_timeout) diff -u -r --new-file --exclude=CVS rsync-2.4.3/lib/compat.c rsync-2.4.4/lib/compat.c --- rsync-2.4.3/lib/compat.c Sat Jan 29 22:35:04 2000 +++ rsync-2.4.4/lib/compat.c Sat Jul 29 15:05:09 2000 @@ -95,21 +95,6 @@ } #endif -#ifdef REPLACE_INET_NTOA - char *rep_inet_ntoa(struct in_addr ip) -{ - unsigned char *p = (unsigned char *)&ip.s_addr; - static char buf[18]; -#if WORDS_BIGENDIAN - slprintf(buf, 18, "%d.%d.%d.%d", - (int)p[0], (int)p[1], (int)p[2], (int)p[3]); -#else - slprintf(buf, 18, "%d.%d.%d.%d", - (int)p[3], (int)p[2], (int)p[1], (int)p[0]); -#endif - return buf; -} -#endif #ifndef HAVE_STRLCPY /* like strncpy but does not 0 fill the buffer and always null @@ -146,7 +131,23 @@ } #endif -#ifndef HAVE_INET_ATON +#ifdef REPLACE_INET_NTOA + char *rep_inet_ntoa(struct in_addr ip) +{ + unsigned char *p = (unsigned char *)&ip.s_addr; + static char buf[18]; +#if WORDS_BIGENDIAN + slprintf(buf, 18, "%d.%d.%d.%d", + (int)p[0], (int)p[1], (int)p[2], (int)p[3]); +#else + slprintf(buf, 18, "%d.%d.%d.%d", + (int)p[3], (int)p[2], (int)p[1], (int)p[0]); +#endif + return buf; +} +#endif + +#ifdef REPLACE_INET_ATON int inet_aton(const char *cp, struct in_addr *inp) { unsigned int a1, a2, a3, a4; @@ -154,12 +155,12 @@ if (strcmp(cp, "255.255.255.255") == 0) { inp->s_addr = (unsigned) -1; - return 1; + return 0; } if (sscanf(cp, "%u.%u.%u.%u", &a1, &a2, &a3, &a4) != 4 || a1 > 255 || a2 > 255 || a3 > 255 || a4 > 255) { - return 1; + return 0; } ret = (a1 << 24) | (a2 << 16) | (a3 << 8) | a4; diff -u -r --new-file --exclude=CVS rsync-2.4.3/loadparm.c rsync-2.4.4/loadparm.c --- rsync-2.4.3/loadparm.c Tue Nov 9 00:15:01 1999 +++ rsync-2.4.4/loadparm.c Sat Jul 29 15:05:08 2000 @@ -162,7 +162,7 @@ NULL, /* include from */ "%o %h [%a] %m (%u) %f %l", /* log format */ NULL, /* refuse options */ - "*.gz *.tgz *.zip *.z *.rpm *.deb", /* dont compress */ + "*.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz", /* dont compress */ 0, /* timeout */ 0 /* max connections */ }; diff -u -r --new-file --exclude=CVS rsync-2.4.3/main.c rsync-2.4.4/main.c --- rsync-2.4.3/main.c Sun Apr 9 12:53:30 2000 +++ rsync-2.4.4/main.c Sat Jul 29 15:05:08 2000 @@ -112,6 +112,7 @@ char *tok,*dir=NULL; extern int local_server; extern char *rsync_path; + extern int blocking_io; if (!local_server) { if (!cmd) @@ -144,6 +145,9 @@ args[argc++] = rsync_path; server_options(args,&argc); + + + if (strcmp(cmd, RSYNC_RSH) == 0) blocking_io = 1; } args[argc++] = "."; @@ -236,6 +240,7 @@ char *dir = argv[0]; extern int relative_paths; extern int recurse; + extern int remote_version; if (verbose > 2) rprintf(FINFO,"server_sender starting pid=%d\n",(int)getpid()); @@ -267,7 +272,12 @@ } send_files(flist,f_out,f_in); + io_flush(); report(f_out); + if (remote_version >= 24) { + /* final goodbye message */ + read_int(f_in); + } io_flush(); exit_cleanup(0); } @@ -319,6 +329,7 @@ set_error_fd(error_pipe[1]); recv_files(f_in,flist,local_name,recv_pipe[1]); + io_flush(); report(f_in); write_int(recv_pipe[1],1); @@ -471,11 +482,11 @@ io_flush(); wait_process(pid, &status); } - report(-1); if (remote_version >= 24) { /* final goodbye message */ read_int(f_in); } + report(-1); exit_cleanup(status); } diff -u -r --new-file --exclude=CVS rsync-2.4.3/options.c rsync-2.4.4/options.c --- rsync-2.4.3/options.c Fri Mar 31 00:23:02 2000 +++ rsync-2.4.4/options.c Sat Jul 29 15:05:08 2000 @@ -62,10 +62,12 @@ int copy_unsafe_links=0; int block_size=BLOCK_SIZE; int size_only=0; +int bwlimit=0; int delete_after=0; int only_existing=0; int max_delete=0; int ignore_errors=0; +int blocking_io=0; char *backup_suffix = BACKUP_SUFFIX; char *tmpdir = NULL; @@ -155,10 +157,12 @@ rprintf(F," --address bind to the specified address\n"); rprintf(F," --config=FILE specify alternate rsyncd.conf file\n"); rprintf(F," --port=PORT specify alternate rsyncd port number\n"); + rprintf(F," --blocking-io use blocking IO for the remote shell\n"); rprintf(F," --stats give some file transfer stats\n"); rprintf(F," --progress show progress during transfer\n"); rprintf(F," --log-format=FORMAT log file transfers using specified format\n"); rprintf(F," --password-file=FILE get password from FILE\n"); + rprintf(F," --bwlimit=KBPS limit I/O bandwidth, KBytes per second\n"); rprintf(F," -h, --help show this help screen\n"); rprintf(F,"\n"); @@ -174,7 +178,7 @@ OPT_COPY_UNSAFE_LINKS, OPT_SAFE_LINKS, OPT_COMPARE_DEST, OPT_LOG_FORMAT, OPT_PASSWORD_FILE, OPT_SIZE_ONLY, OPT_ADDRESS, OPT_DELETE_AFTER, OPT_EXISTING, OPT_MAX_DELETE, OPT_BACKUP_DIR, - OPT_IGNORE_ERRORS}; + OPT_IGNORE_ERRORS, OPT_BWLIMIT, OPT_BLOCKING_IO}; static char *short_options = "oblLWHpguDCtcahvqrRIxnSe:B:T:zP"; @@ -232,9 +236,11 @@ {"partial", 0, 0, OPT_PARTIAL}, {"delete-after",0, 0, OPT_DELETE_AFTER}, {"ignore-errors",0, 0, OPT_IGNORE_ERRORS}, + {"blocking-io" ,0, 0, OPT_BLOCKING_IO}, {"config", 1, 0, OPT_CONFIG}, {"port", 1, 0, OPT_PORT}, {"log-format", 1, 0, OPT_LOG_FORMAT}, + {"bwlimit", 1, 0, OPT_BWLIMIT}, {"address", 1, 0, OPT_ADDRESS}, {"max-delete", 1, 0, OPT_MAX_DELETE}, {"backup-dir", 1, 0, OPT_BACKUP_DIR}, @@ -536,6 +542,10 @@ ignore_errors = 1; break; + case OPT_BLOCKING_IO: + blocking_io = 1; + break; + case 'P': do_progress = 1; keep_partial = 1; @@ -552,6 +562,10 @@ case OPT_LOG_FORMAT: log_format = optarg; break; + + case OPT_BWLIMIT: + bwlimit = atoi(optarg); + break; case OPT_ADDRESS: { @@ -584,6 +598,8 @@ static char bsize[30]; static char iotime[30]; static char mdelete[30]; + static char bw[50]; + int i, x; args[ac++] = "--server"; @@ -654,6 +670,11 @@ slprintf(iotime,sizeof(iotime),"--timeout=%d",io_timeout); args[ac++] = iotime; } + + if (bwlimit) { + slprintf(bw,sizeof(bw),"--bwlimit=%d",bwlimit); + args[ac++] = bw; + } if (strcmp(backup_suffix, BACKUP_SUFFIX)) { args[ac++] = "--suffix"; diff -u -r --new-file --exclude=CVS rsync-2.4.3/packaging/redhat/5.0/rsync.spec rsync-2.4.4/packaging/redhat/5.0/rsync.spec --- rsync-2.4.3/packaging/redhat/5.0/rsync.spec Sun Apr 9 12:53:56 2000 +++ rsync-2.4.4/packaging/redhat/5.0/rsync.spec Sat Jul 29 15:05:37 2000 @@ -1,10 +1,10 @@ Summary: Program for efficient remote updates of files. Name: rsync -Version: 2.4.3 +Version: 2.4.4 Release: 1 Copyright: GPL Group: Applications/Networking -Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.4.3.tar.gz +Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.4.4.tar.gz URL: http://samba.anu.edu.au/rsync/ Packager: Andrew Tridgell BuildRoot: /tmp/rsync diff -u -r --new-file --exclude=CVS rsync-2.4.3/proto.h rsync-2.4.4/proto.h --- rsync-2.4.3/proto.h Sun Apr 9 12:53:30 2000 +++ rsync-2.4.4/proto.h Sat Jul 29 15:05:08 2000 @@ -39,9 +39,13 @@ struct map_struct *map_file(int fd,OFF_T len); char *map_ptr(struct map_struct *map,OFF_T offset,int len); void unmap_file(struct map_struct *map); +struct string_area *string_area_new(int size); +void string_area_free(struct string_area *a); +char *string_area_malloc(struct string_area **ap, int size); +char *string_area_strdup(struct string_area **ap, const char *src); int readlink_stat(const char *Path, STRUCT_STAT *Buffer, char *Linkbuf) ; int link_stat(const char *Path, STRUCT_STAT *Buffer) ; -struct file_struct *make_file(int f, char *fname); +struct file_struct *make_file(int f, char *fname, struct string_area **ap); void send_file_name(int f,struct file_list *flist,char *fname, int recursive, unsigned base_flags); struct file_list *send_file_list(int f,int argc,char *argv[]); @@ -49,6 +53,7 @@ int file_compare(struct file_struct **f1,struct file_struct **f2); int flist_find(struct file_list *flist,struct file_struct *f); void free_file(struct file_struct *file); +struct file_list *flist_new(); void flist_free(struct file_list *flist); char *f_name(struct file_struct *f); void recv_generator(char *fname,struct file_list *flist,int i,int f_out); diff -u -r --new-file --exclude=CVS rsync-2.4.3/rsync.1 rsync-2.4.4/rsync.1 --- rsync-2.4.3/rsync.1 Fri Mar 31 00:23:03 2000 +++ rsync-2.4.4/rsync.1 Sat Jul 29 15:05:08 2000 @@ -302,6 +302,7 @@ --progress show progress during transfer --log-format=FORMAT log file transfers using specified format --password-file=FILE get password from FILE + --bwlimit=KBPS limit I/O bandwidth, KBytes per second -h, --help show this help screen .DE @@ -745,6 +746,15 @@ transport, not when using a remote shell as the transport\&. The file must not be world readable\&. It should contain just the password as a single line\&. +.IP +.IP "\fB--bwlimit=KBPS\fP" +This option allows you to specify a maximum transfer rate in kilobytes +per second\&. This option is most effective when using rsync with large +files (several megabytes and up)\&. Due to the nature of rsync transfers, +blocks of data are sent, then if rsync determines the transfer was +too fast, it will wait before sending the next data block\&. The result +is an average transfer rate equalling the specified limit\&. A value of +zero specifies no limit\&. .IP .PP .SH "EXCLUDE PATTERNS" @@ -760,7 +770,11 @@ skipped\&. If no matching include/exclude pattern is found then the filename is not skipped\&. .PP -Note that the --include and --exclude options take one pattern +Note that when used with -r (which is implied by -a), every subcomponent of +every path is visited from top down, so include/exclude patterns get +applied recursively to each subcomponent\&. +.PP +Note also that the --include and --exclude options take one pattern each\&. To add multiple patterns use the --include-from and --exclude-from options or multiple --include and --exclude options\&. .PP @@ -769,9 +783,11 @@ .IP o if the pattern starts with a / then it is matched against the start of the filename, otherwise it is matched against the end of -the filename\&. Thus /foo would match a file called foo -at the base of the tree whereas foo would match any file -called foo anywhere in the tree\&. +the filename\&. Thus "/foo" would match a file called "foo" at the base of +the tree\&. On the other hand, "foo" would match any file called "foo" +anywhere in the tree because the algorithm is applied recursively from +top down; it behaves as if each path component gets a turn at being the +end of the file name\&. .IP .IP o if the pattern ends with a / then it will only match a @@ -783,12 +799,16 @@ matching rules\&. Otherwise a simple string match is used\&. .IP .IP o +if the pattern includes a double asterisk "**" then all wildcards in +the pattern will match slashes, otherwise they will stop at slashes\&. +.IP +.IP o if the pattern contains a / (not counting a trailing /) then it is matched against the full filename, including any leading directory\&. If the pattern doesn\'t contain a / then it is matched -only against the final component of the filename\&. Furthermore, if -the pattern includes a double asterisk "**" then all wildcards in -the pattern will match slashes, otherwise they will stop at slashes\&. +only against the final component of the filename\&. Again, remember +that the algorithm is applied recursively so "full filename" can +actually be any portion of a path\&. .IP .IP o if the pattern starts with "+ " (a plus followed by a space) @@ -806,6 +826,13 @@ .PP The +/- rules are most useful in exclude lists, allowing you to have a single exclude list that contains both include and exclude options\&. +.PP +If you end an exclude list with --exclude \'*\', note that since the +algorithm is applied recursively that unless you explicitly include +parent directories of files you want to include then the algorithm +will stop at the parent directories and never see the files below +them\&. To include all directories, use --include \'*/\' before the +--exclude \'*\'\&. .PP Here are some exclude/include examples: .PP diff -u -r --new-file --exclude=CVS rsync-2.4.3/rsync.h rsync-2.4.4/rsync.h --- rsync-2.4.3/rsync.h Fri Mar 31 00:23:03 2000 +++ rsync-2.4.4/rsync.h Sat Jul 29 15:05:08 2000 @@ -305,10 +305,20 @@ }; +#define ARENA_SIZE (32 * 1024) + +struct string_area { + char *base; + char *end; + char *current; + struct string_area *next; +}; + struct file_list { int count; int malloced; struct file_struct **files; + struct string_area *string_area; }; struct sum_buf { diff -u -r --new-file --exclude=CVS rsync-2.4.3/rsync.yo rsync-2.4.4/rsync.yo --- rsync-2.4.3/rsync.yo Fri Mar 31 00:23:03 2000 +++ rsync-2.4.4/rsync.yo Sat Jul 29 15:05:08 2000 @@ -269,10 +269,12 @@ --address bind to the specified address --config=FILE specify alternate rsyncd.conf file --port=PORT specify alternate rsyncd port number + --blocking-io use blocking IO for the remote shell --stats give some file transfer stats --progress show progress during transfer --log-format=FORMAT log file transfers using specified format --password-file=FILE get password from FILE + --bwlimit=KBPS limit I/O bandwidth, KBytes per second -h, --help show this help screen ) @@ -610,6 +612,11 @@ dit(bf(--port=PORT)) This specifies an alternate TCP port number to use rather than the default port 873. +dit(bf(--blocking-io)) This specifies whether rsync will use blocking +IO when launching a remote shell transport. You may find this is +needed for some remote shells that can't handle the default +non-blocking IO. + dit(bf(--log-format=FORMAT)) This allows you to specify exactly what the rsync client logs to stdout on a per-file basis. The log format is specified using the same format conventions as the log format option in @@ -643,6 +650,14 @@ must not be world readable. It should contain just the password as a single line. +dit(bf(--bwlimit=KBPS)) This option allows you to specify a maximum +transfer rate in kilobytes per second. This option is most effective when +using rsync with large files (several megabytes and up). Due to the nature +of rsync transfers, blocks of data are sent, then if rsync determines the +transfer was too fast, it will wait before sending the next data block. The +result is an average transfer rate equalling the specified limit. A value +of zero specifies no limit. + enddit() manpagesection(EXCLUDE PATTERNS) @@ -658,7 +673,11 @@ skipped. If no matching include/exclude pattern is found then the filename is not skipped. -Note that the --include and --exclude options take one pattern +Note that when used with -r (which is implied by -a), every subcomponent of +every path is visited from top down, so include/exclude patterns get +applied recursively to each subcomponent. + +Note also that the --include and --exclude options take one pattern each. To add multiple patterns use the --include-from and --exclude-from options or multiple --include and --exclude options. @@ -667,9 +686,11 @@ itemize( it() if the pattern starts with a / then it is matched against the start of the filename, otherwise it is matched against the end of - the filename. Thus /foo would match a file called foo - at the base of the tree whereas foo would match any file - called foo anywhere in the tree. + the filename. Thus "/foo" would match a file called "foo" at the base of + the tree. On the other hand, "foo" would match any file called "foo" + anywhere in the tree because the algorithm is applied recursively from + top down; it behaves as if each path component gets a turn at being the + end of the file name. it() if the pattern ends with a / then it will only match a directory, not a file, link or device. @@ -678,12 +699,15 @@ *?[ then expression matching is applied using the shell filename matching rules. Otherwise a simple string match is used. + it() if the pattern includes a double asterisk "**" then all wildcards in + the pattern will match slashes, otherwise they will stop at slashes. + it() if the pattern contains a / (not counting a trailing /) then it is matched against the full filename, including any leading directory. If the pattern doesn't contain a / then it is matched - only against the final component of the filename. Furthermore, if - the pattern includes a double asterisk "**" then all wildcards in - the pattern will match slashes, otherwise they will stop at slashes. + only against the final component of the filename. Again, remember + that the algorithm is applied recursively so "full filename" can + actually be any portion of a path. it() if the pattern starts with "+ " (a plus followed by a space) then it is always considered an include pattern, even if specified as @@ -699,6 +723,13 @@ The +/- rules are most useful in exclude lists, allowing you to have a single exclude list that contains both include and exclude options. + +If you end an exclude list with --exclude '*', note that since the +algorithm is applied recursively that unless you explicitly include +parent directories of files you want to include then the algorithm +will stop at the parent directories and never see the files below +them. To include all directories, use --include '*/' before the +--exclude '*'. Here are some exclude/include examples: diff -u -r --new-file --exclude=CVS rsync-2.4.3/rsyncd.conf.5 rsync-2.4.4/rsyncd.conf.5 --- rsync-2.4.3/rsyncd.conf.5 Fri Mar 31 00:23:03 2000 +++ rsync-2.4.4/rsyncd.conf.5 Sat Jul 29 15:05:08 2000 @@ -390,7 +390,7 @@ The default setting is .DS -*\&.gz *\&.tgz *\&.zip *\&.z *\&.rpm *\&.deb +*\&.gz *\&.tgz *\&.zip *\&.z *\&.rpm *\&.deb *\&.iso *\&.bz2 *\&.tbz .DE diff -u -r --new-file --exclude=CVS rsync-2.4.3/rsyncd.conf.yo rsync-2.4.4/rsyncd.conf.yo --- rsync-2.4.3/rsyncd.conf.yo Fri Mar 31 00:23:03 2000 +++ rsync-2.4.4/rsyncd.conf.yo Sat Jul 29 15:05:08 2000 @@ -345,7 +345,7 @@ case-insensitive wildcard patterns. Any source filename matching one of the patterns will not be compressed during transfer. -The default setting is verb(*.gz *.tgz *.zip *.z *.rpm *.deb) +The default setting is verb(*.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz) enddit() diff -u -r --new-file --exclude=CVS rsync-2.4.3/util.c rsync-2.4.4/util.c --- rsync-2.4.3/util.c Sun Apr 9 12:53:31 2000 +++ rsync-2.4.4/util.c Sat Jul 29 15:05:08 2000 @@ -82,12 +82,22 @@ } -/* this is derived from CVS code */ +/* this is derived from CVS code + + note that in the child STDIN is set to blocking and STDOUT + is set to non-blocking. This is necessary as rsh relies on stdin being blocking + and ssh relies on stdout being non-blocking + + if blocking_io is set then use blocking io on both fds. That can be + used to cope with badly broken rsh implementations like the one on + solaris. + */ int piped_child(char **command,int *f_in,int *f_out) { int pid; int to_child_pipe[2]; int from_child_pipe[2]; + extern int blocking_io; if (fd_pair(to_child_pipe) < 0 || fd_pair(from_child_pipe) < 0) { @@ -116,6 +126,9 @@ if (from_child_pipe[1] != STDOUT_FILENO) close(from_child_pipe[1]); umask(orig_umask); set_blocking(STDIN_FILENO); + if (blocking_io) { + set_blocking(STDOUT_FILENO); + } execvp(command[0], command); rprintf(FERROR,"Failed to exec %s : %s\n", command[0],strerror(errno)); @@ -928,3 +941,35 @@ waitpid(pid, status, 0); *status = WEXITSTATUS(*status); } + + +#ifdef __INSURE__ +#include + +/******************************************************************* +This routine is a trick to immediately catch errors when debugging +with insure. A xterm with a gdb is popped up when insure catches +a error. It is Linux specific. +********************************************************************/ +int _Insure_trap_error(int a1, int a2, int a3, int a4, int a5, int a6) +{ + static int (*fn)(); + int ret; + char cmd[1024]; + + sprintf(cmd, "/usr/X11R6/bin/xterm -display :0 -T Panic -n Panic -e /bin/sh -c 'cat /tmp/ierrs.*.%d ; gdb /proc/%d/exe %d'", + getpid(), getpid(), getpid()); + + if (!fn) { + static void *h; + h = dlopen("/usr/local/parasoft/insure++lite/lib.linux2/libinsure.so", RTLD_LAZY); + fn = dlsym(h, "_Insure_trap_error"); + } + + ret = fn(a1, a2, a3, a4, a5, a6); + + system(cmd); + + return ret; +} +#endif diff -u -r --new-file --exclude=CVS rsync-2.4.3/version.h rsync-2.4.4/version.h --- rsync-2.4.3/version.h Sun Apr 9 12:53:55 2000 +++ rsync-2.4.4/version.h Sat Jul 29 15:05:35 2000 @@ -1 +1 @@ -#define VERSION "2.4.3" +#define VERSION "2.4.4"