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

Function rewriteConfigBindOption

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

Rewrite the bind option. */

Source from the content-addressed store, hash-verified

1522
1523/* Rewrite the bind option. */
1524void rewriteConfigBindOption(struct rewriteConfigState *state) {
1525 int force = 1;
1526 sds line, addresses;
1527 char *option = "bind";
1528
1529 /* Nothing to rewrite if we don't have bind addresses. */
1530 if (server.bindaddr_count == 0) {
1531 rewriteConfigMarkAsProcessed(state,option);
1532 return;
1533 }
1534
1535 /* Rewrite as bind <addr1> <addr2> ... <addrN> */
1536 addresses = sdsjoin(server.bindaddr,server.bindaddr_count," ");
1537 line = sdsnew(option);
1538 line = sdscatlen(line, " ", 1);
1539 line = sdscatsds(line, addresses);
1540 sdsfree(addresses);
1541
1542 rewriteConfigRewriteLine(state,option,line,force);
1543}
1544
1545/* Glue together the configuration lines in the current configuration
1546 * rewrite state into a single string, stripping multiple empty lines. */

Callers 1

rewriteConfigFunction · 0.85

Calls 7

sdsjoinFunction · 0.85
sdsnewFunction · 0.85
sdscatlenFunction · 0.85
sdscatsdsFunction · 0.85
sdsfreeFunction · 0.85
rewriteConfigRewriteLineFunction · 0.85

Tested by

no test coverage detected