MCPcopy Index your code
hub / github.com/RsyncProject/rsync / read_final_goodbye

Function read_final_goodbye

main.c:893–924  ·  view source on GitHub ↗

This is only called by the sender. */

Source from the content-addressed store, hash-verified

891
892/* This is only called by the sender. */
893static void read_final_goodbye(int f_in, int f_out)
894{
895 int i, iflags, xlen;
896 uchar fnamecmp_type;
897 char xname[MAXPATHLEN];
898
899 shutting_down = True;
900
901 if (protocol_version < 29)
902 i = read_int(f_in);
903 else {
904 i = read_ndx_and_attrs(f_in, f_out, &iflags, &fnamecmp_type, xname, &xlen);
905 if (protocol_version >= 31 && i == NDX_DONE) {
906 if (am_sender)
907 write_ndx(f_out, NDX_DONE);
908 else {
909 if (batch_gen_fd >= 0) {
910 while (read_int(batch_gen_fd) != NDX_DEL_STATS) {}
911 read_del_stats(batch_gen_fd);
912 }
913 write_int(f_out, NDX_DONE);
914 }
915 i = read_ndx_and_attrs(f_in, f_out, &iflags, &fnamecmp_type, xname, &xlen);
916 }
917 }
918
919 if (i != NDX_DONE) {
920 rprintf(FERROR, "Invalid packet at end of run (%d) [%s]\n",
921 i, who_am_i());
922 exit_cleanup(RERR_PROTOCOL);
923 }
924}
925
926static void do_server_sender(int f_in, int f_out, int argc, char *argv[])
927{

Callers 3

do_server_senderFunction · 0.85
do_recvFunction · 0.85
client_runFunction · 0.85

Calls 7

read_intFunction · 0.85
read_ndx_and_attrsFunction · 0.85
write_ndxFunction · 0.85
read_del_statsFunction · 0.85
write_intFunction · 0.85
rprintfFunction · 0.70
who_am_iFunction · 0.70

Tested by

no test coverage detected