Bug 1350 - make cachedb backend configurable
make cachedb backend configurable
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
unspecified
Other All
: P5 enhancement
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-14 23:05 CEST by JINMEI Tatuya
Modified: 2017-07-17 10:21 CEST (History)
2 users (show)

See Also:


Attachments
proposed patch (5.03 KB, application/octet-stream)
2017-07-14 23:05 CEST, JINMEI Tatuya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JINMEI Tatuya 2017-07-14 23:05:54 CEST
Created attachment 425 [details]
proposed patch

I'd like to propose the attached patch.  It implements the following TODO of
the cachedb module:

cachedb_apply_cfg(struct cachedb_env* cachedb_env, struct config_file* cfg)
{
	const char* backend_str = "testframe"; /* TODO get from cfg */

I chose to implement it in a separate config section 'cachedb:' in case
it might be used other apps than the unbound server, but that's not a
strong opinion.  If this was a bad choice I'm happy to update the patch.

Basically it doesn't change the behavior - it still only recognizes the
'testframe' backend, which is the default.  But there are a couple of
minor modifications:

- an empty backend name is now refused.  again, not a strong opinion
  but I didn't think of any useful case of it (this is different from
  the default) and I thought it rather confusing to silently ignore
  such a case.
- it fixed a minor typo in the error log message: s/'%s/'%s'/

The patch cleanly applies to svn trunk revision 4274, the updated code
compiled and passed both 'make test' and 'make longtest'.

note: I intentionally excluded autogenerated files by lex and yacc
as they would just make it less readable and I guess you'll re-generate
them anyway.
Comment 1 Wouter Wijngaards 2017-07-17 10:21:53 CEST
Hi JINMEI,

Thank you for the patch!  I have applied it.

Best regards, Wouter