~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/include/private/svn_cache.h

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
   * May be 0 if that information is not available.
174
174
   */
175
175
  apr_uint64_t total_entries;
 
176
 
 
177
  /** Number of index buckets with the given number of entries.
 
178
   * Bucket sizes larger than the array will saturate into the
 
179
   * highest array index.
 
180
   */
 
181
  apr_uint64_t histogram[32];
176
182
} svn_cache__info_t;
177
183
 
178
184
/**
251
257
 * Given @a config, returns an APR memcached interface in @a
252
258
 * *memcache_p allocated in @a result_pool if @a config contains entries in
253
259
 * the SVN_CACHE_CONFIG_CATEGORY_MEMCACHED_SERVERS section describing
254
 
 * memcached servers; otherwise, sets @a *memcache_p to NULL.
 
260
 * memcached servers; otherwise, sets @a *memcache_p to NULL.  Use
 
261
 * @a scratch_pool for temporary allocations.
255
262
 *
256
263
 * If Subversion was not built with apr_memcache_support, then raises
257
264
 * SVN_ERR_NO_APR_MEMCACHE if and only if @a config is configured to
260
267
svn_error_t *
261
268
svn_cache__make_memcache_from_config(svn_memcache_t **memcache_p,
262
269
                                     svn_config_t *config,
263
 
                                     apr_pool_t *result_pool);
 
270
                                     apr_pool_t *result_pool,
 
271
                                     apr_pool_t *scratch_pool);
264
272
 
265
273
/**
266
274
 * Creates a new membuffer cache object in @a *cache. It will contain
303
311
                                  apr_pool_t *result_pool);
304
312
 
305
313
/**
 
314
 * @defgroup Standard priority classes for #svn_cache__create_membuffer_cache.
 
315
 * @{
 
316
 */
 
317
 
 
318
/**
 
319
 * Data in this priority class should not be removed from the cache unless
 
320
 * absolutely necessary.  Use of this should be very restricted.
 
321
 */
 
322
#define SVN_CACHE__MEMBUFFER_HIGH_PRIORITY   10000
 
323
 
 
324
/**
 
325
 * Data in this priority class has a good chance to remain in cache unless
 
326
 * there is more data in this class than the cache's capacity.  Use of this
 
327
 * as the default for all information that is costly to fetch from disk.
 
328
 */
 
329
#define SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY 1000
 
330
 
 
331
/**
 
332
 * Data in this priority class will be removed as soon as the cache starts
 
333
 * filling up.  Use of this for ephemeral data that can easily be acquired
 
334
 * again from other sources.
 
335
 */
 
336
#define SVN_CACHE__MEMBUFFER_LOW_PRIORITY      100
 
337
 
 
338
/** @} */
 
339
 
 
340
/**
306
341
 * Creates a new cache in @a *cache_p, storing the data in a potentially
307
342
 * shared @a membuffer object.  The elements in the cache will be indexed
308
343
 * by keys of length @a klen, which may be APR_HASH_KEY_STRING if they
310
345
 * serialize_func and deserialized using @a deserialize_func.  Because
311
346
 * the same memcache object may cache many different kinds of values
312
347
 * form multiple caches, @a prefix should be specified to differentiate
313
 
 * this cache from other caches.  @a *cache_p will be allocated in @a result_pool.
 
348
 * this cache from other caches.  All entries written through this cache
 
349
 * interface will be assigned into the given @a priority class.  @a *cache_p
 
350
 * will be allocated in @a result_pool.  @a scratch_pool is used for
 
351
 * temporary allocations.
314
352
 *
315
353
 * If @a deserialize_func is NULL, then the data is returned as an
316
354
 * svn_stringbuf_t; if @a serialize_func is NULL, then the data is
329
367
                                  svn_cache__deserialize_func_t deserialize,
330
368
                                  apr_ssize_t klen,
331
369
                                  const char *prefix,
 
370
                                  apr_uint32_t priority,
332
371
                                  svn_boolean_t thread_safe,
333
 
                                  apr_pool_t *result_pool);
 
372
                                  apr_pool_t *result_pool,
 
373
                                  apr_pool_t *scratch_pool);
334
374
 
335
375
/**
336
376
 * Sets @a handler to be @a cache's error handling routine.  If any
375
415
               apr_pool_t *result_pool);
376
416
 
377
417
/**
 
418
 * Looks for an entry indexed by @a key in @a cache,  setting @a *found
 
419
 * to TRUE if an entry has been found and FALSE otherwise.  @a key may be
 
420
 * NULL in which case @a *found will be FALSE.  Temporary allocations will
 
421
 * be made from @a scratch_pool.
 
422
 */
 
423
svn_error_t *
 
424
svn_cache__has_key(svn_boolean_t *found,
 
425
                   svn_cache__t *cache,
 
426
                   const void *key,
 
427
                   apr_pool_t *scratch_pool);
 
428
 
 
429
/**
378
430
 * Stores the value @a value under the key @a key in @a cache.  Uses @a
379
431
 * scratch_pool for temporary allocations.  The cache makes copies of
380
432
 * @a key and @a value if necessary (that is, @a key and @a value may
465
517
 
466
518
/**
467
519
 * Return the information given in @a info formatted as a multi-line string.
468
 
 * Allocations take place in @a result_pool.
 
520
 * If @a access_only has been set, size and fill-level statistics will be
 
521
 * omitted.  Allocations take place in @a result_pool.
469
522
 */
470
523
svn_string_t *
471
524
svn_cache__format_info(const svn_cache__info_t *info,
 
525
                       svn_boolean_t access_only,
472
526
                       apr_pool_t *result_pool);
473
527
 
474
 
/* Access the process-global (singleton) membuffer cache. The first call
 
528
/**
 
529
 * Access the process-global (singleton) membuffer cache. The first call
475
530
 * will automatically allocate the cache using the current cache config.
476
531
 * NULL will be returned if the desired cache size is 0.
477
532
 *
480
535
struct svn_membuffer_t *
481
536
svn_cache__get_global_membuffer_cache(void);
482
537
 
 
538
/**
 
539
 * Return total access and size stats over all membuffer caches as they
 
540
 * share the underlying data buffer.  The result will be allocated in POOL.
 
541
 */
 
542
svn_cache__info_t *
 
543
svn_cache__membuffer_get_global_info(apr_pool_t *pool);
 
544
 
 
545
/**
 
546
 * Remove all current contents from CACHE.
 
547
 *
 
548
 * NOTE:  In a multi-threaded environment, new contents may have been put
 
549
 * into the cache by the time this function returns.
 
550
 */
 
551
svn_error_t *
 
552
svn_cache__membuffer_clear(svn_membuffer_t *cache);
 
553
 
483
554
/** @} */
484
555
 
485
556