Commit 2ac14ee
zlib: Make the finish flush flag configurable
Up to now, `Z_FINISH` was always the flushing flag that was used
for the last chunk of input data. This patch makes this choice
configurable so that advanced users can perform e.g. decompression of
partial data using `Z_SYNC_FLUSH`, if that suits their needs.
Add tests to make sure that an error is thrown upon encountering
invalid `flush` or `finishFlush` flags.
Fixes: #5761
PR-URL: #6069
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 3a5dd02 commit 2ac14eeCopy full SHA for 2ac14ee
File tree
Expand file treeCollapse file tree
4 files changed
+91
-12
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- test/parallel
Expand file treeCollapse file tree
4 files changed
+91
-12
lines changedOpen diff view settings
Collapse file
+26Lines changed: 26 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
109 | 109 | |
110 | 110 | |
111 | 111 | |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | + |
112 | 137 | |
113 | 138 | |
114 | 139 | |
| ||
231 | 256 | |
232 | 257 | |
233 | 258 | |
| 259 | + |
234 | 260 | |
235 | 261 | |
236 | 262 | |
|
Collapse file
+20-12Lines changed: 20 additions & 12 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
234 | 234 | |
235 | 235 | |
236 | 236 | |
237 | | - |
| 237 | + |
238 | 238 | |
239 | 239 | |
240 | 240 | |
| ||
282 | 282 | |
283 | 283 | |
284 | 284 | |
| 285 | + |
| 286 | + |
| 287 | + |
| 288 | + |
| 289 | + |
| 290 | + |
| 291 | + |
| 292 | + |
285 | 293 | |
286 | 294 | |
287 | 295 | |
| ||
294 | 302 | |
295 | 303 | |
296 | 304 | |
297 | | - |
298 | | - |
299 | | - |
300 | | - |
301 | | - |
302 | | - |
303 | | - |
304 | | - |
305 | | - |
| 305 | + |
| 306 | + |
306 | 307 | |
| 308 | + |
| 309 | + |
| 310 | + |
| 311 | + |
307 | 312 | |
| 313 | + |
| 314 | + |
308 | 315 | |
309 | 316 | |
310 | 317 | |
| ||
483 | 490 | |
484 | 491 | |
485 | 492 | |
486 | | - |
| 493 | + |
| 494 | + |
487 | 495 | |
488 | 496 | |
489 | 497 | |
490 | 498 | |
491 | | - |
| 499 | + |
492 | 500 | |
493 | 501 | |
494 | 502 | |
|
Collapse file
test/parallel/test-zlib-flush-flags.js
Copy file name to clipboard+28Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
Collapse file
test/parallel/test-zlib-truncated.js
Copy file name to clipboardExpand all lines: test/parallel/test-zlib-truncated.js+17Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
46 | 46 | |
47 | 47 | |
48 | 48 | |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
49 | 66 | |
50 | 67 | |
0 commit comments