aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testing/darwin-streaming-server/APKBUILD84
-rw-r--r--testing/darwin-streaming-server/darwin-streaming-server.post-install4
-rw-r--r--testing/darwin-streaming-server/dss-6.0.3.patch381
-rw-r--r--testing/darwin-streaming-server/dss-hh-20080728-1.patch302
-rw-r--r--testing/darwin-streaming-server/dss.initd98
5 files changed, 869 insertions, 0 deletions
diff --git a/testing/darwin-streaming-server/APKBUILD b/testing/darwin-streaming-server/APKBUILD
new file mode 100644
index 0000000000..fd17e6d816
--- /dev/null
+++ b/testing/darwin-streaming-server/APKBUILD
@@ -0,0 +1,84 @@
+# Contributor: Francesco Colista <francesco.colista@gmail.com>
+# Maintainer: Francesco Colista <francesco.colista@gmail.com>
+pkgname=darwin-streaming-server
+_pkgname=DarwinStreamingSrvr
+pkgver=6.0.3
+pkgrel=0
+pkgdesc="Open source version of Apple's QuickTime Streaming Server technology"
+url="http://dss.macosforge.org/"
+arch="all"
+license="Custom"
+depends="perl"
+depends_dev="perl"
+makedepends="$depends_dev"
+install="$pkgname.post-install"
+subpackages="$pkgname-doc"
+pkgfroups="qtss"
+source="http://dss.macosforge.org/downloads/DarwinStreamingSrvr6.0.3-Source.tar
+ dss-hh-20080728-1.patch
+ dss-6.0.3.patch
+ dss.initd"
+_builddir="$srcdir"/"$_pkgname$pkgver-Source"
+
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ ./Buildit || return 1
+}
+
+package() {
+ cd "$_builddir"
+ mkdir -p "$pkgdir"/usr/bin
+ mkdir -p "$pkgdir"/usr/sbin
+ mkdir -p "$pkgdir"/var/run/darwinstreaming
+ mkdir -p "$pkgdir"/var/darwinstreaming
+ mkdir -p -m 775 "$pkgdir/var/darwinstreaming/movies"
+ mkdir -p -m 770 "$pkgdir/var/darwinstreaming/playlists"
+ mkdir -p "$pkgdir/usr/sbin/StreamingServerModules"
+ install -D -m0755 "$srcdir"/dss.initd "$pkgdir/etc/init.d/dss"
+ install -D -m 644 APPLE_LICENSE "$pkgdir/usr/share/licenses/$pkgname/APPLE_LICENSE"
+ install ./StreamingLoadTool/StreamingLoadTool "$pkgdir/usr/bin/StreamingLoadTool"
+ install ./WebAdmin/src/streamingadminserver.pl "$pkgdir/usr/sbin/streamingadminserver.pl"
+ install -D -m 600 relayconfig.xml-Sample "$pkgdir/etc/darwinstreaming/relayconfig.xml-Sample"
+ echo "realm Streaming Server" > "$pkgdir/etc/darwinstreaming/qtusers"
+ chmod 600 "$pkgdir/etc/darwinstreaming/qtusers"
+ echo "admin: " > "$pkgdir/etc/darwinstreaming/qtgroups"
+ chmod 600 "$pkgdir/etc/darwinstreaming/qtgroups"
+ install -m 644 -D ./Documentation/readme.txt "$pkgdir/var/darwinstreaming/readme.txt"
+ install -m 644 ./Documentation/3rdPartyAcknowledgements.rtf "$pkgdir/var/darwinstreaming/3rdPartyAcknowledgements.rtf"
+ install -m 644 sample_100kbit.mov "$pkgdir/var/darwinstreaming/movies/sample_100kbit.mov"
+ install -m 644 sample_300kbit.mov "$pkgdir/var/darwinstreaming/movies/sample_300kbit.mov"
+ install -m 644 sample_100kbit.mp4 "$pkgdir/var/darwinstreaming/movies/sample_100kbit.mp4"
+ install -m 644 sample_300kbit.mp4 "$pkgdir/var/darwinstreaming/movies/sample_300kbit.mp4"
+ install -m 644 sample.mp3 "$pkgdir/var/darwinstreaming/movies/sample.mp3"
+ install -m 644 sample_50kbit.3gp "$pkgdir/var/darwinstreaming/movies/sample_50kbit.3gp"
+ install -m 644 sample_h264_100kbit.mp4 "$pkgdir/var/darwinstreaming/movies/sample_h264_100kbit.mp4"
+ install -m 644 sample_h264_300kbit.mp4 "$pkgdir/var/darwinstreaming/movies/sample_h264_300kbit.mp4"
+ install -m 644 sample_h264_1mbit.mp4 "$pkgdir/var/darwinstreaming/movies/sample_h264_1mbit.mp4"
+ install -m 644 StreamingLoadTool/streamingloadtool.conf "$pkgdir/etc/darwinstreaming/loadtool.conf"
+ cp -f -r ./WebAdmin/WebAdminHtml "$pkgdir/var/darwinstreaming"
+ mv "$pkgdir/var/darwinstreaming/WebAdminHtml" "$pkgdir/var/darwinstreaming/AdminHtml"
+ install -m 644 ./WebAdmin/streamingadminserver_Darwin.conf "$pkgdir/etc/darwinstreaming/adminserver.conf"
+}
+
+md5sums="ca676691db8417d05121699c0ca3d549 DarwinStreamingSrvr6.0.3-Source.tar
+4a55c16f291f60056f38ee687680c769 dss-hh-20080728-1.patch
+ee10f86fd27ef2da68782414e30cd226 dss-6.0.3.patch
+aeb9cff914e598fa1a96c9e34d9ad535 dss.initd"
+sha256sums="7bf75ced3f603f55c6f7601bfecd9f26393ea98be821d24169f2091843706522 DarwinStreamingSrvr6.0.3-Source.tar
+ed2c25242c862bade182c1329c84b6003c6d5ed31ef6a00fc7364d224bad137a dss-hh-20080728-1.patch
+13741e14f704d3b0db00100c9213ff0bec104403622905e92f370d846bf8f2ea dss-6.0.3.patch
+f1e84078fe122a9e0debb3508e959b4f8bd7655bdb0cce25b32b7a477c0d61f0 dss.initd"
+sha512sums="f507c8e01ca6f81e1d00a85fb137486d026817015178593c2a5de1dde34f809bc48b1348ea661a94ee0913811d23d0c204d28c29af0c1c9d69bd31eeefd9af85 DarwinStreamingSrvr6.0.3-Source.tar
+2706e75e8ffca0096f2cd53b5c0d3a8b5577766fac9bbfa9c03a894c18ea13f01117adca52e6f539233971ccc283c2751d02e8a8cd44427c07b2569e9369bfd0 dss-hh-20080728-1.patch
+299e330fd39a263ffebb573b9c5c8b264b203ba9cab108d074f34234491f25d84a929c3bfee045655abdb2564ea8201c0abebbdc36d5ee70399b3684a8c23f50 dss-6.0.3.patch
+16755dcd3625f21ac6ab138e1a5b5c8589b9dc46add974065786db764dbd02f734f945aeb6f05e7b3d4cc80c804d2c1c8ac21e6e41264b3b9445687bad9b418c dss.initd"
diff --git a/testing/darwin-streaming-server/darwin-streaming-server.post-install b/testing/darwin-streaming-server/darwin-streaming-server.post-install
new file mode 100644
index 0000000000..bfd9a90c75
--- /dev/null
+++ b/testing/darwin-streaming-server/darwin-streaming-server.post-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+addgroup -S qtss &>/dev/null
+adduser -s /bin/false -G qtss -h /var/darwinstreaming -S -D qtss &>/dev/null
+exit 0
diff --git a/testing/darwin-streaming-server/dss-6.0.3.patch b/testing/darwin-streaming-server/dss-6.0.3.patch
new file mode 100644
index 0000000000..87dac4cc1b
--- /dev/null
+++ b/testing/darwin-streaming-server/dss-6.0.3.patch
@@ -0,0 +1,381 @@
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/APICommonCode/QTAccessFile.cpp DarwinStreamingSrvr6.0.3-Source/APICommonCode/QTAccessFile.cpp
+--- DarwinStreamingSrvr6.0.3-Source.orig/APICommonCode/QTAccessFile.cpp 2008-05-06 01:28:57.000000000 +0200
++++ DarwinStreamingSrvr6.0.3-Source/APICommonCode/QTAccessFile.cpp 2008-05-24 03:23:13.000000000 +0200
+@@ -46,7 +46,9 @@
+
+
+ #include <grp.h>
++#ifdef __MacOSX__
+ #include <membership.h>
++#endif
+ #include <pwd.h>
+ #include <signal.h>
+ #include <unistd.h>
+@@ -613,6 +615,7 @@
+
+ bool DSAccessFile::CheckGroupMembership(const char* inUsername, const char* inGroupName)
+ {
++#ifdef __MacOSX__
+ // In Tiger, group membership is painfully simple: we ask memberd for it!
+ struct passwd *user = NULL;
+ struct group *group = NULL;
+@@ -641,6 +644,9 @@
+ if ( mbr_check_membership(userID, groupID, &isMember) )
+ return false;
+ return (bool)isMember;
++#else
++ return true;
++#endif
+ }
+
+ Bool16 DSAccessFile::ValidUser( char*userName, void* extraDataPtr)
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/CommonUtilitiesLib/OSHeaders.h DarwinStreamingSrvr6.0.3-Source/CommonUtilitiesLib/OSHeaders.h
+--- DarwinStreamingSrvr6.0.3-Source.orig/CommonUtilitiesLib/OSHeaders.h 2008-05-06 01:28:59.000000000 +0200
++++ DarwinStreamingSrvr6.0.3-Source/CommonUtilitiesLib/OSHeaders.h 2008-05-24 02:05:15.000000000 +0200
+@@ -120,7 +120,6 @@
+
+
+ #elif __linux__ || __linuxppc__ || __FreeBSD__
+-
+ /* Defines */
+ #define _64BITARG_ "q"
+ #define _S64BITARG_ "lld"
+@@ -128,9 +127,13 @@
+ #if __LP64__
+ #define _S32BITARG_ "d"
+ #define _U32BITARG_ "u"
++ #define _SPOINTERSIZEARG_ _S64BITARG_
++ #define _UPOINTERSIZEARG_ _U64BITARG_
+ #else
+- #define _S32BITARG_ "ld"
+- #define _U32BITARG_ "lu"
++ #define _S32BITARG_ "d"
++ #define _U32BITARG_ "u"
++ #define _SPOINTERSIZEARG_ _S32BITARG_
++ #define _UPOINTERSIZEARG_ _U32BITARG_
+ #endif
+
+ /* paths */
+@@ -141,6 +144,7 @@
+
+ /* Includes */
+ #include <sys/types.h>
++ #include <stdint.h>
+
+ /* Constants */
+ #define QT_TIME_TO_LOCAL_TIME (-2082844800)
+@@ -149,14 +153,14 @@
+ /* Typedefs */
+ typedef signed long PointerSizedInt;
+ typedef unsigned long PointerSizedUInt;
+- typedef unsigned char UInt8;
+- typedef signed char SInt8;
+- typedef unsigned short UInt16;
+- typedef signed short SInt16;
+- typedef unsigned int UInt32;
+- typedef signed int SInt32;
+- typedef signed int int SInt64;
+- typedef unsigned int int UInt64;
++ typedef uint8_t UInt8;
++ typedef int8_t SInt8;
++ typedef uint16_t UInt16;
++ typedef int16_t SInt16;
++ typedef uint32_t UInt32;
++ typedef int32_t SInt32;
++ typedef int64_t SInt64;
++ typedef uint64_t UInt64;
+ typedef float Float32;
+ typedef double Float64;
+ typedef UInt16 Bool16;
+@@ -177,11 +181,14 @@
+
+ #define TW0_CHARS_TO_INT( c1, c2 ) ( c1 << 8 | c2 )
+
++ #define kSInt16_Max USHRT_MAX
++ #define kUInt16_Max USHRT_MAX
+
++ #define kSInt32_Max LONG_MAX
++ #define kUInt32_Max ULONG_MAX
+
+-
+-
+-
++ #define kSInt64_Max LONG_LONG_MAX
++ #define kUInt64_Max ULONG_LONG_MAX
+
+ #elif __Win32__
+
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/CommonUtilitiesLib/OSRef.h DarwinStreamingSrvr6.0.3-Source/CommonUtilitiesLib/OSRef.h
+--- DarwinStreamingSrvr6.0.3-Source.orig/CommonUtilitiesLib/OSRef.h 2008-05-06 01:28:59.000000000 +0200
++++ DarwinStreamingSrvr6.0.3-Source/CommonUtilitiesLib/OSRef.h 2008-05-23 22:28:51.000000000 +0200
+@@ -45,6 +45,7 @@
+ #include "StrPtrLen.h"
+ #include "OSHashTable.h"
+ #include "OSCond.h"
++#include "OSHeaders.h"
+
+ class OSRefKey;
+
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/Makefile.POSIX DarwinStreamingSrvr6.0.3-Source/Makefile.POSIX
+--- DarwinStreamingSrvr6.0.3-Source.orig/Makefile.POSIX 2007-11-16 06:17:59.000000000 +0100
++++ DarwinStreamingSrvr6.0.3-Source/Makefile.POSIX 2008-05-24 07:19:34.000000000 +0200
+@@ -42,7 +42,6 @@
+ CCFLAGS += -IRTPMetaInfoLib
+ CCFLAGS += -IPrefsSourceLib
+ CCFLAGS += -IServer.tproj
+-
+ # EACH DIRECTORY WITH A STATIC LIBRARY MUST BE APPENDED IN THIS MANNER TO THE LINKOPTS
+
+ LINKOPTS = -LCommonUtilitiesLib
+@@ -52,38 +51,42 @@
+
+ CFILES = CommonUtilitiesLib/daemon.c
+
+-CPPFILES = Server.tproj/QTSSExpirationDate.cpp\
++CPPFILES = Server.tproj/GenerateXMLPrefs.cpp \
++ Server.tproj/main.cpp \
+ Server.tproj/QTSSCallbacks.cpp \
+- Server.tproj/QTSSDictionary.cpp\
+ Server.tproj/QTSSDataConverter.cpp \
++ Server.tproj/QTSSDictionary.cpp \
+ Server.tproj/QTSSErrorLogModule.cpp \
+- Server.tproj/QTSSMessages.cpp\
++ Server.tproj/QTSServer.cpp \
++ Server.tproj/QTSServerInterface.cpp \
++ Server.tproj/QTSServerPrefs.cpp \
++ Server.tproj/QTSSExpirationDate.cpp \
++ Server.tproj/QTSSFile.cpp \
++ Server.tproj/QTSSMessages.cpp \
+ Server.tproj/QTSSModule.cpp \
+- Server.tproj/QTSServerPrefs.cpp\
+- Server.tproj/QTSSSocket.cpp\
+- Server.tproj/QTSSFile.cpp\
+ Server.tproj/QTSSPrefs.cpp \
+- Server.tproj/QTSServer.cpp\
+- Server.tproj/QTSServerInterface.cpp \
+- Server.tproj/RTCPTask.cpp\
+- Server.tproj/RTPSession.cpp \
+- Server.tproj/RTPPacketResender.cpp \
++ Server.tproj/QTSSSocket.cpp \
++ Server.tproj/QTSSUserProfile.cpp \
++ Server.tproj/RTCPTask.cpp \
+ Server.tproj/RTPBandwidthTracker.cpp \
+ Server.tproj/RTPOverbufferWindow.cpp \
+- Server.tproj/RTPSessionInterface.cpp\
++ Server.tproj/RTPPacketResender.cpp \
++ Server.tproj/RTPSession3GPP.cpp \
++ Server.tproj/RTPSession.cpp \
++ Server.tproj/RTPSessionInterface.cpp \
++ Server.tproj/RTPStream3gpp.cpp \
+ Server.tproj/RTPStream.cpp \
+- Server.tproj/RTSPProtocol.cpp\
++ Server.tproj/RTSPProtocol.cpp \
++ Server.tproj/RTSPRequest3GPP.cpp \
+ Server.tproj/RTSPRequest.cpp \
+- Server.tproj/RTSPRequestInterface.cpp\
++ Server.tproj/RTSPRequestInterface.cpp \
+ Server.tproj/RTSPRequestStream.cpp \
+- Server.tproj/RTSPResponseStream.cpp\
++ Server.tproj/RTSPResponseStream.cpp \
++ Server.tproj/RTSPSession3GPP.cpp \
+ Server.tproj/RTSPSession.cpp \
+- Server.tproj/RTSPSessionInterface.cpp\
+- Server.tproj/main.cpp \
++ Server.tproj/RTSPSessionInterface.cpp \
+ Server.tproj/RunServer.cpp \
+- Server.tproj/GenerateXMLPrefs.cpp \
+- Server.tproj/QTSSUserProfile.cpp\
+- PrefsSourceLib/FilePrefsSource.cpp\
++ PrefsSourceLib/FilePrefsSource.cpp \
+ PrefsSourceLib/XMLPrefsParser.cpp \
+ PrefsSourceLib/XMLParser.cpp \
+ OSMemoryLib/OSMemory.cpp \
+@@ -91,17 +94,20 @@
+ RTSPClientLib/ClientSocket.cpp \
+ HTTPUtilitiesLib/HTTPProtocol.cpp \
+ HTTPUtilitiesLib/HTTPRequest.cpp \
+- RTCPUtilitiesLib/RTCPAPPPacket.cpp\
++ RTCPUtilitiesLib/RTCPAckPacket.cpp \
++ RTCPUtilitiesLib/RTCPAPPNADUPacket.cpp \
++ RTCPUtilitiesLib/RTCPAPPPacket.cpp \
++ RTCPUtilitiesLib/RTCPAPPQTSSPacket.cpp \
+ RTCPUtilitiesLib/RTCPPacket.cpp \
+- RTCPUtilitiesLib/RTCPSRPacket.cpp\
+- RTCPUtilitiesLib/RTCPAckPacket.cpp\
+- RTPMetaInfoLib/RTPMetaInfoPacket.cpp\
++ RTCPUtilitiesLib/RTCPSRPacket.cpp \
++ RTPMetaInfoLib/RTPMetaInfoPacket.cpp \
+ APIStubLib/QTSS_Private.cpp \
+ APICommonCode/QTSSModuleUtils.cpp\
+ APICommonCode/QTSSRollingLog.cpp \
+ APICommonCode/SDPSourceInfo.cpp \
+ APICommonCode/SourceInfo.cpp \
+ APICommonCode/QTAccessFile.cpp \
++ APICommonCode/QTSS3GPPModuleUtils.cpp \
+ SafeStdLib/InternalStdLib.cpp \
+ APIModules/QTSSAccessLogModule/QTSSAccessLogModule.cpp \
+ APIModules/QTSSFileModule/QTSSFileModule.cpp \
+@@ -129,7 +135,7 @@
+ APIModules/QTSSAccessModule/QTSSAccessModule.cpp \
+ APIModules/QTSSHttpFileModule/QTSSHttpFileModule.cpp \
+ APIModules/QTSSAccessModule/AccessChecker.cpp
+-
++
+ # CCFLAGS += $(foreach dir,$(HDRS),-I$(dir))
+
+ LIBFILES = QTFileLib/libQTFileLib.a \
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/RTSPClientLib/PlayerSimulator.h DarwinStreamingSrvr6.0.3-Source/RTSPClientLib/PlayerSimulator.h
+--- DarwinStreamingSrvr6.0.3-Source.orig/RTSPClientLib/PlayerSimulator.h 2008-05-06 01:29:00.000000000 +0200
++++ DarwinStreamingSrvr6.0.3-Source/RTSPClientLib/PlayerSimulator.h 2008-05-24 02:08:45.000000000 +0200
+@@ -31,7 +31,7 @@
+ #ifndef _PLAYERSIMULATOR_H_
+ #define _PLAYERSIMULATOR_H_
+
+-#include "SafeStdLib.h""
++#include "SafeStdLib.h"
+ #include "OSHeaders.h"
+ #include "OS.h"
+ #include "SVector.h"
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/QTSSErrorLogModule.cpp DarwinStreamingSrvr6.0.3-Source/Server.tproj/QTSSErrorLogModule.cpp
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/QTSSErrorLogModule.cpp 2008-05-06 01:28:59.000000000 +0200
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/QTSSErrorLogModule.cpp 2008-05-24 02:58:48.000000000 +0200
+@@ -265,7 +265,11 @@
+
+ sDupErrorStringCount = 0;
+ }
+- ::strlcpy(sLastErrorString, inParamBlock->errorParams.inBuffer, sizeof(sLastErrorString));
++#if __MacOSX__
++ strlcpy(sLastErrorString, inParamBlock->errorParams.inBuffer, sizeof(sLastErrorString));
++#else
++ strncpy(sLastErrorString, inParamBlock->errorParams.inBuffer, sizeof(sLastErrorString) -1);
++#endif
+
+ }
+
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/QTSServer.cpp DarwinStreamingSrvr6.0.3-Source/Server.tproj/QTSServer.cpp
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/QTSServer.cpp 2008-05-06 01:28:59.000000000 +0200
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/QTSServer.cpp 2008-05-24 07:24:39.000000000 +0200
+@@ -70,7 +70,9 @@
+ #include "QTSSAdminModule.h"
+ #include "QTSSAccessModule.h"
+ #include "QTSSMP3StreamingModule.h"
++#if __MacOSX__
+ #include "QTSSDSAuthModule.h"
++#endif
+ #if MEMORY_DEBUGGING
+ #include "QTSSWebDebugModule.h"
+ #endif
+@@ -85,7 +87,7 @@
+ #include "RTCPTask.h"
+ #include "QTSSFile.h"
+
+-#include "RTPStream3GPP.h"
++#include "RTPStream3gpp.h"
+ #include "RTSPRequest3GPP.h"
+
+ // CLASS DEFINITIONS
+@@ -680,9 +682,11 @@
+ (void)AddModule(theWebDebug);
+ #endif
+
++#if __MacOSX__
+ QTSSModule* theQTSSDSAuthModule = new QTSSModule("QTSSDSAuthModule");
+ (void)theQTSSDSAuthModule->SetupModule(&sCallbacks, &QTSSDSAuthModule_Main);
+ (void)AddModule(theQTSSDSAuthModule);
++#endif
+
+ QTSSModule* theQTACCESSmodule = new QTSSModule("QTSSAccessModule");
+ (void)theQTACCESSmodule->SetupModule(&sCallbacks, &QTSSAccessModule_Main);
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/RTPSession.cpp DarwinStreamingSrvr6.0.3-Source/Server.tproj/RTPSession.cpp
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/RTPSession.cpp 2008-05-06 01:28:59.000000000 +0200
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/RTPSession.cpp 2008-05-24 02:39:34.000000000 +0200
+@@ -38,7 +38,7 @@
+ #include "RTSPProtocol.h"
+ #include "QTSServerInterface.h"
+ #include "QTSS.h"
+-#include "RTSPRequest3gpp.h"
++#include "RTSPRequest3GPP.h"
+
+ #include "OS.h"
+ #include "OSMemory.h"
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/RTPStream3gpp.cpp DarwinStreamingSrvr6.0.3-Source/Server.tproj/RTPStream3gpp.cpp
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/RTPStream3gpp.cpp 2008-05-06 01:28:59.000000000 +0200
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/RTPStream3gpp.cpp 2008-05-24 02:48:52.000000000 +0200
+@@ -34,7 +34,7 @@
+ #include "RTPStream.h"
+ #include "RTPStream3gpp.h"
+ #include "RTPSessionInterface.h"
+-#include "RTSPRequest3gpp.h"
++#include "RTSPRequest3GPP.h"
+ #include "RTCPAPPNADUPacket.h"
+
+ #if DEBUG
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/RTPStream.h DarwinStreamingSrvr6.0.3-Source/Server.tproj/RTPStream.h
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/RTPStream.h 2008-05-06 01:28:59.000000000 +0200
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/RTPStream.h 2008-05-24 02:36:24.000000000 +0200
+@@ -57,7 +57,7 @@
+
+ #include "RTCPPacket.h"
+
+-#include "RTSPRequest3gpp.h"
++#include "RTSPRequest3GPP.h"
+
+ #ifndef MIN
+ #define MIN(a,b) (((a)<(b))?(a):(b))
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/RTSPRequest3GPP.cpp DarwinStreamingSrvr6.0.3-Source/Server.tproj/RTSPRequest3GPP.cpp
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/RTSPRequest3GPP.cpp 2008-05-06 01:28:59.000000000 +0200
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/RTSPRequest3GPP.cpp 2008-05-24 02:49:26.000000000 +0200
+@@ -32,7 +32,7 @@
+ */
+
+
+-#include "RTSPRequest3gpp.h"
++#include "RTSPRequest3GPP.h"
+ #include "RTSPProtocol.h"
+ #include "QTSServerInterface.h"
+
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/StreamingLoadTool/Makefile.POSIX DarwinStreamingSrvr6.0.3-Source/StreamingLoadTool/Makefile.POSIX
+--- DarwinStreamingSrvr6.0.3-Source.orig/StreamingLoadTool/Makefile.POSIX 2007-11-16 06:17:36.000000000 +0100
++++ DarwinStreamingSrvr6.0.3-Source/StreamingLoadTool/Makefile.POSIX 2008-05-24 02:32:03.000000000 +0200
+@@ -17,6 +17,7 @@
+ CCFLAGS += -I..
+ CCFLAGS += -I../OSMemoryLib
+ CCFLAGS += -I../RTSPClientLib
++CCFLAGS += -I../RTCPUtilitiesLib
+ CCFLAGS += -I../APICommonCode
+ CCFLAGS += -I../CommonUtilitiesLib
+ CCFLAGS += -I../PrefsSourceLib
+@@ -36,6 +37,12 @@
+ ../RTSPClientLib/ClientSocket.cpp \
+ ../RTSPClientLib/RTSPClient.cpp \
+ ../RTSPClientLib/ClientSession.cpp \
++ ../RTCPUtilitiesLib/RTCPAckPacket.cpp \
++ ../RTCPUtilitiesLib/RTCPAPPNADUPacket.cpp \
++ ../RTCPUtilitiesLib/RTCPAPPPacket.cpp \
++ ../RTCPUtilitiesLib/RTCPAPPQTSSPacket.cpp \
++ ../RTCPUtilitiesLib/RTCPPacket.cpp \
++ ../RTCPUtilitiesLib/RTCPSRPacket.cpp \
+ ../PrefsSourceLib/FilePrefsSource.cpp \
+ ../APICommonCode/SDPSourceInfo.cpp \
+ ../APICommonCode/SourceInfo.cpp \
+diff -ur --exclude='*~' DarwinStreamingSrvr6.0.3-Source.orig/StreamingLoadTool/StreamingLoadTool.cpp DarwinStreamingSrvr6.0.3-Source/StreamingLoadTool/StreamingLoadTool.cpp
+--- DarwinStreamingSrvr6.0.3-Source.orig/StreamingLoadTool/StreamingLoadTool.cpp 2008-05-06 01:28:57.000000000 +0200
++++ DarwinStreamingSrvr6.0.3-Source/StreamingLoadTool/StreamingLoadTool.cpp 2008-05-24 02:22:13.000000000 +0200
+@@ -743,7 +743,7 @@
+
+ bitsReceived += .5;
+
+- printf("%5lu %6lu %8lu %6lu %6lu %6lu %9.0fk\n",
++ printf("%5"_U32BITARG_" %6"_U32BITARG_" %8"_U32BITARG_" %6"_U32BITARG_" %6"_U32BITARG_" %6"_U32BITARG_" %9.0fk\n",
+ ClientSession:: GetActiveConnections (),
+ ClientSession:: GetPlayingConnections (),
+ ClientSession:: GetConnectionAttempts (),
+@@ -811,7 +811,7 @@
+ if (sLog != NULL)
+ ::fclose(sLog);
+
+- printf("%5lu %6lu %8lu %6lu %6lu %6lu %9.0fk\n",
++ printf("%5"_U32BITARG_" %6"_U32BITARG_" %8"_U32BITARG_" %6"_U32BITARG_" %6"_U32BITARG_" %6"_U32BITARG_" %9.0fk\n",
+ ClientSession:: GetActiveConnections (),
+ ClientSession:: GetPlayingConnections (),
+ ClientSession:: GetConnectionAttempts (),
diff --git a/testing/darwin-streaming-server/dss-hh-20080728-1.patch b/testing/darwin-streaming-server/dss-hh-20080728-1.patch
new file mode 100644
index 0000000000..d8475f686c
--- /dev/null
+++ b/testing/darwin-streaming-server/dss-hh-20080728-1.patch
@@ -0,0 +1,302 @@
+--- DarwinStreamingSrvr6.0.3-Source.orig/Buildit 2008-03-26 08:42:48.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/Buildit 2008-07-10 18:56:05.000000000 +0800
+@@ -86,14 +86,19 @@ case $PLAT in
+ ;;
+
+ Linux.i586 | \
+- Linux.i686)
++ Linux.i686 | \
++ Linux.x86_64 )
+ echo "Configuring for the "$OSNAME" "$HARDWARENAME" platform"
+ CPLUS=gcc
+ CCOMP=gcc
+ LINKER='gcc'
+ MAKE=make
+
+- COMPILER_FLAGS="-D_REENTRANT -D__USE_POSIX -D__linux__ -pipe"
++ if [ "$PLAT" = "Linux.x86_64" ]; then
++ COMPILER_FLAGS="-D_REENTRANT -D__USE_POSIX -D__linux__ -pipe -fPIC"
++ else
++ COMPILER_FLAGS="-D_REENTRANT -D__USE_POSIX -D__linux__ -pipe"
++ fi
+ INCLUDE_FLAG="-include"
+
+ CORE_LINK_LIBS="-lpthread -ldl -lstdc++ -lm -lcrypt"
+--- DarwinStreamingSrvr6.0.3-Source.orig/MP3Broadcaster/BroadcasterMain.cpp_orig 2008-07-03 20:51:14.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/MP3Broadcaster/BroadcasterMain.cpp 2008-07-03 20:51:47.000000000 +0800
+@@ -216,7 +216,7 @@ static void RegisterEventHandlers()
+
+ struct sigaction act;
+
+-#if defined(sun) || defined(i386) || defined(__MacOSX__) || defined(__sgi__) || defined(__osf__) || defined(__hpux__) || defined(__linuxppc__)
++#if defined(sun) || defined(i386) || defined(__MacOSX__) || defined(__sgi__) || defined(__osf__) || defined(__hpux__) || defined(__linuxppc__) || defined(__linux__)
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ act.sa_handler = (void(*)(int))&SignalEventHandler;
+--- DarwinStreamingSrvr6.0.3-Source.orig/PlaylistBroadcaster.tproj/PlaylistBroadcaster.cpp_orig 2008-07-03 20:42:56.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/PlaylistBroadcaster.tproj/PlaylistBroadcaster.cpp 2008-07-03 20:43:13.000000000 +0800
+@@ -2082,7 +2082,7 @@ static void RegisterEventHandlers()
+
+ struct sigaction act;
+
+-#if defined(sun) || defined(i386) || defined(__MacOSX__) || defined(__powerpc__) || defined (__sgi_cc__) || defined(__osf__) || defined(__hpux__)
++#if defined(sun) || defined(i386) || defined(__MacOSX__) || defined(__powerpc__) || defined (__sgi_cc__) || defined(__osf__) || defined(__hpux__) || defined(__linux__)
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ act.sa_handler = (void(*)(int))&SignalEventHandler;
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/main.cpp_orig 2008-07-03 20:38:56.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/main.cpp 2008-07-03 20:39:30.000000000 +0800
+@@ -216,7 +216,7 @@ int main(int argc, char * argv[])
+ //(void) ::signal(SIGPIPE, SIG_IGN);
+ struct sigaction act;
+
+-#if defined(sun) || defined(i386) || defined (__MacOSX__) || defined(__powerpc__) || defined (__osf__) || defined (__sgi_cc__) || defined (__hpux__)
++#if defined(sun) || defined(i386) || defined (__MacOSX__) || defined(__powerpc__) || defined (__osf__) || defined (__sgi_cc__) || defined (__hpux__) || defined (__linux__)
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ act.sa_handler = (void(*)(int))&sigcatcher;
+--- DarwinStreamingSrvr6.0.3-Source.orig/StreamingLoadTool/StreamingLoadTool.cpp_orig 2008-07-04 13:37:58.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/StreamingLoadTool/StreamingLoadTool.cpp 2008-07-04 13:38:16.000000000 +0800
+@@ -135,7 +135,7 @@ int main(int argc, char *argv[])
+ #ifndef __Win32__
+ struct sigaction act;
+
+-#if defined(sun) || defined(i386) || defined (__MacOSX__) || defined(__powerpc__) || defined (__osf__) || defined (__sgi_cc__) || defined (__hpux__)
++#if defined(sun) || defined(i386) || defined (__MacOSX__) || defined(__powerpc__) || defined (__osf__) || defined (__sgi_cc__) || defined (__hpux__) || defined (__linux__)
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ act.sa_handler = (void(*)(int))&sigcatcher;
+--- DarwinStreamingSrvr6.0.3-Source_orig/CommonUtilitiesLib/SocketUtils.cpp_orig 2008-07-22 13:27:28.026924464 +0800
++++ DarwinStreamingSrvr6.0.3-Source/CommonUtilitiesLib/SocketUtils.cpp 2008-07-22 13:33:57.944935981 +0800
+@@ -549,9 +549,6 @@ Bool16 SocketUtils::IncrementIfReqIter(c
+ //if the length of the addr is 0, use the family to determine
+ //what the addr size is
+ if (ifr->ifr_addr.sa_len == 0)
+-#else
+- *inIfReqIter += sizeof(ifr->ifr_name) + 0;
+-#endif
+ {
+ switch (ifr->ifr_addr.sa_family)
+ {
+@@ -565,6 +562,9 @@ Bool16 SocketUtils::IncrementIfReqIter(c
+ // return false;
+ }
+ }
++#else
++ *inIfReqIter += sizeof(*ifr);
++#endif
+ return true;
+ }
+ #endif
+--- DarwinStreamingSrvr6.0.3-Source_orig/CommonUtilitiesLib/Task.h_orig 2008-07-25 17:12:53.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/CommonUtilitiesLib/Task.h 2008-07-25 17:14:05.000000000 +0800
+@@ -213,7 +213,7 @@ private:
+ static UInt32 sNumShortTaskThreads;
+ static UInt32 sNumBlockingTaskThreads;
+
+- static OSMutexRW sMutexRW;
++ static OSMutexRW sMutexRW __attribute__((visibility("hidden")));
+
+ friend class Task;
+ friend class TaskThread;
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/QTSServer.cpp_orig 2008-07-24 10:00:06.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/QTSServer.cpp 2008-07-24 20:59:40.000000000 +0800
+@@ -135,13 +135,13 @@ QTSServer::~QTSServer()
+ //
+ // Grab the server mutex. This is to make sure all gets & set values on this
+ // object complete before we start deleting stuff
+- OSMutexLocker serverlocker(this->GetServerObjectMutex());
++ OSMutexLocker* serverlocker = new OSMutexLocker(this->GetServerObjectMutex());
+
+ //
+ // Grab the prefs mutex. This is to make sure we can't reread prefs
+ // WHILE shutting down, which would cause some weirdness for QTSS API
+ // (some modules could get QTSS_RereadPrefs_Role after QTSS_Shutdown, which would be bad)
+- OSMutexLocker locker(this->GetPrefs()->GetMutex());
++ OSMutexLocker* locker = new OSMutexLocker(this->GetPrefs()->GetMutex());
+
+ QTSS_ModuleState theModuleState;
+ theModuleState.curRole = QTSS_Shutdown_Role;
+@@ -152,6 +152,13 @@ QTSServer::~QTSServer()
+ (void)QTSServerInterface::GetModule(QTSSModule::kShutdownRole, x)->CallDispatch(QTSS_Shutdown_Role, NULL);
+
+ OSThread::SetMainThreadData(NULL);
++
++ delete fRTPMap;
++ delete fSocketPool;
++ delete fSrvrMessages;
++ delete locker;
++ delete serverlocker;
++ delete fSrvrPrefs;
+ }
+
+ Bool16 QTSServer::Initialize(XMLPrefsParser* inPrefsSource, PrefsSource* inMessagesSource, UInt16 inPortOverride, Bool16 createListeners)
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/QTSSMessages.cpp_orig 2008-07-24 14:26:35.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/QTSSMessages.cpp 2008-07-24 19:28:31.000000000 +0800
+@@ -212,15 +212,17 @@ void QTSSMessages::Initialize()
+ }
+
+ QTSSMessages::QTSSMessages(PrefsSource* inMessages)
+-: QTSSDictionary(QTSSDictionaryMap::GetMap(QTSSDictionaryMap::kTextMessagesDictIndex))
++: QTSSDictionary(QTSSDictionaryMap::GetMap(QTSSDictionaryMap::kTextMessagesDictIndex)),
++ numAttrs(GetDictionaryMap()->GetNumAttrs())
+ {
+ static const UInt32 kMaxMessageSize = 2048;
+ char theMessage[kMaxMessageSize];
+
+ // Use the names of the attributes in the attribute map as the key values for
+ // finding preferences in the config file.
+-
+- for (UInt32 x = 0; x < this->GetDictionaryMap()->GetNumAttrs(); x++)
++ attrBuffer = NEW char* [numAttrs];
++ ::memset(attrBuffer, 0, sizeof(char*) * numAttrs);
++ for (UInt32 x = 0; x < numAttrs; x++)
+ {
+ theMessage[0] = '\0';
+ (void)inMessages->GetValue(this->GetDictionaryMap()->GetAttrName(x), &theMessage[0]);
+@@ -248,9 +250,10 @@ QTSSMessages::QTSSMessages(PrefsSource*
+ // the new attribute, and copy the data into the newly allocated buffer
+ if (theMessage[0] != '\0')
+ {
+- char* attrBuffer = NEW char[::strlen(theMessage) + 2];
+- ::strcpy(attrBuffer, theMessage);
+- this->SetVal(this->GetDictionaryMap()->GetAttrID(x), attrBuffer, ::strlen(attrBuffer));
++ attrBuffer[x] = NEW char[::strlen(theMessage) + 2];
++ ::strcpy(attrBuffer[x], theMessage);
++ this->SetVal(this->GetDictionaryMap()->GetAttrID(x),
++ attrBuffer[x], ::strlen(attrBuffer[x]));
+ }
+ }
+ }
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/QTSSDictionary.h_orig 2008-07-24 15:52:36.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/QTSSDictionary.h 2008-07-24 15:52:36.000000000 +0800
+@@ -215,7 +215,8 @@ class QTSSDictionary : public QTSSStream
+ Bool16 fMyMutex;
+ Bool16 fLocked;
+
+- void DeleteAttributeData(DictValueElement* inDictValues, UInt32 inNumValues);
++ void DeleteAttributeData(DictValueElement* inDictValues,
++ UInt32 inNumValues, QTSSDictionaryMap* theMap);
+ };
+
+
+@@ -271,7 +272,11 @@ class QTSSDictionaryMap
+ // CONSTRUCTOR / DESTRUCTOR
+
+ QTSSDictionaryMap(UInt32 inNumReservedAttrs, UInt32 inFlags = kNoFlags);
+- ~QTSSDictionaryMap(){ delete fAttrArray; }
++ ~QTSSDictionaryMap() {
++ for (UInt32 i = 0; i < fAttrArraySize; i++)
++ delete fAttrArray[i];
++ delete [] fAttrArray;
++ }
+
+ //
+ // QTSS API CALLS
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/QTSSMessages.h_orig 2008-07-24 14:26:35.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/QTSSMessages.h 2008-07-24 20:20:45.000000000 +0800
+@@ -53,13 +53,20 @@ class QTSSMessages : public QTSSDictiona
+ static void Initialize();
+
+ QTSSMessages(PrefsSource* inMessages);
+- virtual ~QTSSMessages() {}
++ virtual ~QTSSMessages() {
++ for (UInt32 x = 0; x < numAttrs; x++)
++ if (attrBuffer[x] != NULL)
++ delete [] attrBuffer[x];
++ delete [] attrBuffer;
++ }
+
+
+ //Use the standard GetAttribute method in QTSSDictionary to retrieve messages
+
+ private:
+-
++ char** attrBuffer;
++ UInt32 numAttrs;
++
+ enum
+ {
+ kNumMessages = 74 // 0 based count so it is one more than last message index number
+--- DarwinStreamingSrvr6.0.3-Source.orig/Server.tproj/QTSSDictionary.cpp_orig 2008-07-23 12:27:56.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/Server.tproj/QTSSDictionary.cpp 2008-07-24 16:54:46.000000000 +0800
+@@ -60,12 +60,12 @@ QTSSDictionary::QTSSDictionary(QTSSDicti
+ QTSSDictionary::~QTSSDictionary()
+ {
+ if (fMap != NULL)
+- this->DeleteAttributeData(fAttributes, fMap->GetNumAttrs());
++ this->DeleteAttributeData(fAttributes, fMap->GetNumAttrs(), fMap);
+ if (fAttributes != NULL)
+ delete [] fAttributes;
+- delete fInstanceMap;
+- this->DeleteAttributeData(fInstanceAttrs, fInstanceArraySize);
++ this->DeleteAttributeData(fInstanceAttrs, fInstanceArraySize, fInstanceMap);
+ delete [] fInstanceAttrs;
++ delete fInstanceMap;
+ if (fMyMutex)
+ delete fMutexP;
+ }
+@@ -340,7 +340,8 @@ QTSS_Error QTSSDictionary::SetValue(QTSS
+ theAttrs[theMapIndex].fAttributeData.Len = sizeof(char*);
+ // store off original string as first value in array
+ *(char**)theAttrs[theMapIndex].fAttributeData.Ptr = temp;
+- // question: why isn't theAttrs[theMapIndex].fAllocatedInternally set to true?
++ // question: why isn't theAttrs[theMapIndex].fAllocatedInternally set to true?
++ theAttrs[theMapIndex].fAllocatedInternally = true;
+ }
+ }
+ else
+@@ -407,7 +408,7 @@ QTSS_Error QTSSDictionary::SetValue(QTSS
+ // The offset should be (attrLen * inIndex) and not (inLen * inIndex)
+ char** valuePtr = (char**)(theAttrs[theMapIndex].fAttributeData.Ptr + (attrLen * inIndex));
+ if (inIndex < numValues) // we're replacing an existing string
+- delete *valuePtr;
++ delete [] *valuePtr;
+ *valuePtr = (char*)attributeBufferPtr;
+ }
+
+@@ -522,7 +523,7 @@ QTSS_Error QTSSDictionary::RemoveValue(Q
+ {
+ // we need to delete the string
+ char* str = *(char**)(theAttrs[theMapIndex].fAttributeData.Ptr + (theValueLen * inIndex));
+- delete str;
++ delete [] str;
+ }
+
+ //
+@@ -797,12 +798,22 @@ QTSS_Error QTSSDictionary::GetAttrInfoBy
+ return theErr;
+ }
+
+-void QTSSDictionary::DeleteAttributeData(DictValueElement* inDictValues, UInt32 inNumValues)
++void QTSSDictionary::DeleteAttributeData(DictValueElement* inDictValues,
++ UInt32 inNumValues,
++ QTSSDictionaryMap* theMap)
+ {
+ for (UInt32 x = 0; x < inNumValues; x++)
+ {
+- if (inDictValues[x].fAllocatedInternally)
++ if (inDictValues[x].fAllocatedInternally) {
++ if ((theMap->GetAttrType(x) == qtssAttrDataTypeCharArray) &&
++ (inDictValues[x].fNumAttributes > 1)) {
++ UInt32 z = 0;
++ for (char **y = (char **) (inDictValues[x].fAttributeData.Ptr);
++ z < inDictValues[x].fNumAttributes; z++)
++ delete [] y[z];
++ }
+ delete [] inDictValues[x].fAttributeData.Ptr;
++ }
+ }
+ }
+
+--- DarwinStreamingSrvr6.0.3-Source.orig/CommonUtilitiesLib/OS.cpp_orig 2008-07-24 09:38:53.000000000 +0800
++++ DarwinStreamingSrvr6.0.3-Source/CommonUtilitiesLib/OS.cpp 2008-07-24 09:39:31.000000000 +0800
+@@ -220,7 +220,7 @@ SInt32 OS::GetGMTOffset()
+ return ((tzInfo.Bias / 60) * -1);
+ #else
+
+- time_t clock;
++ time_t clock = 0; //Make 'clock' initialized for valgrind
+ struct tm *tmptr= localtime(&clock);
+ if (tmptr == NULL)
+ return 0;
diff --git a/testing/darwin-streaming-server/dss.initd b/testing/darwin-streaming-server/dss.initd
new file mode 100644
index 0000000000..15dd6f9ced
--- /dev/null
+++ b/testing/darwin-streaming-server/dss.initd
@@ -0,0 +1,98 @@
+#!/sbin/runscript
+
+opts="statusdss statusadmin restart"
+
+depend() {
+ need net
+ use dns
+}
+
+start() {
+ ebegin "Starting DSS (per Streaming Admin Server)"
+ /usr/sbin/streamingadminserver.pl
+ eend $?
+}
+
+stop(){
+
+ PIDFILE="/var/run/darwinstreaming/adminserver.pid"
+
+ if [ -f "$PIDFILE" ]; then
+
+ PID=`cat "$PIDFILE"`
+ ps axo pid | grep $PID &>/dev/null
+
+ if [ $? -eq 0 ]; then
+ ebegin "Stopping Streaming Admin Server"
+ kill $PID
+ eend $?
+ else
+ einfo "Streaming Admin Server not running."
+ ebegin "Dropping stale PID file"
+ rm "$PIDFILE"
+ eend $?
+ fi
+
+ else
+ einfo "Streaming Admin Server not running obviously."
+ fi
+
+
+ # DSS isn't writing PID file actually
+ # --> use ps to check for running instance
+
+ PID=`ps axo user,pid,cmd | grep -E '^qtss ' | grep Streaming | awk '{print $2}'`
+
+ if [ $? -eq 0 ]; then
+ ebegin "Stopping DSS"
+ kill $PID
+ eend $?
+ else
+ einfo "DSS not running."
+ fi
+
+}
+
+statusdss() {
+ PIDFILE="/var/run/darwinstreaming/DarwinStreamingServer.pid"
+ if [ -f "$PIDFILE" ]; then
+
+ PID=`cat "$PIDFILE"`
+ ps axo pid | grep PID &>/dev/null
+
+ if [ $? -eq 0 ]; then
+ einfo "DSS is running"
+ return 0
+ else
+ ewarning "found stale PID file"
+ fi
+ fi
+
+ einfo "DSS is not running"
+ return 1
+}
+
+statusadmin() {
+ PIDFILE="/var/run/darwinstreaming/adminserver.pid"
+ if [ -f "$PIDFILE" ]; then
+
+ PID=`cat "$PIDFILE"`
+ ps axo pid | grep PID &>/dev/null
+
+ if [ $? -eq 0 ]; then
+ einfo "Streaming Admin Server is running"
+ return 0
+ else
+ ewarning "found stale PID file"
+ fi
+ fi
+
+ einfo "Streaming Admin Server is not running"
+ return 1
+}
+
+restart() {
+ stop
+ start
+}
+