FreeBSD/contrib/subversion/subversion/libsvn_ra_serf/update.c
/* Process pending data from the update report, if any */
Process pending data from the update report, if any
Process pending data from the update report if any
static svn_error_t *
process_pending(update_delay_baton_t *udb,
                apr_pool_t *scratch_pool)
{
  apr_pool_t *iterpool = NULL;
  serf_bucket_alloc_t *alloc = NULL;
  while ((udb->report->num_active_fetches + udb->report->num_active_propfinds)
            < REQUEST_COUNT_TO_RESUME)
    {
      const char *data;
      apr_size_t len;
      svn_boolean_t at_eof;
      svn_error_t *err;
      if (!iterpool)
        {
          iterpool = svn_pool_create(scratch_pool);
          alloc = serf_bucket_allocator_create(scratch_pool, NULL, NULL);
        }
      else
        svn_pool_clear(iterpool);
      SVN_ERR(svn_spillbuf__read(&data, &len, udb->spillbuf, iterpool));
      if (data == NULL && !udb->report->report_received)
        break;
      else if (data == NULL)
        at_eof = TRUE;
      else
        at_eof = FALSE;
      err = process_buffer(udb, NULL , data, len,
                           at_eof, alloc, iterpool);
      if (err && APR_STATUS_IS_EAGAIN(err->apr_err))
        {
          svn_error_clear(err); 
        }
      else if (err && APR_STATUS_IS_EOF(err->apr_err))
        {
          svn_error_clear(err);
          svn_pool_destroy(iterpool);
          udb->spillbuf = NULL;
          return SVN_NO_ERROR;
        }
      else if (err)
        return svn_error_trace(err);
    }
  if (iterpool)
    svn_pool_destroy(iterpool);
  return SVN_NO_ERROR;
}
static svn_error_t * process_pending ( update_delay_baton_t * udb , apr_pool_t * scratch_pool ) { apr_pool_t * iterpool = NULL ; serf_bucket_alloc_t * alloc = NULL ; while ( ( udb -> report -> num_active_fetches + udb -> report -> num_active_propfinds ) < REQUEST_COUNT_TO_RESUME ) { const char * data ; apr_size_t len ; svn_boolean_t at_eof ; svn_error_t * err ; if ( ! iterpool ) { iterpool = svn_pool_create ( scratch_pool ) ; alloc = serf_bucket_allocator_create ( scratch_pool , NULL , NULL ) ; } else svn_pool_clear ( iterpool ) ; SVN_ERR ( svn_spillbuf__read ( & data , & len , udb -> spillbuf , iterpool ) ) ; if ( data == NULL && ! udb -> report -> report_received ) break ; else if ( data == NULL ) at_eof = TRUE ; else at_eof = FALSE ; err = process_buffer ( udb , NULL , data , len , at_eof , alloc , iterpool ) ; if ( err && APR_STATUS_IS_EAGAIN ( err -> apr_err ) ) { svn_error_clear ( err ) ; } else if ( err && APR_STATUS_IS_EOF ( err -> apr_err ) ) { svn_error_clear ( err ) ; svn_pool_destroy ( iterpool ) ; udb -> spillbuf = NULL ; return SVN_NO_ERROR ; } else if ( err ) return svn_error_trace ( err ) ; } if ( iterpool ) svn_pool_destroy ( iterpool ) ; return SVN_NO_ERROR ; }
Process pending data from the update report, if any
Process pending data from the update report if any
/* allowed? */ /* Throttling is working */