Remove unused hostname resolution in shm plugins and aserver

PCM and control shm plugins and aserver have some codes to resolve the
host address and check whether it's a local host although the given
address is never used.  In addition, the code contains gethostbyname()
that is known to be obsoleted.  So, let's get rid of all these unused
codes.

The host configuration item is still accepted (but just ignored) for
keeping the compatibility.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2015-01-28 16:21:14 +01:00
parent 6ea14c3624
commit dbb7eca655
5 changed files with 6 additions and 175 deletions

View file

@ -1013,11 +1013,10 @@ int main(int argc, char **argv)
snd_config_t *conf;
snd_config_iterator_t i, next;
const char *sockname = NULL;
const char *host = NULL;
long port = -1;
int err;
char *srvname;
struct hostent *h;
command = argv[0];
while ((c = getopt_long(argc, argv, "h", long_options, 0)) != -1) {
switch (c) {
@ -1055,14 +1054,8 @@ int main(int argc, char **argv)
continue;
if (strcmp(id, "comment") == 0)
continue;
if (strcmp(id, "host") == 0) {
err = snd_config_get_string(n, &host);
if (err < 0) {
ERROR("Invalid type for %s", id);
return 1;
}
if (strcmp(id, "host") == 0)
continue;
}
if (strcmp(id, "socket") == 0) {
err = snd_config_get_string(n, &sockname);
if (err < 0) {
@ -1082,19 +1075,6 @@ int main(int argc, char **argv)
ERROR("Unknown field %s", id);
return 1;
}
if (!host) {
ERROR("host is not defined");
return 1;
}
h = gethostbyname(host);
if (!h) {
ERROR("Cannot resolve %s", host);
return 1;
}
if (!snd_is_local(h)) {
ERROR("%s is not the local host", host);
return 1;
}
if (!sockname && port < 0) {
ERROR("either socket or port need to be defined");
return 1;