Commit Graph

251 Commits

Author SHA1 Message Date
Andrew Tridgell
8cd9fd4e8c always use a timeout to select, even if --timeout is not
specified. This makes things easier to debug.
1998-07-19 10:51:26 +00:00
Andrew Tridgell
ca8e96946e changed wording of an error message 1998-07-17 07:25:42 +00:00
Andrew Tridgell
eb601ffeb8 code style change 1998-07-17 05:37:56 +00:00
Andrew Tridgell
bd7e05d799 remove a redundent continue statement 1998-07-02 03:02:14 +00:00
Andrew Tridgell
c95f1aa9d3 prioritise reading over writing in the select loop. (this is another
ssh-friendly attempt)
1998-07-02 02:59:04 +00:00
Andrew Tridgell
86ffe37f11 fix the problem of --timeout waiting for twice the specified time. 1998-07-02 02:48:09 +00:00
Andrew Tridgell
bf9f01689f if we get EWOULDBLOCK on a write then reduce the amount of data we are
trying to write. This guarantees that the maximum amount of data that
can be written at any one time is written.
1998-06-19 00:55:19 +00:00
Andrew Tridgell
f7b9377863 handle non-blocking file descriptors for both read and write. Add a
workaround for buggy systems that say there is space to write when
there isn't.
1998-06-18 09:33:46 +00:00
Andrew Tridgell
a800434a82 added --stats option for verbose stats on the file transfer 1998-06-01 03:42:14 +00:00
Andrew Tridgell
e44f9a12c4 make sure that io_flush() doesn't call writefd_unbuffered from within
a writefd_unbuffered call!

this should fix the "decompressor lost sync" bug
1998-05-30 02:02:23 +00:00
Andrew Tridgell
cad2bba7d8 fixed a bug in the flist sending code that caused the flist sending to
get out of sync.
1998-05-29 02:28:33 +00:00
Andrew Tridgell
fe8c0a9824 use Realloc instead of realloc 1998-05-28 06:40:25 +00:00
Andrew Tridgell
528bfcd79a cosmetic fix. don't display a EOF error when displaying just the motd
from a rsync server
1998-05-28 01:58:33 +00:00
Andrew Tridgell
ea2111d10a - always flush the IO write buffer when reading
- handle start of line in exclude properly
1998-05-27 13:05:05 +00:00
Andrew Tridgell
4c36ddbeec heaps of cleanup in the io code.
we no longer use non-blocking IO, instead it uses select a lot more,
being careful to always allow for reading whenever a valid read fd is
available and chcking timeouts.

also split the file io calls into fileio.c
1998-05-27 12:37:22 +00:00
Andrew Tridgell
679e765768 fixed a multiplexing bug 1998-05-18 10:23:47 +00:00
Andrew Tridgell
8d9dc9f99d this is a large commit which adds io multiplexing, thus giving error
messages from the server when using the socket code.

I've doen a fair bit of testing and I don't seem to have broken
anything, but it is a very complex change. More testing needed!
1998-05-18 08:20:26 +00:00
Andrew Tridgell
22d6234e04 close some unnecessary file descriptors in do_recv() 1998-05-17 07:22:53 +00:00
Andrew Tridgell
5dd7e03167 put a limit (default 1MB) on the read buffer size. This stops it
growing too much if the sender is much faster than the receiver
1998-05-17 05:56:32 +00:00
Andrew Tridgell
e42c9458c2 use strlcat() strlcpy() and slprintf() whenever possible to avoid any
chance of a buffer overflow
1998-05-15 09:26:01 +00:00
Andrew Tridgell
d6dead6bb1 added write buffering during the file list sending. This makes things
a bit more efficient (less system calls)
1998-05-15 07:34:19 +00:00
Andrew Tridgell
344fb1276b fixed a select bug which caused rsync to use far more cpu time than
necessary on the server
1998-05-15 07:11:29 +00:00
Andrew Tridgell
f855d1a309 vsprintf returns char* on sunos4 1998-05-13 13:48:25 +00:00
Andrew Tridgell
f0fca04e4e first vesrion of working socket based rsync. It still needs a lot of
work, but at least it works :-)
1998-05-09 13:58:54 +00:00
Andrew Tridgell
9486289ce4 some large systematic changes to make socket conversion easier. The
biggest one is the use of rprintf() instead of fprintf()
1998-05-07 14:50:22 +00:00
Andrew Tridgell
b79223389b hopefully better support for systems where sizeof(int)==8 1998-05-06 14:13:03 +00:00
Andrew Tridgell
73233f0f12 add support for lseek64() under solaris 2.6 1998-05-06 06:34:18 +00:00
Andrew Tridgell
3bee67337d fix up the int64 handling a little. It should work on a few more
systems now (tested on OSF1)
1998-05-06 05:05:00 +00:00
Andrew Tridgell
d867229ba0 handle sparse files more efficiently 1998-04-05 06:43:38 +00:00
Andrew Tridgell
575f2fca9a fixed a string termination bug in the uidlist handling code. I've also
added a read_sbuf() routine that fixes this kind of bug generically to
avoid similar problems in future.
1998-04-01 05:20:19 +00:00
Andrew Tridgell
a070c37b7e fixed a bug I introduced in the last big commit 1998-03-26 06:09:04 +00:00
Andrew Tridgell
6ba9279fb2 - added an internal io_error flag. Whenever an io error occurs (such
as not being able to open a directory) this flag is set and propogated
to the other end. When this flag is set the --delete code is
disabled. This prevents the problem that io or permission errors could
cause files to be incorrectly deleted on the destination.

- added a --timeout option. This allows you to set an IO timeout in
seconds. If no io occurs in that time then rsync exits with a timeout
error.

- changed some FERROR fds to FINFO
1998-03-26 04:18:47 +00:00
Andrew Tridgell
71c4617611 - on systems (such as intel linux) where off_t is 32 bits but "long long"
is 64 bits use long long to get the totals right when transferring
  more than 2^32 bytes of data.

- use inline on flist_up if the compiler supports it
1998-03-25 11:08:32 +00:00
Andrew Tridgell
3a6a366fc5 finished 64 bit file offset support. Hopefully rsync can now transfer
files up to 2^64 bytes in size. Now I just need to find enough disk
space to test this :-)

The 64 bit offset code only works if off_t is 64 bits (or bigger!) on
both ends of the link. If one end tries to send a file greater than
2^31 in size and the other end doesn't support it then rsync will
abort.

This commit also cleans up some static declarations so they are in a
unitinitialised segment to save load time.
1998-03-23 12:52:57 +00:00
Andrew Tridgell
feaa89c410 for systems with a broken select use u_sleep() to ensure the write
process doesn't chew too much cpu time.
1998-03-23 04:14:21 +00:00
Andrew Tridgell
3fac9b6e93 removed the read_write() call, it's not used anywhere 1997-12-31 16:48:11 +00:00
Andrew Tridgell
97d6916e2d #if 0 the write exception code for the moment. I need to work out why
it gets a successful write select on a fd followed by a EAGAIN
write yet the fd is still OK.
1997-12-16 09:25:17 +00:00
Andrew Tridgell
9a52223bce - fixed the "write exception" error. I was resetting got_select at the
wrong point
- fixed a seg fault error in flist.c
- only print hlink debug messages when using -v
1997-12-16 08:48:36 +00:00
Andrew Tridgell
e92338c82d several changes:
- by popular demand I have changed the behaviour of the --delete
option. It should now work as "expected" for even those people silly
enough not to read the man page. rsync will now only look for
candidate files/directories to delete in directories that are
explicitly transferred from the sender
- updated the README a bit
- try to fail a bit more gracefully when rsync runs out of disk
space. I don't think this issues is fully resolved yet
1997-12-15 21:04:04 +00:00
Andrew Tridgell
05c629f778 I think I've (finally) fixed the problem with rsync periodically
freezing when used with ssh. The problem is really the ssh use of
blocking calls. rsync has had a fix for this for a while which relies
on using non-blocking calls itself and then reading any data from the
incoming fd when trying to write, thus ensuring that the incoming fd
doesn't get full.
The problem was the the incoming fd wasn't added to the select
statement, which meant that new data arriving on the fd only got read
when the select timed out, which happens every 10 seconds. Thus things
could slow to a crawl!
The incoming fd is now in the select call, and this seems to fix the
problem.
1997-12-15 12:33:15 +00:00
Andrew Tridgell
d89322c446 - fixed file time bug
- doc updates
1996-07-03 06:24:34 +00:00
Andrew Tridgell
9e31c4824c added resend logic
added checksum on all files
1996-07-02 03:19:58 +00:00
Andrew Tridgell
dc5ddbccac - hard links
- better sparse handling
- FERROR and FINFO
1996-06-30 03:57:22 +00:00
Andrew Tridgell
d5ee1f8e7a *** empty log message *** 1996-06-28 15:24:39 +00:00
Andrew Tridgell
34ccb63e71 new exit/cleanup code 1996-06-28 13:55:41 +00:00
Andrew Tridgell
7bec6a5cd6 - handle no mmap for munmap
- handle sparse files
- add MAX_PROTOCOL_VERSION
1996-06-28 08:01:55 +00:00
Paul Mackerras
7f28dbee65 standard input on server may be nonblocking 1996-06-28 07:06:34 +00:00
Andrew Tridgell
4fe159a81d - improved filename packing
- fixed sunos EAGAIN bug
1996-06-27 04:22:19 +00:00
Andrew Tridgell
182dca5c80 more byte efficient flist routines 1996-06-26 13:37:05 +00:00
Andrew Tridgell
58d433ab3c added SIGPIPE catch
added select timeout
1996-06-26 03:21:27 +00:00