Commit Graph

181 Commits

Author SHA1 Message Date
Wayne Davison
5b98629747 Improved the while's logic in increment_active_files(). 2006-02-15 08:26:51 +00:00
Wayne Davison
d6081c829c Added increment_active_files() and decrement_active_files() which
allows the generator to ask us to limit the number of files that
are currently active in the transfer when --remove-sent-files is
enabled.
2006-02-15 08:05:31 +00:00
Wayne Davison
12bda6f710 Don't do so much memory copying in mplex_write(). 2006-02-04 21:52:32 +00:00
Wayne Davison
72f2d1b384 When complaining about a socket-read problem, use an FSOCKERR
code instead of a normal FERROR.  The generator is the only
process that will receive this, and it uses it to close down
the multi-I/O over the socket so that it won't ever hang trying
to write an error down a dead socket.
2006-02-01 19:35:17 +00:00
Wayne Davison
d8aeda1e50 Changed a few "ret" variables to have better names. 2006-02-01 19:24:28 +00:00
Wayne Davison
37f35d89d1 Made msg_list_push() static and renamed it to msg_list_flush(). 2005-12-08 21:19:22 +00:00
Wayne Davison
08c88178aa Tweaked the msg_list code so that the head and tail pointers
are contained by a structure.
2005-12-08 21:01:38 +00:00
Wayne Davison
0fb2fc4a1d Fixed a typo in a comment. 2005-12-08 16:12:25 +00:00
Wayne Davison
33544bf422 - Use BIGPATHBUFLEN for the length of several buffers.
- If io_printf() tries to overflow the buffer, die with
  an error instead of sending a truncated buffer.
2005-07-29 18:31:12 +00:00
Wayne Davison
3b0a30eba8 - Added set_io_timeout(), which sets all the timeout-dependent
variables when the timeout value changes.
- Split last_io into last_io_in and last_io_out.
- Made select_timeout static.
2005-05-19 08:52:13 +00:00
Wayne Davison
f2a4853c93 Improved the use of the "remaining" var in readfd_unbuffered() to
make certain that the static value is always set correctly anytime
we call out to another function.
2005-05-12 17:36:29 +00:00
Wayne Davison
e65154085c Got rid of some code from writefd_unbuffered() that was only needed
back when the generator had a writeable pipe to the receiver.
2005-05-12 07:45:21 +00:00
Wayne Davison
626bec8e84 - Added maybe_flush_socket() for use by the generator.
- Always maintain the last_io value for the generator.
2005-04-05 20:07:42 +00:00
Wayne Davison
2a0dd9bd70 Make sure that the line buffer in readfd_unbuffered() is large
enough to handle long-filename messages on a system that has a
really short MAXPATHLEN value.  Also, make it large enough to
be able to comment on a MAXPATHLEN filename.
2005-04-04 17:27:56 +00:00
Wayne Davison
3eeac9bc7e In writefd_unbuffered(), make sure that we don't look at the r_fds
variable when we're ignoring msg_fd_in.
2005-04-04 00:48:39 +00:00
Wayne Davison
9a6ed83f2c - Made an overflow in read_vstring() return an error instead of dying.
- Got rid of a flush kluge that was needed for the name-pipe.
2005-03-09 18:54:02 +00:00
Wayne Davison
cdf236aaf5 - Made the sock_{in,out} variables non-static.
- Added hlink_list, a FIFO list of finished hard-link items.
- Made get_redo_num() check for finished hard-link items and
  call the generator when they are found.  This ensures that
  we finish all the hard-link items by the time the MSG_DONE
  is read and returned to the generator.
- Added get_hlink_num() to read the new hlink_list.
2005-03-05 00:21:48 +00:00
Wayne Davison
c6816b9444 Transformed the push/pop functions for the redo-list into more
generic flist_num_{push,pop}() functions that can support other
folks caching off file-list index numbers.
2005-03-04 15:50:22 +00:00
Wayne Davison
46e99b09b9 Added read_vstring() and write_vstring() to io.c instead of
having this code in generator.c and receiver.c.
2005-03-04 15:38:58 +00:00
Wayne Davison
af436313a0 - Got rid of the checking of msg_fd_in in read_timeout() -- it was
only needed back when the generator was reading a separate redo
  pipe from the message pipe.
- Fixed a potential data corruption in the data that the generator
  is sending:  if a message comes in from the receiver, we now make
  sure that we can't put the forwarding of this message to the sender
  into the middle of a multiplexed-write record that the generator
  is trying to flush.
2005-03-04 08:58:27 +00:00
Wayne Davison
d19320fdf6 Changed remote_filesfrom_file to filesfrom_host. 2005-03-01 03:10:59 +00:00
Wayne Davison
55bb7fff14 Don't loop forever when the receiver is waiting around to be killed
at EOF -- it should be a rapidly arriving event, so only hang around
for 10 seconds, max., and then go ahead and report the "unexpectedly
closed" error.
2005-02-27 18:24:34 +00:00
Wayne Davison
cb2e1f18c2 One more comment fix. 2005-02-26 22:14:40 +00:00
Wayne Davison
0ecd03e396 Fixed comment. 2005-02-26 22:02:38 +00:00
Wayne Davison
574c250093 If kluge_around_eof is < 0, we go into an msleep() loop instead
of exiting.
2005-02-26 20:58:05 +00:00
Wayne Davison
87703a1b1f Improved the comment for kludge_around_eof. 2005-02-26 20:21:08 +00:00
Wayne Davison
3221f451a0 Calling maybe_send_keepalive() for protocol_version < 29 is
now supported, though we can only try to flush the output
buffer if we're in a lull.
2005-02-26 06:43:15 +00:00
Wayne Davison
9e2409ab22 - Added variable "ignore_timeout" that lets the generator tell
us to ignore a timeout without turning off the timeout-related
  time-keeping that the keep-alive processing needs.
- Added a new function:  maybe_send_keepalive().
2005-02-25 21:58:13 +00:00
Wayne Davison
9981c27ef1 Handle the new MSG_SUCCESS message for both the generator and the
sender.
2005-02-20 01:04:46 +00:00
Wayne Davison
0d67e00af8 - Allow send_msg() to be called by the delete code in flist.c and
have it figure out if it should send the message to our sibling
  or the other side.
- Handle the new MSG_DELETED message in both the generator and the
  sender.  This message is used to let the client side log each
  deletion when the server side is the receiver.
2005-02-19 02:39:18 +00:00
Wayne Davison
9361f83933 Added read_short() and write_short(). 2005-02-18 20:17:15 +00:00
Wayne Davison
67dde16163 In read_sum_head: output the who_am_i() info in our error messages. 2005-02-01 16:42:01 +00:00
Wayne Davison
4ccfd96cfe Tweaked one or more warning messages. 2005-01-31 19:13:19 +00:00
Wayne Davison
031fa9ad4d Use the new SIZEOF_INT64 define instead of INT64_IS_OFF_T. 2005-01-28 06:46:33 +00:00
Wayne Davison
c207d7ec62 Moved write_sum_head() here from generator.c. 2005-01-19 20:10:50 +00:00
Wayne Davison
188fed9570 Moved read_sum_head() here from sender.c (because the generator uses it
too) and improved it with better error checking.
2005-01-17 22:51:24 +00:00
Wayne Davison
bd9fca4708 For the "unexpected tag" or "multiplexing overflow" messages, we
now output who_am_i() so we know who had the problem.
2005-01-14 18:17:32 +00:00
Wayne Davison
ef0c03ff70 The code that tries to read an error from the socket in an abnormal-
exit situation was properly forcing the io_timeout value down to 30
seconds, but failing to set the select_timeout value.
2004-12-31 00:39:59 +00:00
Wayne Davison
98f8c9a5e5 Some minor improvements to read_msg_fd() made it safe to use both
set_msg_fd_in() and read_msg_fd() during the early phase of being
a client sender (up through the sending of the file list).  This
makes sure that the sender monitors the socket from the receiver
for any messages that it might send to us, and thus avoids a hang
when verbosity is high.
2004-11-20 07:07:37 +00:00
Wayne Davison
41cfde6be3 Checking in the g2r-basis-filename patch that ensures that the receiver
uses the same basis file that the generator used (avoiding a duplicate
check that could cause a hang if a compare-dest file was a named pipe).
2004-11-03 20:30:31 +00:00
Wayne Davison
dca68b0aad - Changed "read so far" to "received so far".
- Output the who_am_i() information in the socket read/write errors to
  make it a little clearer who is complaining about what (for those
  familiar with rsync, at least -- e.g. it will help when users report
  errors).
2004-08-02 02:43:54 +00:00
Wayne Davison
7f459268d9 Added close_multiplexing_in() and renamed io_multiplexing_close()
to close_multiplexing_out().
2004-07-29 07:24:45 +00:00
Wayne Davison
d1b31da71e If we fail writing to the socket and we're receiving error messages
from the other side via a multiplexed input, read the socket to see
if we get some errors that would explain why they went away.
2004-07-29 07:09:46 +00:00
Wayne Davison
741d654495 Call write_stream_flags() from start_write_batch(). 2004-07-24 16:39:53 +00:00
Wayne Davison
28deecca55 Changed NO_INT64 to INT64_IS_OFF_T because off_t might actually be
64 bits.  The code now only complains if int64 is really too short.
2004-07-22 19:28:45 +00:00
Wayne Davison
b0ad542928 Added batch_gen_fd. 2004-07-21 23:59:28 +00:00
Wayne Davison
cf338ab1be Made write_sbuf() non-static. 2004-07-20 16:57:18 +00:00
Wayne Davison
93095cbe99 A very minor optimization was made to read_sbuf(), read_byte(),
write_sbuf(), and write_byte().
2004-07-17 21:17:34 +00:00
Wayne Davison
1f75bb1066 Revamped some of the io variables and calls to make the various I/O
functions seemlessly work on fds that aren't for the main socket. This
involved changing some fd-variable names (to make them clearer), adding
io_set_sock_fds(), and making input buffering have a better enabled
flag (via an allocated buffer, just like the output buffering).  I also
got rid of the fd arg to some functions where the fd arg could only
specify the input or output fd for the socket (which we already know).
2004-07-17 15:20:00 +00:00
Wayne Davison
b9f592fbf5 My modified version of Chris Shoemaker's improved batch-file handling. 2004-07-15 02:20:08 +00:00