diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-09-13 00:28:16 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-09-13 00:28:16 +0000 |
commit | 12315982066ee1044840b598624920f8028c7924 (patch) | |
tree | e44fa6e82f1de2863461e63746154bba4ea76bfa /polyp | |
parent | b1ab6869fbe705f06faa12310c76b7d856030d81 (diff) |
fix parsing of POLYP_SERVER environment variable
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@196 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp')
-rw-r--r-- | polyp/Makefile.am | 5 | ||||
-rw-r--r-- | polyp/polyplib-context.c | 8 | ||||
-rw-r--r-- | polyp/socket-client.c | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/polyp/Makefile.am b/polyp/Makefile.am index 3f94c052..99c89491 100644 --- a/polyp/Makefile.am +++ b/polyp/Makefile.am @@ -63,6 +63,11 @@ polypinclude_HEADERS= \ sample.h \ glib-mainloop.h +### Warning! Due to an obscure bug in libtool/automake it is required +### that the libraries in modlib_LTLIBRARIES are specified in-order, +### i.e. libraries near the end of the list depend on libraries near +### the head, and not the other way! + modlib_LTLIBRARIES= \ libsocket-util.la \ libiochannel.la \ diff --git a/polyp/polyplib-context.c b/polyp/polyplib-context.c index a15e4257..63b42eb3 100644 --- a/polyp/polyplib-context.c +++ b/polyp/polyplib-context.c @@ -336,11 +336,15 @@ finish: static struct sockaddr *resolve_server(const char *server, size_t *len) { struct sockaddr *sa; struct addrinfo hints, *result = NULL; - char *port; + char *port, host[256]; assert(server && len); + snprintf(host, sizeof(host), "%s", server); + host[strcspn(host, ":")] = 0; + if ((port = strrchr(server, ':'))) port++; + if (!port) port = DEFAULT_PORT; @@ -349,7 +353,7 @@ static struct sockaddr *resolve_server(const char *server, size_t *len) { hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; - if (getaddrinfo(server, port, &hints, &result) != 0) + if (getaddrinfo(host, port, &hints, &result) != 0) return NULL; assert(result); diff --git a/polyp/socket-client.c b/polyp/socket-client.c index 773e922c..fbc259ff 100644 --- a/polyp/socket-client.c +++ b/polyp/socket-client.c @@ -84,7 +84,7 @@ static void do_call(struct pa_socket_client *c) { } if (error != 0) { - pa_log(__FILE__": connect(): %s\n", strerror(error)); +/* pa_log(__FILE__": connect(): %s\n", strerror(error)); */ goto finish; } |