You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by bl...@apache.org on 2013/05/14 19:53:19 UTC
svn commit: r1482494 - in /subversion/branches/1.8.x-r1469519-and-friends:
./ subversion/libsvn_subr/cache-inprocess.c
Author: blair
Date: Tue May 14 17:53:19 2013
New Revision: 1482494
URL: http://svn.apache.org/r1482494
Log:
n the 1.8.x-r1469519-and-friends branch: merge r1481848 from trunk.
Revert changes in configure.ac.
Modified:
subversion/branches/1.8.x-r1469519-and-friends/ (props changed)
subversion/branches/1.8.x-r1469519-and-friends/subversion/libsvn_subr/cache-inprocess.c
Propchange: subversion/branches/1.8.x-r1469519-and-friends/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1481848
Modified: subversion/branches/1.8.x-r1469519-and-friends/subversion/libsvn_subr/cache-inprocess.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1469519-and-friends/subversion/libsvn_subr/cache-inprocess.c?rev=1482494&r1=1482493&r2=1482494&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1469519-and-friends/subversion/libsvn_subr/cache-inprocess.c (original)
+++ subversion/branches/1.8.x-r1469519-and-friends/subversion/libsvn_subr/cache-inprocess.c Tue May 14 17:53:19 2013
@@ -190,7 +190,6 @@ inprocess_cache_get_internal(char **buff
{
struct cache_entry *entry = apr_hash_get(cache->hash, key, cache->klen);
- *buffer = NULL;
if (entry)
{
SVN_ERR(move_page_to_front(cache, entry->page));
@@ -201,6 +200,11 @@ inprocess_cache_get_internal(char **buff
*size = entry->size;
}
+ else
+ {
+ *buffer = NULL;
+ *size = 0;
+ }
return SVN_NO_ERROR;
}
@@ -213,25 +217,33 @@ inprocess_cache_get(void **value_p,
apr_pool_t *result_pool)
{
inprocess_cache_t *cache = cache_void;
- char* buffer = NULL;
- apr_size_t size = 0;
if (key)
- SVN_MUTEX__WITH_LOCK(cache->mutex,
- inprocess_cache_get_internal(&buffer,
- &size,
- cache,
- key,
- result_pool));
+ {
+ char* buffer;
+ apr_size_t size;
- /* deserialize the buffer content. Usually, this will directly
- modify the buffer content directly.
- */
- *value_p = NULL;
- *found = buffer != NULL;
- return buffer && size
- ? cache->deserialize_func(value_p, buffer, size, result_pool)
- : SVN_NO_ERROR;
+ SVN_MUTEX__WITH_LOCK(cache->mutex,
+ inprocess_cache_get_internal(&buffer,
+ &size,
+ cache,
+ key,
+ result_pool));
+ /* deserialize the buffer content. Usually, this will directly
+ modify the buffer content directly. */
+ *found = (buffer != NULL);
+ if (!buffer || !size)
+ *value_p = NULL;
+ else
+ return cache->deserialize_func(value_p, buffer, size, result_pool);
+ }
+ else
+ {
+ *value_p = NULL;
+ *found = FALSE;
+ }
+
+ return SVN_NO_ERROR;
}
/* Removes PAGE from the LRU list, removes all of its entries from