Rewrite the bind option. */
| 1522 | |
| 1523 | /* Rewrite the bind option. */ |
| 1524 | void 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. */ |
no test coverage detected