* 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 */
| 1063 | * If n == 0 then don't send a buffer |
| 1064 | */ |
| 1065 | void 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 |
no test coverage detected