MCPcopy Create free account
hub / github.com/F-Stack/f-stack / stringConfigSet

Function stringConfigSet

app/redis-6.2.6/src/config.c:1800–1812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1798}
1799
1800static int stringConfigSet(typeData data, sds value, int update, const char **err) {
1801 if (data.string.is_valid_fn && !data.string.is_valid_fn(value, err))
1802 return 0;
1803 char *prev = *data.string.config;
1804 *data.string.config = (data.string.convert_empty_to_null && !value[0]) ? NULL : zstrdup(value);
1805 if (update && data.string.update_fn && !data.string.update_fn(*data.string.config, prev, err)) {
1806 zfree(*data.string.config);
1807 *data.string.config = prev;
1808 return 0;
1809 }
1810 zfree(prev);
1811 return 1;
1812}
1813
1814static void stringConfigGet(client *c, typeData data) {
1815 addReplyBulkCString(c, *data.string.config ? *data.string.config : "");

Callers

nothing calls this directly

Calls 2

zstrdupFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected