* Replace udns with c-ares
* Get IO loop work
* Clean up
* Avoid initializing nameservers each query
* Add ARES_OPT_SERVERS
* Refine resolv_cancel
* Fix a memory leak
* Replace udns.h with ares.h
* Fix all inet_* fucntions
* Clean up
* Enable servers_ports when VERSION_MINOR >= 11
* Avoid ares_inet_XtoX
* Handle multipe nameservers correctly
* Use ares_set_servers for IPv4 and IPv6 mixed list
* Refine c-ares for udprelay
* Refine ares_set_servers()
* Refine the timer based on ares_timeout
* Avoid resolv_cancel
* Fix an issue of null pointer
* Fix another null pointer issue
* Refine the order of resolv_shutdown
* Fix the corrupted ev io
In a few places `malloc` was being used without checking the return for
a `NULL` pointer. There's already a wrapper (`ss_malloc`) in
`util.c` that performs this check and exits if it fails so this commit
replaces the unsafe `malloc`s with `ss_malloc`s.
Two functions `construct_udprealy_header` and `parse_udprealy_header`
contained typos and should be `construct_udprelay_header` and
`parse_udprelay_header` respectively. This commit updates these function
names and the respective callers.
Sometimes we need processes to run in the foreground to be supervised
and at the same time use syslog facility instead of logging its stdout,
stderr output
* Fix#1518 config file with wrong json format
Removing trailing "," to make the configuration file compliant with JSON specification
* Remove extra "," in json file
* server_port should be integer instead of string
server_port in generated json configuration file should be integer instead of string
* Add list active service ports feature
A new management API has been added to list all active service ports.
* Make list API output JSON compliant
In the following format:
[
{ "server_port":"8388","password":"password"},
...
]
Note that server_port value is string instead of integer for easy display on the console.
* Make safe room for the new list entry
"\n\t{\"server_port\":\"%s\",\"password\":\"%s\"},"
Reserve 50 char spaces for the extra characters in the above.
* Output method for each service port in list API
* Fix#1518 config file with wrong json format
Removing trailing "," to make the configuration file compliant with JSON specification
* Remove extra "," in json file
* server_port should be integer instead of string
server_port in generated json configuration file should be integer instead of string
* Add list active service ports feature
A new management API has been added to list all active service ports.
* Make list API output JSON compliant
In the following format:
[
{ "server_port":"8388","password":"password"},
...
]
Note that server_port value is string instead of integer for easy display on the console.
* Make safe room for the new list entry
"\n\t{\"server_port\":\"%s\",\"password\":\"%s\"},"
Reserve 50 char spaces for the extra characters in the above.
* Fix#1518 config file with wrong json format
Removing trailing "," to make the configuration file compliant with JSON specification
* Remove extra "," in json file
* server_port should be integer instead of string
server_port in generated json configuration file should be integer instead of string
The ``<sys/socket.h>`` header should be included in ``src/netutils.h``
before the usage of ``struct sockaddr_storage``, otherwise build failed
with errors such as:
```
In file included from udprelay.c:53:0:
netutils.h:68:22: error: 'struct sockaddr_storage' declared inside parameter list [-Werror]
int ipv6first);
^
netutils.h:68:22: error: its scope is only this definition or declaration, which is probably not what you want [-Werror]
```
Tested on DragonFly BSD 4.9-development and Debian Linux testing.