1.1 --- a/libfsclient/lib/src/file.cc Fri May 10 22:09:15 2024 +0200
1.2 +++ b/libfsclient/lib/src/file.cc Sat May 11 00:10:59 2024 +0200
1.3 @@ -683,12 +683,12 @@
1.4 {
1.5 client_Pipe _pipe(pipe->ref);
1.6 offset_t data_current;
1.7 - long err = _pipe.current_region(&data_current, &pipe->data_end, &pipe->size);
1.8 + long err = _pipe.current_region(&data_current, &pipe->size, &pipe->end_pos);
1.9
1.10 if (err)
1.11 return err;
1.12
1.13 - pipe->end_pos = pipe->size;
1.14 + _update_extent(pipe);
1.15
1.16 /* Obtain the current position if synchronising position state. */
1.17
1.18 @@ -713,23 +713,26 @@
1.19 }
1.20
1.21 /* Access the next region for a pipe endpoint, updating the eventual size of
1.22 - the current region. */
1.23 + the current region if writing. */
1.24
1.25 long pipe_next(file_t *pipe)
1.26 {
1.27 client_Pipe _pipe(pipe->ref);
1.28 - long err = _pipe.next_region(&pipe->data_end, &pipe->size);
1.29 + offset_t size = pipe->data_current;
1.30 + long err = _pipe.next_region(&size, &pipe->end_pos);
1.31
1.32 if (err)
1.33 return err;
1.34
1.35 + pipe->size = size;
1.36 + _update_extent(pipe);
1.37 +
1.38 if (pipe->memory != NULL)
1.39 err = ipc_detach_dataspace(pipe->memory);
1.40
1.41 if (err)
1.42 return err;
1.43
1.44 - pipe->end_pos = pipe->size;
1.45 pipe->data_current = 0;
1.46 pipe->memory = NULL;
1.47