Closed seinocluster2 closed 12 years ago
The converted string(host name -> ip) is set to the pointer of "ip_str". So, the result is stored to the passed argument. At least, I tested this behavior in my environment. Do you output a error ?
Did you do the unit test on the "else" block? If you pass a real hostname or real IP, they go into the "if" block, that's OK. But if it is not that case, in "else" block, the site_arg is the predefined array, it will not be the content of that hostname. So "ip_str = hostname" cannot work as expected here;) Maybe you should use string copy method to resolve this.
Also, it will be better if you replace AF_INET with the macro BOOTH_PROTO_FAMILY, this is not a must, but just to be aligned with previous code;)
I see. I added a commit. How is that? I have a question. What kind of c standard do you use? for example, c89, c99, etc. In some cases, I may need to fix the code.
This patch also can use the host name when we specify a site in booth client command.
For example
Signed-off-by: Yuich SEINO seino.cluster2@gmail.com