FreeBSD/contrib/subversion/subversion/libsvn_ra_serf/update.c
/* Stream close function for collecting body */
Stream close function for collecting body
Stream close function for collecting body
static svn_error_t *
body_done_fn(void *baton)
{
  body_create_baton_t *bcb = baton;
  if (bcb->file)
    {
      SVN_ERR(svn_io_file_flush(bcb->file, bcb->scratch_pool));
      apr_file_buffer_set(bcb->file, NULL, 0);
    }
  else if (bcb->collect_bucket)
    bcb->all_data = body_allocate_all(bcb, bcb->result_pool);
  if (bcb->scratch_pool)
    svn_pool_destroy(bcb->scratch_pool);
  return SVN_NO_ERROR;
}
static svn_error_t * body_done_fn ( void * baton ) { body_create_baton_t * bcb = baton ; if ( bcb -> file ) { SVN_ERR ( svn_io_file_flush ( bcb -> file , bcb -> scratch_pool ) ) ; apr_file_buffer_set ( bcb -> file , NULL , 0 ) ; } else if ( bcb -> collect_bucket ) bcb -> all_data = body_allocate_all ( bcb , bcb -> result_pool ) ; if ( bcb -> scratch_pool ) svn_pool_destroy ( bcb -> scratch_pool ) ; return SVN_NO_ERROR ; }
Stream close function for collecting body
Stream close function for collecting body
/* We need to flush the file, make it unbuffered (so that it can be
        * zero-copied via mmap), and reset the position before attempting
        * to deliver the file.
        *
        * N.B. If we have APR 1.3+, we can unbuffer the file to let us use
        * mmap and zero-copy the PUT body.  However, on older APR versions,
        * we can't check the buffer status; but serf will fall through and
        * create a file bucket for us on the buffered handle.
        */