]> git.ipfire.org Git - thirdparty/asterisk.git/commit
db.c: Remove limit on family/key length
authorGeorge Joseph <gjoseph@sangoma.com>
Wed, 11 Sep 2024 16:06:17 +0000 (10:06 -0600)
committerGeorge Joseph <gjoseph@sangoma.com>
Fri, 20 Sep 2024 14:06:30 +0000 (14:06 +0000)
commit52cdfbbb64ce3c2ac146d94e70e47d267fe9a795
tree43b55b8e3b58ad7f4622915c339d7e20c7dc9686
parent6469f83909e73213bedff5ddff06869409d7e3ab
db.c: Remove limit on family/key length

Consumers like media_cache have been running into issues with
the previous astdb "/family/key" limit of 253 bytes when needing
to store things like long URIs.  An Amazon S3 URI is a good example
of this.  Now, instead of using a static 256 byte buffer for
"/family/key", we use ast_asprintf() to dynamically create it.

Both test_db.c and test_media_cache.c were also updated to use
keys/URIs over the old 253 character limit.

Resolves: #881

UserNote: The `ast_db_*()` APIs have had the 253 byte limit on
"/family/key" removed and will now accept families and keys with a
total length of up to SQLITE_MAX_LENGTH (currently 1e9!).  This
affects the `DB*` dialplan applications, dialplan functions,
manager actions and `databse` CLI commands.  Since the
media_cache also uses the `ast_db_*()` APIs, you can now store
resources with URIs longer than 253 bytes.
main/db.c
tests/test_db.c
tests/test_media_cache.c