box: implement ability to pass several URIs in different ways
Previously, for "listen" and "replication" options URI can be passed as a number, as a string value or as a table, which contains numbers and strings, no special properties for URIs was available. Now user can pass URIs in different ways, same as in tarantool "uri" library: as before, as a table which contains URI and it's parameters in "param" table, as a table which contains URI strings and URI tables. Same as in "uri" library, which internally used to parse new "listen" and "replication" there are different ways to specify properties for URI: in a string which contains URI, after '?' delimiter, in a table which contains URI in "params" table, in "default_params" table if it is default parameters for all URIs. Closes #5928 @TarantoolBot document Title: implement ability to pass several URIs in different ways Now there are several ways to pass multiple URIs for box.cfg.listen and box.cfg.replication: ```lua -- As a string with one or several URIs separated by commas -- (provides backward compatibility): box.cfg { listen = "127.0.0.1:3301, /unix.sock, 3302" } -- As an array which contains string URIs (unambiguous short form): box.cfg { listen = {"127.0.0.1:3301", "/unix.sock", "3302"} } -- As an array of tables with 'uri' field -- (may be extended with more fields in future): box.cfg { listen = { {uri = "127.0.0.1:3301"}, {uri = "/unix.sock"}, {uri = 3302} } } ```
Showing
- src/box/applier.cc 3 additions, 12 deletionssrc/box/applier.cc
- src/box/applier.h 1 addition, 2 deletionssrc/box/applier.h
- src/box/box.cc 51 additions, 57 deletionssrc/box/box.cc
- src/box/iproto.cc 2 additions, 2 deletionssrc/box/iproto.cc
- src/box/iproto.h 3 additions, 1 deletionsrc/box/iproto.h
- src/box/lua/load_cfg.lua 2 additions, 27 deletionssrc/box/lua/load_cfg.lua
- src/cfg.c 10 additions, 0 deletionssrc/cfg.c
- src/cfg.h 9 additions, 0 deletionssrc/cfg.h
- src/lib/core/coio.c 2 additions, 3 deletionssrc/lib/core/coio.c
- src/lib/core/coio.h 1 addition, 1 deletionsrc/lib/core/coio.h
- src/lib/core/evio.c 19 additions, 33 deletionssrc/lib/core/evio.c
- src/lib/core/evio.h 1 addition, 1 deletionsrc/lib/core/evio.h
- src/lib/uri/uri.c 1 addition, 1 deletionsrc/lib/uri/uri.c
- src/lib/uri/uri.h 7 additions, 0 deletionssrc/lib/uri/uri.h
- src/lua/uri.c 1 addition, 4 deletionssrc/lua/uri.c
- src/lua/uri.h 7 additions, 0 deletionssrc/lua/uri.h
- test/box-tap/several-listening-sockets.test.lua 195 additions, 1 deletiontest/box-tap/several-listening-sockets.test.lua
Loading
Please register or sign in to comment