Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Baptiste Kempf
libaacs
Commits
98b269ad
Commit
98b269ad
authored
May 06, 2015
by
npzacs
Browse files
Remove unused cache_get_or_update()
parent
7decb647
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/file/keydbcfg.c
View file @
98b269ad
...
...
@@ -534,42 +534,6 @@ int cache_remove(const char *name)
return
result
;
}
void
*
cache_get_or_update
(
const
char
*
type
,
const
void
*
data
,
uint32_t
*
len
,
uint32_t
version
)
{
uint32_t
cache_len
,
cache_version
;
uint8_t
*
cache_data
=
NULL
;
/* get cache version */
cache_get
(
type
,
&
cache_version
,
&
cache_len
,
NULL
);
/* if cached data is later, use it */
if
(
cache_len
&&
cache_version
>
version
)
{
cache_data
=
malloc
(
cache_len
);
if
(
cache_get
(
type
,
&
cache_version
,
&
cache_len
,
cache_data
))
{
BD_DEBUG
(
DBG_AACS
,
"Using cached %s. Version: %d
\n
"
,
type
,
cache_version
);
*
len
=
cache_len
;
return
cache_data
;
}
/* read failed, fall back to older version */
X_FREE
(
cache_data
);
}
if
(
data
)
{
cache_data
=
malloc
(
*
len
);
memcpy
(
cache_data
,
data
,
*
len
);
/* cached data is older, update cache */
if
(
cache_version
<
version
)
{
cache_save
(
type
,
version
,
data
,
*
len
);
BD_DEBUG
(
DBG_AACS
,
"Updated cached %s. Version: %d
\n
"
,
type
,
version
);
}
}
return
cache_data
;
}
int
config_save
(
const
char
*
name
,
const
void
*
data
,
uint32_t
len
)
{
char
*
path
=
NULL
;
...
...
src/file/keydbcfg.h
View file @
98b269ad
...
...
@@ -131,8 +131,6 @@ BD_PRIVATE int cache_get(const char *name, uint32_t *version, uint32_t *len, voi
BD_PRIVATE
int
cache_save
(
const
char
*
name
,
uint32_t
version
,
const
void
*
data
,
uint32_t
len
);
BD_PRIVATE
int
cache_remove
(
const
char
*
name
);
BD_PRIVATE
void
*
cache_get_or_update
(
const
char
*
type
,
const
void
*
data
,
uint32_t
*
len
,
uint32_t
version
);
BD_PRIVATE
int
config_get
(
const
char
*
name
,
uint32_t
*
len
,
void
*
buf
);
/* use buf=NULL to get size */
BD_PRIVATE
int
config_save
(
const
char
*
name
,
const
void
*
data
,
uint32_t
len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment