Rewrite the bind option. */
| 1781 | |
| 1782 | /* Rewrite the bind option. */ |
| 1783 | void rewriteConfigBindOption(struct rewriteConfigState *state) { |
| 1784 | int force = 1; |
| 1785 | sds line, addresses; |
| 1786 | const char *option = "bind"; |
| 1787 | |
| 1788 | /* Nothing to rewrite if we don't have bind addresses. */ |
| 1789 | if (g_pserver->bindaddr_count == 0) { |
| 1790 | rewriteConfigMarkAsProcessed(state,option); |
| 1791 | return; |
| 1792 | } |
| 1793 | |
| 1794 | /* Rewrite as bind <addr1> <addr2> ... <addrN> */ |
| 1795 | addresses = sdsjoin(g_pserver->bindaddr,g_pserver->bindaddr_count," "); |
| 1796 | line = sdsnew(option); |
| 1797 | line = sdscatlen(line, " ", 1); |
| 1798 | line = sdscatsds(line, addresses); |
| 1799 | sdsfree(addresses); |
| 1800 | |
| 1801 | rewriteConfigRewriteLine(state,option,line,force); |
| 1802 | } |
| 1803 | |
| 1804 | /* Glue together the configuration lines in the current configuration |
| 1805 | * rewrite state into a single string, stripping multiple empty lines. */ |
no test coverage detected