Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
a0f1ed55
Commit
a0f1ed55
authored
Oct 27, 2009
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the daemon-timeout conveyance into a protocol-31 message.
parent
4dde3347
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
compat.c
compat.c
+0
-15
io.c
io.c
+12
-1
main.c
main.c
+3
-0
rsync.h
rsync.h
+2
-1
No files found.
compat.c
View file @
a0f1ed55
...
...
@@ -27,8 +27,6 @@ int inc_recurse = 0;
extern
int
am_server
;
extern
int
am_sender
;
extern
int
am_daemon
;
extern
int
io_timeout
;
extern
int
local_server
;
extern
int
inplace
;
extern
int
recurse
;
...
...
@@ -74,7 +72,6 @@ int filesfrom_convert = 0;
#define CF_INC_RECURSE (1<<0)
#define CF_SYMLINK_TIMES (1<<1)
#define CF_SYMLINK_ICONV (1<<2)
#define CF_TIMEOUT_ACTIVE (1<<3)
static
const
char
*
client_info
;
...
...
@@ -257,21 +254,9 @@ void setup_protocol(int f_out,int f_in)
#ifdef ICONV_OPTION
compat_flags
|=
CF_SYMLINK_ICONV
;
#endif
if
(
am_daemon
&&
io_timeout
&&
protocol_version
>=
31
)
compat_flags
|=
CF_TIMEOUT_ACTIVE
;
write_byte
(
f_out
,
compat_flags
);
if
(
compat_flags
&
CF_TIMEOUT_ACTIVE
)
write_varint
(
f_out
,
io_timeout
);
}
else
{
compat_flags
=
read_byte
(
f_in
);
if
(
compat_flags
&
CF_TIMEOUT_ACTIVE
)
{
int
timeout
=
read_varint
(
f_in
);
if
(
!
io_timeout
||
io_timeout
>
timeout
)
{
if
(
INFO_GTE
(
MISC
,
2
))
rprintf
(
FINFO
,
"Setting --timeout=%d to match server
\n
"
,
timeout
);
io_timeout
=
timeout
;
}
}
}
/* The inc_recurse var MUST be set to 0 or 1. */
inc_recurse
=
compat_flags
&
CF_INC_RECURSE
?
1
:
0
;
...
...
io.c
View file @
a0f1ed55
...
...
@@ -1264,7 +1264,7 @@ void stop_flist_forward(void)
static
void
read_a_msg
(
void
)
{
char
*
data
,
line
[
BIGPATHBUFLEN
];
int
tag
;
int
tag
,
val
;
size_t
msg_bytes
;
data
=
perform_io
(
4
,
PIO_INPUT_AND_CONSUME
);
...
...
@@ -1306,6 +1306,17 @@ static void read_a_msg(void)
if
(
!
am_generator
)
send_msg
(
MSG_IO_ERROR
,
data
,
4
,
0
);
break
;
case
MSG_IO_TIMEOUT
:
if
(
msg_bytes
!=
4
||
am_sender
||
am_generator
)
goto
invalid_msg
;
data
=
perform_io
(
4
,
PIO_INPUT_AND_CONSUME
);
val
=
IVAL
(
data
,
0
);
if
(
!
io_timeout
||
io_timeout
>
val
)
{
if
(
INFO_GTE
(
MISC
,
2
))
rprintf
(
FINFO
,
"Setting --timeout=%d to match server
\n
"
,
val
);
io_timeout
=
val
;
}
break
;
case
MSG_NOOP
:
if
(
am_sender
)
maybe_send_keepalive
();
...
...
main.c
View file @
a0f1ed55
...
...
@@ -29,6 +29,7 @@
extern
int
dry_run
;
extern
int
list_only
;
extern
int
io_timeout
;
extern
int
am_root
;
extern
int
am_server
;
extern
int
am_sender
;
...
...
@@ -1051,6 +1052,8 @@ void start_server(int f_in, int f_out, int argc, char *argv[])
if
(
protocol_version
>=
23
)
io_start_multiplex_out
(
f_out
);
if
(
am_daemon
&&
io_timeout
&&
protocol_version
>=
31
)
send_msg_int
(
MSG_IO_TIMEOUT
,
io_timeout
);
if
(
am_sender
)
{
keep_dirlinks
=
0
;
/* Must be disabled on the sender. */
...
...
rsync.h
View file @
a0f1ed55
...
...
@@ -98,7 +98,7 @@
/* This is used when working on a new protocol version in CVS, and should
* be a new non-zero value for each CVS change that affects the protocol.
* It must ALWAYS be 0 when the protocol goes final (and NEVER before)! */
#define SUBPROTOCOL_VERSION
9
#define SUBPROTOCOL_VERSION
10
/* We refuse to interoperate with versions that are not in this range.
* Note that we assume we'll work with later versions: the onus is on
...
...
@@ -231,6 +231,7 @@ enum msgcode {
MSG_REDO
=
9
,
/* reprocess indicated flist index */
MSG_STATS
=
10
,
/* message has stats data for generator */
MSG_IO_ERROR
=
22
,
/* the sending side had an I/O error */
MSG_IO_TIMEOUT
=
33
,
/* tell client about a daemon's timeout value */
MSG_NOOP
=
42
,
/* a do-nothing message */
MSG_SUCCESS
=
100
,
/* successfully updated indicated flist index */
MSG_DELETED
=
101
,
/* successfully deleted a file on receiving side */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment