# HG changeset patch # User Paul Boddie # Date 1715379059 -7200 # Node ID 2c83535db1dbccb54a82f44edf6e561113e501cb # Parent d4e8b3067e6bd335a00708cd2cec7ce72a5ecc9f Employ the same property calculations with pipes as with files. diff -r d4e8b3067e6b -r 2c83535db1db libfsclient/lib/src/file.cc --- a/libfsclient/lib/src/file.cc Fri May 10 22:09:15 2024 +0200 +++ b/libfsclient/lib/src/file.cc Sat May 11 00:10:59 2024 +0200 @@ -683,12 +683,12 @@ { client_Pipe _pipe(pipe->ref); offset_t data_current; - long err = _pipe.current_region(&data_current, &pipe->data_end, &pipe->size); + long err = _pipe.current_region(&data_current, &pipe->size, &pipe->end_pos); if (err) return err; - pipe->end_pos = pipe->size; + _update_extent(pipe); /* Obtain the current position if synchronising position state. */ @@ -713,23 +713,26 @@ } /* Access the next region for a pipe endpoint, updating the eventual size of - the current region. */ + the current region if writing. */ long pipe_next(file_t *pipe) { client_Pipe _pipe(pipe->ref); - long err = _pipe.next_region(&pipe->data_end, &pipe->size); + offset_t size = pipe->data_current; + long err = _pipe.next_region(&size, &pipe->end_pos); if (err) return err; + pipe->size = size; + _update_extent(pipe); + if (pipe->memory != NULL) err = ipc_detach_dataspace(pipe->memory); if (err) return err; - pipe->end_pos = pipe->size; pipe->data_current = 0; pipe->memory = NULL;