summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2004-02-02 15:13:02 +0000
committerMike Frysinger <vapier@gentoo.org>2004-02-02 15:13:02 +0000
commit1126dfa579daa4b621bd4e4b1d52c5a434bce776 (patch)
tree1a103d85bfa1b1cfa9684507313bc56e7f8c5971 /media-sound
parentNew version (diff)
downloadhistorical-1126dfa579daa4b621bd4e4b1d52c5a434bce776.tar.gz
historical-1126dfa579daa4b621bd4e4b1d52c5a434bce776.tar.bz2
historical-1126dfa579daa4b621bd4e4b1d52c5a434bce776.zip
http auth patch #40028
Diffstat (limited to 'media-sound')
-rw-r--r--media-sound/streamripper/ChangeLog7
-rw-r--r--media-sound/streamripper/files/1.32-http-auth.patch121
-rw-r--r--media-sound/streamripper/files/digest-streamripper-1.321
-rw-r--r--media-sound/streamripper/files/digest-streamripper-1.32-r22
-rw-r--r--media-sound/streamripper/streamripper-1.32-r2.ebuild (renamed from media-sound/streamripper/streamripper-1.32.ebuild)17
5 files changed, 142 insertions, 6 deletions
diff --git a/media-sound/streamripper/ChangeLog b/media-sound/streamripper/ChangeLog
index 45efb16d7734..6f24d1d6e56e 100644
--- a/media-sound/streamripper/ChangeLog
+++ b/media-sound/streamripper/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for media-sound/streamripper
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/streamripper/ChangeLog,v 1.4 2003/08/28 18:55:06 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/streamripper/ChangeLog,v 1.5 2004/02/02 15:13:02 vapier Exp $
+
+*streamripper-1.32-r2 (02 Feb 2004)
+
+ 02 Feb 2004; Mike Frysinger <vapier@gentoo.org> :
+ Add patch to support HTTP auth #40028 by Jay Tamboli.
*streamripper-1.32-r1 (28 Aug 2003)
diff --git a/media-sound/streamripper/files/1.32-http-auth.patch b/media-sound/streamripper/files/1.32-http-auth.patch
new file mode 100644
index 000000000000..e7792f5491c0
--- /dev/null
+++ b/media-sound/streamripper/files/1.32-http-auth.patch
@@ -0,0 +1,121 @@
+--- work.orig/streamripper-1.32/lib/types.h
++++ work/streamripper-1.32/lib/types.h
+@@ -33,6 +33,7 @@
+ #define MAX_URI_STRING 1024
+ #define MAX_ERROR_STR (4096)
+ #define MAX_USERAGENT_STR 1024
++#define MAX_AUTH_LEN 255
+
+ #ifdef WIN32
+ #ifndef _WINSOCKAPI_
+--- work.orig/streamripper-1.32/lib/http.c
++++ work/streamripper-1.32/lib/http.c
+@@ -41,6 +41,8 @@
+ /*********************************************************************************
+ * Private functions
+ *********************************************************************************/
++static char* make_auth_header(const char *header_name,
++ const char *username, const char *password);
+ char* b64enc(const char *buf, int size);
+
+
+@@ -72,6 +74,11 @@
+ if (ret < 2) return SR_ERROR_PARSE_FAILURE;
+ url = strchr(url, '@') + 1;
+ }
++ else
++ {
++ urlinfo->username[0] = '\0';
++ urlinfo->password[0] = '\0';
++ }
+
+ //
+ // search for a port seperator
+@@ -115,33 +122,58 @@
+ "GET %s HTTP/1.0\r\n"
+ "Host: %s:%d\r\n"
+ "User-Agent: %s\r\n"
+- "Icy-MetaData:1\r\n"
+- "Accept: */*\r\n",
++ "Icy-MetaData:1\r\n",
+ myurl,
+ ui.host,
+ ui.port,
+ useragent[0] ? useragent : "Streamripper/1.x");
+
+ //
++ // http authentication (not proxy, see below for that)
++ //
++ if (ui.username[0] && ui.password[0])
++ {
++ char *authbuf = make_auth_header("Authorization",
++ ui.username,
++ ui.password);
++ strcat(buffer, authbuf);
++ free(authbuf);
++ }
++
++ //
+ // proxy auth stuff
+ //
+ if (proxyurl && proxyui.username[0] && proxyui.password[0])
+ {
+- char *authbuf = malloc(strlen(proxyui.username)+strlen(proxyui.password)+MAX_URI_STRING);
+- char *auth64;
+-
+- sprintf(authbuf, "%s:%s", proxyui.username, proxyui.password);
+- auth64= b64enc(authbuf, strlen(authbuf));
+- sprintf(authbuf, "Proxy-Authorization: Basic %s\r\n", auth64);
+-
++ char *authbuf = make_auth_header("Proxy-Authorization",
++ proxyui.username,
++ proxyui.password);
+ strcat(buffer, authbuf);
++ free(authbuf);
+ }
+-
++
+ strcat(buffer, "\r\n");
+
+- return SR_SUCCESS;
++ return SR_SUCCESS;
+ }
+
++// Make the 'Authorization: Basic xxxxxx\r\n' or 'Proxy-Authorization...'
++// headers for the HTTP request.
++static char* make_auth_header(const char *header_name,
++ const char *username, const char *password)
++{
++ char *authbuf = malloc(strlen(header_name)
++ + strlen(username)
++ + strlen(password)
++ + MAX_URI_STRING);
++ char *auth64;
++ sprintf(authbuf, "%s:%s", username, password);
++ auth64 = b64enc(authbuf, strlen(authbuf));
++ sprintf(authbuf, "%s: Basic %s\r\n", header_name, auth64);
++ free(auth64);
++ return authbuf;
++}
++
+ // Here we pretend we're IE 5, hehe
+ error_code httplib_construct_page_request(const char *url, BOOL proxyformat, char *buffer)
+ {
+--- work.orig/streamripper-1.32/CHANGES
++++ work/streamripper-1.32/CHANGES
+@@ -1,3 +1,15 @@
++new in cvs
++----------
++
++2003/09/25:
++* Added support for HTTP "Basic" authorization. Works with DigitallyImported.com.
++ (lib/types.h, lib/http.c) -Colin D. Bennett <cbennett@radsoft.com>
++* Fixed a couple of tiny memory leaks in the usage of b64enc(), the
++ returned buffer allocated as 'string' in b64enc wasn't being freed,
++ and the 'authbuf' malloc'd in httplib_construct_sc_request for the
++ proxy authorization wasn't freed.
++ (lib/http.c) -Colin D. Bennett <cbennett@radsoft.com>
++
+ new in 1.30b (win32 & nix)
+ --------------
+
diff --git a/media-sound/streamripper/files/digest-streamripper-1.32 b/media-sound/streamripper/files/digest-streamripper-1.32
deleted file mode 100644
index 037cadf15bd6..000000000000
--- a/media-sound/streamripper/files/digest-streamripper-1.32
+++ /dev/null
@@ -1 +0,0 @@
-MD5 ca5330602427126d6848a6fdcf4e0079 streamripper-1.32.tar.gz 98092
diff --git a/media-sound/streamripper/files/digest-streamripper-1.32-r2 b/media-sound/streamripper/files/digest-streamripper-1.32-r2
new file mode 100644
index 000000000000..bcedf25623b0
--- /dev/null
+++ b/media-sound/streamripper/files/digest-streamripper-1.32-r2
@@ -0,0 +1,2 @@
+MD5 ca5330602427126d6848a6fdcf4e0079 streamripper-1.32.tar.gz 98092
+MD5 d15851ff8ad67819065127932d1e47bb streamripper-1.32-interface.patch.bz2 3281
diff --git a/media-sound/streamripper/streamripper-1.32.ebuild b/media-sound/streamripper/streamripper-1.32-r2.ebuild
index f43ad9ab4668..4ffa2c1e249f 100644
--- a/media-sound/streamripper/streamripper-1.32.ebuild
+++ b/media-sound/streamripper/streamripper-1.32-r2.ebuild
@@ -1,17 +1,26 @@
-# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/streamripper/streamripper-1.32.ebuild,v 1.5 2003/09/07 00:06:06 msterret Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/streamripper/streamripper-1.32-r2.ebuild,v 1.1 2004/02/02 15:13:02 vapier Exp $
+
+inherit eutils
DESCRIPTION="Extracts and records individual MP3 file tracks from shoutcast streams"
HOMEPAGE="http://streamripper.sourceforge.net/"
-SRC_URI="http://streamripper.sourceforge.net/files/${P}.tar.gz"
+SRC_URI="http://streamripper.sourceforge.net/files/${P}.tar.gz
+ mirror://gentoo/${P}-interface.patch.bz2"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="x86 ppc"
+KEYWORDS="~x86 ~ppc"
DEPEND="virtual/glibc"
+src_unpack() {
+ unpack ${A}
+ epatch ${P}-interface.patch
+ epatch ${FILESDIR}/${PV}-http-auth.patch
+}
+
src_compile() {
econf || die
emake || die