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

Function send_token

token.c:1065–1089  ·  view source on GitHub ↗

* Transmit a verbatim buffer of length @p n followed by a token. * If token == -1 then we have reached EOF * If n == 0 then don't send a buffer */

Source from the content-addressed store, hash-verified

1063 * If n == 0 then don't send a buffer
1064 */
1065void send_token(int f, int32 token, struct map_struct *buf, OFF_T offset,
1066 int32 n, int32 toklen)
1067{
1068 switch (do_compression) {
1069 case CPRES_NONE:
1070 simple_send_token(f, token, buf, offset, n);
1071 break;
1072 case CPRES_ZLIB:
1073 case CPRES_ZLIBX:
1074 send_deflated_token(f, token, buf, offset, n, toklen);
1075 break;
1076#ifdef SUPPORT_ZSTD
1077 case CPRES_ZSTD:
1078 send_zstd_token(f, token, buf, offset, n);
1079 break;
1080#endif
1081#ifdef SUPPORT_LZ4
1082 case CPRES_LZ4:
1083 send_compressed_token(f, token, buf, offset, n);
1084 break;
1085#endif
1086 default:
1087 NOISY_DEATH("Unknown do_compression value");
1088 }
1089}
1090
1091/*
1092 * receive a token or buffer from the other end. If the return value is >0 then

Callers 1

matchedFunction · 0.85

Calls 4

simple_send_tokenFunction · 0.85
send_deflated_tokenFunction · 0.85
send_zstd_tokenFunction · 0.85
send_compressed_tokenFunction · 0.85

Tested by

no test coverage detected