]> code.delx.au - pulseaudio/commitdiff
fix parsing of POLYP_SERVER environment variable
authorLennart Poettering <lennart@poettering.net>
Mon, 13 Sep 2004 00:28:16 +0000 (00:28 +0000)
committerLennart Poettering <lennart@poettering.net>
Mon, 13 Sep 2004 00:28:16 +0000 (00:28 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@196 fefdeb5f-60dc-0310-8127-8f9354f1896f

doc/todo
polyp/Makefile.am
polyp/polyplib-context.c
polyp/socket-client.c

index f9d9bedc3e13fdcf74c05bf28b2770b29b235e72..c09d423aae2047b15322ad254a58e434a40fdecc 100644 (file)
--- a/doc/todo
+++ b/doc/todo
 - option to use default fragment size on alsa drivers
 - lazy sample cache
 - per-channel volume
-- fix or work around libtool bug
 - merge pa_context_connect_*
 - input latency
-- fix public=
-- fix POLYP_SERVER=foo:4711
 - fix tcp/native
 - suid
 
index 3f94c052811efbb8e0b2273239d3c7b50d76c647..99c894913e9cdc420f124a5600757486baeccfff 100644 (file)
@@ -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 \
index a15e4257dd0e8c1efd22beb574669f369ca6c016..63b42eb3e0022ef69ae68aa3036b2a83eceadec1 100644 (file)
@@ -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);
     
index 773e922c0e7f7b16492170ca9423d65ce65bd6d9..fbc259ff55961351aa77d49bc32e11b6cd6d9be1 100644 (file)
@@ -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;
     }