Le 03/05/2020 à 20:33, Joseph C. Sible a écrit :
A question was recently asked on Stack Overflow about how to change a
server's port via Lua [1]. The Lua function Server.set_addr currently
says "See the management socket documentation for more information
about the format of the string." However, this is misleading: the
management socket's "set server .... addr" supports changing the port
with syntax like "192.0.2.1 port 8888", but that doesn't work in the
Lua function. It seems like it would be simple enough to change Lua to
use update_server_addr_port instead of update_server_addr, which would
let this work. I can think of two reasonable options for the Lua
interface:

1. Add a new optional argument to the function, so calls would look
like "server:set_addr("192.0.2.1", 8888)
2. Parse the existing argument like the management socket does, so
calls would look like "server:set_addr("192.0.2.1 port 8888")

Is this something that would be accepted if I wrote a patch for it? If
so, which option should I go with for the Lua interface?

[1]: https://stackoverflow.com/q/61568148/7509065


Hi,

It seems to be reasonable. And, the first option is definitely better. Your patch will be welcome.

Thanks,
--
Christopher Faulet

Reply via email to