diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2025-08-29 23:12:26 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2025-08-29 23:12:26 +0000 |
| commit | 73edeb15a1f17ec940154bb3476b7355e06780c7 (patch) | |
| tree | 7926ae46771e801aeda97d5c955920ae7c926000 | |
| parent | 2a2458f746c888aa49c50d3a1c7ab2e978729c2d (diff) | |
| download | tipidee-73edeb15a1f17ec940154bb3476b7355e06780c7.tar.gz | |
Use corking for regular as well
| -rw-r--r-- | src/tipideed/send_file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tipideed/send_file.c b/src/tipideed/send_file.c index f9fbb9c..3641a5b 100644 --- a/src/tipideed/send_file.c +++ b/src/tipideed/send_file.c @@ -55,11 +55,12 @@ void send_file_range (int fd, uint64_t offset, uint64_t n, char const *fn, uint3 struct sendfile_s sf = { .pos = offset, .n = n, .fd = fd } ; tain deadline ; tain_add_g(&deadline, &g.writetto) ; + if (!(flags & TIPIDEE_RA_FLAG_REALTIME)) cork(1) ; if (!buffer_timed_flush_g(buffer_1, &deadline)) strerr_diefu2sys(111, "write", " to stdout") ; if (!timed_flush_g(&sf, &s_getfd, &s_isnonempty, &s_flush, &deadline)) strerr_diefu3sys(111, "sendfile ", fn, " to stdout") ; - (void)flags ; + if (!(flags & TIPIDEE_RA_FLAG_REALTIME)) uncork(1) ; } #else @@ -122,6 +123,7 @@ void send_file_range (int fd, uint64_t offset, uint64_t n, char const *fn, uint3 tain deadline ; struct spliceinfo_s si = { .last = 0, .realtime = !!(flags & TIPIDEE_RA_FLAG_REALTIME) } ; tain_add_g(&deadline, &g.writetto) ; + if (!si.realtime) cork(1) ; if (!buffer_timed_flush_g(buffer_1, &deadline)) strerr_diefu2sys(111, "write", " to stdout") ; while (n) @@ -140,6 +142,7 @@ void send_file_range (int fd, uint64_t offset, uint64_t n, char const *fn, uint3 if (!timed_flush_g(&si, &getfd, &isnonempty, &flush, &deadline)) strerr_diefu2sys(111, "splice", " to stdout") ; } + // if (!si.realtime) uncork(1) ; /* auto-uncorks on si.last */ } #else |
