changeset 719:be03e09c7c20 trunk

[svn] - always bail on http streams
author nenolod
date Sat, 24 Feb 2007 10:57:24 -0800
parents d252f02a9beb
children 0357863b3631
files ChangeLog src/scrobbler/plugin.c
diffstat 2 files changed, 14 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Feb 24 10:53:12 2007 -0800
+++ b/ChangeLog	Sat Feb 24 10:57:24 2007 -0800
@@ -1,3 +1,11 @@
+2007-02-24 18:53:12 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [1522]
+  - remove leftovers
+  
+  trunk/src/curl/curl.c |    2 --
+  1 file changed, 2 deletions(-)
+
+
 2007-02-24 18:32:25 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [1520]
   - store proxy info
--- a/src/scrobbler/plugin.c	Sat Feb 24 10:53:12 2007 -0800
+++ b/src/scrobbler/plugin.c	Sat Feb 24 10:57:24 2007 -0800
@@ -12,6 +12,7 @@
 #include <audacious/playlist.h>
 #include <audacious/configdb.h>
 #include <audacious/beepctrl.h>
+#include <audacious/strings.h>
 
 #include <unistd.h>
 #include <stdio.h>
@@ -205,19 +206,7 @@
 
 static char ishttp(const char *a)
 {
-	char *tmp, *bp;
-	int status = 0;
-
-	if (!a || !*a)
-		return 0;
-
-	tmp = strdup(a);
-	for (bp = tmp; *bp; bp++)
-		*bp = toupper((int) *bp);
-	if (strstr(tmp, "HTTP://"))
-		status = -1;
-	free(tmp);
-	return status;
+	return str_has_prefix_nocase(a, "http://");
 }
 
 /* Following code thanks to nosuke 
@@ -254,6 +243,10 @@
 	pos_c = xmms_remote_get_playlist_pos(XS_CS);
 	/* current file name */
 	file_c = xmms_remote_get_playlist_file(XS_CS, pos_c); 
+
+	if (ishttp(file_c))
+		return dosubmit;
+
 	/* total number */
 	playlistlen_c = xmms_remote_get_playlist_length(XS_CS);
 	/* current playtime */