* receive a token or buffer from the other end. If the return value is >0 then * it is a data buffer of that length, and *data will point at the data. * if the return value is -i then it represents token i-1 * if the return value is 0 then the end has been reached */
| 1095 | * if the return value is 0 then the end has been reached |
| 1096 | */ |
| 1097 | int32 recv_token(int f, char **data) |
| 1098 | { |
| 1099 | switch (do_compression) { |
| 1100 | case CPRES_NONE: |
| 1101 | return simple_recv_token(f,data); |
| 1102 | case CPRES_ZLIB: |
| 1103 | case CPRES_ZLIBX: |
| 1104 | return recv_deflated_token(f, data); |
| 1105 | #ifdef SUPPORT_ZSTD |
| 1106 | case CPRES_ZSTD: |
| 1107 | return recv_zstd_token(f, data); |
| 1108 | #endif |
| 1109 | #ifdef SUPPORT_LZ4 |
| 1110 | case CPRES_LZ4: |
| 1111 | return recv_compressed_token(f, data); |
| 1112 | #endif |
| 1113 | default: |
| 1114 | NOISY_DEATH("Unknown do_compression value"); |
| 1115 | } |
| 1116 | } |
| 1117 | |
| 1118 | /* |
| 1119 | * look at the data corresponding to a token, if necessary |
no test coverage detected