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
7752df41
Commit
7752df41
authored
Nov 10, 2005
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compute the right checksum length for the current protocol_version
only once instead of over and over again.
parent
d8b108c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
flist.c
flist.c
+4
-4
No files found.
flist.c
View file @
7752df41
...
...
@@ -68,6 +68,7 @@ extern struct filter_list_struct filter_list;
extern
struct
filter_list_struct
server_filter_list
;
int
io_error
;
int
checksum_len
;
dev_t
filesystem_dev
;
/* used to implement -x */
static
char
empty_sum
[
MD4_SUM_LENGTH
];
...
...
@@ -84,6 +85,7 @@ void init_flist(void)
/* Figure out how big the file_struct is without trailing padding */
file_struct_len
=
offsetof
(
struct
file_struct
,
flags
)
+
sizeof
f
.
flags
;
checksum_len
=
protocol_version
<
21
?
2
:
MD4_SUM_LENGTH
;
}
static
int
show_filelist_p
(
void
)
...
...
@@ -475,14 +477,13 @@ void send_file_entry(struct file_struct *file, int f, unsigned short base_flags)
if
(
always_checksum
&&
(
S_ISREG
(
mode
)
||
protocol_version
<
28
))
{
char
*
sum
;
int
slen
=
protocol_version
<
21
?
2
:
MD4_SUM_LENGTH
;
if
(
S_ISREG
(
mode
))
sum
=
file
->
u
.
sum
;
else
{
/* Prior to 28, we sent a useless set of nulls. */
sum
=
empty_sum
;
}
write_buf
(
f
,
sum
,
s
len
);
write_buf
(
f
,
sum
,
checksum_
len
);
}
strlcpy
(
lastname
,
fname
,
MAXPATHLEN
);
...
...
@@ -698,7 +699,6 @@ static struct file_struct *receive_file_entry(struct file_list *flist,
if
(
always_checksum
&&
(
sum_len
||
protocol_version
<
28
))
{
char
*
sum
;
int
slen
=
protocol_version
<
21
?
2
:
MD4_SUM_LENGTH
;
if
(
sum_len
)
{
file
->
u
.
sum
=
sum
=
bp
;
/*bp += sum_len;*/
...
...
@@ -706,7 +706,7 @@ static struct file_struct *receive_file_entry(struct file_list *flist,
/* Prior to 28, we get a useless set of nulls. */
sum
=
empty_sum
;
}
read_buf
(
f
,
sum
,
s
len
);
read_buf
(
f
,
sum
,
checksum_
len
);
}
if
(
!
preserve_perms
)
{
...
...
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