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
e4c598c8
Commit
e4c598c8
authored
Nov 16, 2009
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make some RERR_* choices better, and another noop_io_until_death() tweak.
parent
ae598f38
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
16 deletions
+14
-16
cleanup.c
cleanup.c
+1
-1
io.c
io.c
+8
-10
token.c
token.c
+2
-2
xattrs.c
xattrs.c
+3
-3
No files found.
cleanup.c
View file @
e4c598c8
...
...
@@ -213,7 +213,7 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
/* FALLTHROUGH */
#include "case_N.h"
if
(
exit_code
&&
exit_code
!=
RERR_STREAMIO
&&
exit_code
!=
RERR_SIGNAL1
if
(
exit_code
&&
exit_code
!=
RERR_S
OCKETIO
&&
exit_code
!=
RERR_S
TREAMIO
&&
exit_code
!=
RERR_SIGNAL1
&&
(
protocol_version
>=
31
||
(
!
am_sender
&&
!
am_generator
)))
{
if
(
line
>
0
)
send_msg_int
(
MSG_ERROR_EXIT
,
exit_code
);
...
...
io.c
View file @
e4c598c8
...
...
@@ -734,7 +734,7 @@ static char *perform_io(size_t needed, int flags)
rsyserr
(
FERROR_SOCKET
,
errno
,
"read error"
);
}
else
rsyserr
(
FERROR
,
errno
,
"read error"
);
exit_cleanup
(
RERR_S
TREAM
IO
);
exit_cleanup
(
RERR_S
OCKET
IO
);
}
}
if
(
msgs2stderr
&&
DEBUG_GTE
(
IO
,
2
))
...
...
@@ -766,7 +766,7 @@ static char *perform_io(size_t needed, int flags)
iobuf
.
out
.
len
=
iobuf
.
msg
.
len
=
iobuf
.
raw_flushing_ends_before
=
0
;
rsyserr
(
FERROR_SOCKET
,
errno
,
"[%s] write error"
,
who_am_i
());
drain_multiplex_messages
();
exit_cleanup
(
RERR_S
TREAM
IO
);
exit_cleanup
(
RERR_S
OCKET
IO
);
}
}
if
(
msgs2stderr
&&
DEBUG_GTE
(
IO
,
2
))
{
...
...
@@ -819,12 +819,10 @@ void noop_io_until_death(void)
char
buf
[
1024
];
kluge_around_eof
=
2
;
/* For protocol 31: setting an I/O timeout ensures that if something
* inexplicably weird happens, we won't hang around forever. For older
* protocols: we can't tell the other side to die, so we linger a brief
* time (to try to give our error messages time to arrive) and then let
* the "unexpectedly" closed socket tell them to die. */
set_io_timeout
(
protocol_version
>=
31
?
30
:
1
);
/* Setting an I/O timeout ensures that if something inexplicably weird
* happens, we won't hang around forever. */
if
(
!
io_timeout
)
set_io_timeout
(
60
);
while
(
1
)
read_buf
(
iobuf
.
in_fd
,
buf
,
sizeof
buf
);
...
...
@@ -2114,11 +2112,11 @@ void io_printf(int fd, const char *format, ...)
va_end
(
ap
);
if
(
len
<
0
)
exit_cleanup
(
RERR_
STREAMIO
);
exit_cleanup
(
RERR_
PROTOCOL
);
if
(
len
>
(
int
)
sizeof
buf
)
{
rprintf
(
FERROR
,
"io_printf() was too long for the buffer.
\n
"
);
exit_cleanup
(
RERR_
STREAMIO
);
exit_cleanup
(
RERR_
PROTOCOL
);
}
write_sbuf
(
fd
,
buf
);
...
...
token.c
View file @
e4c598c8
...
...
@@ -306,7 +306,7 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
Z_DEFLATED
,
-
15
,
8
,
Z_DEFAULT_STRATEGY
)
!=
Z_OK
)
{
rprintf
(
FERROR
,
"compression init failed
\n
"
);
exit_cleanup
(
RERR_
STREAMIO
);
exit_cleanup
(
RERR_
PROTOCOL
);
}
if
((
obuf
=
new_array
(
char
,
OBUF_SIZE
))
==
NULL
)
out_of_memory
(
"send_deflated_token"
);
...
...
@@ -450,7 +450,7 @@ static int32 recv_deflated_token(int f, char **data)
rx_strm
.
zfree
=
NULL
;
if
(
inflateInit2
(
&
rx_strm
,
-
15
)
!=
Z_OK
)
{
rprintf
(
FERROR
,
"inflate init failed
\n
"
);
exit_cleanup
(
RERR_
STREAMIO
);
exit_cleanup
(
RERR_
PROTOCOL
);
}
if
(
!
(
cbuf
=
new_array
(
char
,
MAX_DATA_COUNT
))
||
!
(
dbuf
=
new_array
(
char
,
AVAIL_OUT_SIZE
(
CHUNK_SIZE
))))
...
...
xattrs.c
View file @
e4c598c8
...
...
@@ -589,7 +589,7 @@ int recv_xattr_request(struct file_struct *file, int f_in)
if
(
F_XATTR
(
file
)
<
0
)
{
rprintf
(
FERROR
,
"recv_xattr_request: internal data error!
\n
"
);
exit_cleanup
(
RERR_
STREAMIO
);
exit_cleanup
(
RERR_
PROTOCOL
);
}
lst
+=
F_XATTR
(
file
);
...
...
@@ -605,12 +605,12 @@ int recv_xattr_request(struct file_struct *file, int f_in)
if
(
!
cnt
||
rxa
->
num
!=
num
)
{
rprintf
(
FERROR
,
"[%s] could not find xattr #%d for %s
\n
"
,
who_am_i
(),
num
,
f_name
(
file
,
NULL
));
exit_cleanup
(
RERR_
STREAMIO
);
exit_cleanup
(
RERR_
PROTOCOL
);
}
if
(
!
XATTR_ABBREV
(
*
rxa
)
||
rxa
->
datum
[
0
]
!=
XSTATE_ABBREV
)
{
rprintf
(
FERROR
,
"[%s] internal abbrev error on %s (%s, len=%ld)!
\n
"
,
who_am_i
(),
f_name
(
file
,
NULL
),
rxa
->
name
,
(
long
)
rxa
->
datum_len
);
exit_cleanup
(
RERR_
STREAMIO
);
exit_cleanup
(
RERR_
PROTOCOL
);
}
if
(
am_sender
)
{
...
...
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