swim: allow to omit host in URI
Before the patch swim.cfg() was returning an error on an attempt to use URI like 'port', without a host. But it would be useful, easy, and short to allow that, and use '127.0.0.1' host by default. Compare: swim:cfg({uri = 1234}) vs swim:cfg({uri = '127.0.0.1:1234'}) It is remarkable that box.cfg{listen} also allows to omit host. Note, that use '0.0.0.0' (INADDR_ANY) is forbidden. Otherwise 1) Different instances interacting with this one via not the same interfaces would see different source IP addresses. It would mess member tables; 2) This instance would not be able to encode its IP address in the meta section, because it has no a fixed IP. At the same time omission of it and usage of UDP header source address is not possible as well, because UDP header is not encrypted and therefore is not safe to look at. Part of #3234
Showing
- src/lib/core/sio.c 2 additions, 1 deletionsrc/lib/core/sio.c
- src/lib/core/sio.h 1 addition, 1 deletionsrc/lib/core/sio.h
- src/lib/swim/swim.c 27 additions, 2 deletionssrc/lib/swim/swim.c
- src/lib/swim/swim.h 2 additions, 1 deletionsrc/lib/swim/swim.h
- test/unit/sio.c 20 additions, 9 deletionstest/unit/sio.c
- test/unit/sio.result 18 additions, 14 deletionstest/unit/sio.result
Loading
Please register or sign in to comment