changeset 1439:bd0b46c8a70e trunk

[svn] - i believe we've got it!
author nenolod
date Fri, 28 Jul 2006 00:46:34 -0700
parents ce0285d8cede
children acdc12679d1a
files ChangeLog libaudacious/beepctrl.c
diffstat 2 files changed, 26 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jul 28 00:33:37 2006 -0700
+++ b/ChangeLog	Fri Jul 28 00:46:34 2006 -0700
@@ -1,3 +1,12 @@
+2006-07-28 07:33:37 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [1790]
+  - make the remote API actually work
+  
+
+  Changes:        Modified:
+  +9 -6           trunk/libaudacious/beepctrl.c  
+
+
 2006-07-28 07:16:07 +0000  William Pitcock <nenolod@nenolod.net>
   revision [1788]
   - add audacious_set_session_uri().
--- a/libaudacious/beepctrl.c	Fri Jul 28 00:33:37 2006 -0700
+++ b/libaudacious/beepctrl.c	Fri Jul 28 00:46:34 2006 -0700
@@ -313,7 +313,6 @@
 
     if (audacious_session_uri != NULL)
     {
-        printf("%p\n", audacious_session_uri);
 	return audacious_session_uri;
     }
 
@@ -347,11 +346,16 @@
 void
 audacious_decode_tcp_uri(gint session, gchar *in, gchar **host, gint *port, gchar **key)
 {
-    static gchar workbuf[1024], keybuf[1024];
+    static gchar *workbuf, *keybuf;
     gint iport;
+    gchar *tmp = g_strdup(in);
 
     /* split out the host/port and key */
-    sscanf(in, "tcp://%s/%s", workbuf, keybuf);
+    tmp += 6;
+    workbuf = tmp;
+
+    keybuf = strchr(tmp, '/');
+    *keybuf++ = '\0';
 
     *key = keybuf;
 
@@ -371,14 +375,19 @@
 
 /* unix://localhost/tmp/audacious_nenolod.0 */
 void
-audacious_decode_unix_uri(gint session, gchar *in, gchar **out)
+audacious_decode_unix_uri(gint session, gchar *in, gchar **key)
 {
-    static gchar workbuf[1024], pathbuf[1024];
+    static gchar *workbuf, *keybuf;
+    gchar *tmp = g_strdup(in);
 
-    /* retrieve the pathbuf */
-    sscanf(in, "unix://%s/%s", workbuf, pathbuf);
+    /* split out the host/port and key */
+    tmp += 7;
+    workbuf = tmp;
 
-    *out = pathbuf;
+    keybuf = strchr(tmp, '/');
+    *keybuf++ = '\0';
+
+    *key = keybuf;
 }
 
 gint
@@ -403,10 +412,6 @@
 	    
 	    audacious_decode_unix_uri(session, uri, &path);
 
-/*
-            g_snprintf(saddr.sun_path, 108, "%s/%s_%s.%d", g_get_tmp_dir(),
-                       CTRLSOCKET_NAME, g_get_user_name(), session);
- */
 	    g_strlcpy(saddr.sun_path, path, 108);
             setreuid(stored_uid, euid);
             if (connect(fd, (struct sockaddr *) &saddr, sizeof(saddr)) != -1)