Skip to content

Instantly share code, notes, and snippets.

@shelling
Created August 27, 2012 09:00
Show Gist options
  • Select an option

  • Save shelling/3486787 to your computer and use it in GitHub Desktop.

Select an option

Save shelling/3486787 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Darwin Streaming Media Server
# chkconfig: 35 50 50
# description: Darwin Streaming Media Server
#
### BEGIN INIT INFO
# Provides: darwin-streaming-server
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Darwin Streaming Media Server
### END INIT INFO
# What is this?
DESC="Darwin Streaming Media Server"
D0="streaming server"
D1="DSS administration console"
PREFIX=/usr/local
# Exit if required binaries are missing.
[ -x $PREFIX/sbin/DarwinStreamingServer ] || exit 0
[ -x $PREFIX/sbin/streamingadminserver.pl ] || exit 0
. /lib/lsb/init-functions
# See how we were called.
case "$1" in
start)
log_daemon_msg "Starting $DESC"
log_progress_msg "$D0"
start-stop-daemon --start --oknodo --quiet \
--exec $PREFIX/sbin/DarwinStreamingServer
if [ $? != 0 ]; then
log_end_msg $?
exit $?
fi
log_progress_msg "$D1"
start-stop-daemon --start --oknodo --quiet \
--exec $PREFIX/sbin/streamingadminserver.pl
if [ $? != 0 ]; then
log_end_msg $?
exit $?
fi
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping $DESC"
log_progress_msg "$D0"
start-stop-daemon --stop --oknodo --quiet --name DarwinStreaming --retry 3
if [ $? != 0 ]; then
log_end_msg $?
exit $?
fi
start-stop-daemon --stop --oknodo --quiet --name streamingadmins
if [ $? != 0 ]; then
log_end_msg $?
exit $?
fi
log_end_msg 0
;;
status)
if pidof DarwinStreamingServer >/dev/null
then
echo "$D0 running"
else
echo "$D0 not running"
exit 3
fi
if pidof streamingadminserver.pl >/dev/null
then
echo "$D1 running"
else
echo "$D1 not running"
exit 3
fi
exit 0
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
log_success_msg "Usage: darwin-streaming-server {start|stop|status|restart}"
exit 1
;;
esac
exit 0
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 (),
--- 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;
#!/bin/bash
# Install script for the Darwin Streaming Server
# source release
echo;echo Installing Darwin Streaming Server;echo
INSTALL_OS=`uname`
if [ $INSTALL_OS != "SunOS" ]; then
USERID=`id -u`
else
USERID=`/usr/xpg4/bin/id -u`
fi
if [ $USERID = 0 ]; then
echo Checking for and Killing currently running Darwin Streaming Server
if [ `uname` = "FreeBSD" ]; then
ps -ax | awk '/DarwinStreamingServer/ {print $1}' | xargs kill -9
ps -ax | awk '/streamingadminserver.pl/ {print $1}' | xargs kill -9
fi
if [ `uname` = "Linux" ]; then
ps ax | awk '{print $1" " $5}' | awk '/DarwinStreamingServer/ {print $1}' | xargs -r kill -9
ps ax | awk '/streamingadminserver.pl/ {print $1}' | xargs -r kill -9
fi
if [ `uname` = "SunOS" -o `uname` = "IRIX" -o `uname` = "IRIX64" ]; then
ps -aef | awk '/DarwinStreamingServer/ {print $2}' | xargs -n 2 kill -9
ps -aef | awk '/streamingadminserver.pl/ {print $2}' | xargs -n 1 kill -9
fi
## REMOVED OLD VERSION ##
echo Removing previous versions of Darwin Streaming Server
if [ -f /usr/local/sbin/DarwinStreamingServer ]; then
echo removing /usr/local/sbin/DarwinStreamingServer
rm -f /usr/local/sbin/DarwinStreamingServer
fi
if [ -f /usr/local/bin/PlaylistBroadcaster ]; then
echo removing /usr/local/bin/PlaylistBroadcaster
rm -f /usr/local/bin/PlaylistBroadcaster
fi
if [ -f /usr/local/bin/MP3Broadcaster ]; then
echo removing /usr/local/bin/MP3Broadcaster
rm -f /usr/local/bin/MP3Broadcaster
fi
if [ -f /usr/local/bin/qtpasswd ]; then
echo removing /usr/local/bin/qtpasswd
rm -f /usr/local/bin/qtpasswd
fi
if [ -f /usr/local/sbin/streamingadminserver.pl ]; then
echo removing /usr/local/sbin/streamingadminserver.pl
rm -f /usr/local/sbin/streamingadminserver.pl
fi
if [ -f /usr/local/bin/streamingadminserver.pl ]; then
echo removing /usr/local/bin/streamingadminserver.pl
rm -f /usr/local/bin/streamingadminserver.pl
fi
if [ -f /usr/local/bin/SpamPro ]; then
echo removing /usr/local/bin/SpamPro
rm -f /usr/local/bin/SpamPro
fi
if [ -e StreamingLoadTool ]; then
if [ -f /usr/local/bin/StreamingLoadTool ]; then
echo removing /usr/local/bin/StreamingLoadTool
rm -f /usr/local/bin/StreamingLoadTool
fi
fi
echo
## BACKUP OLD CONFIG FILES ##
echo Backing up previous config files
if [ -f /etc/streaming/streamingserver.xml ]; then
echo backing up /etc/streaming/streamingserver.xml to /etc/streaming/streamingserver.xml.backup
mv /etc/streaming/streamingserver.xml /etc/streaming/streamingserver.xml.backup
fi
if [ -f /etc/streaming/streamingadminserver.pem ]; then
echo backing up /etc/streaming/streamingadminserver.pem to /etc/streaming/streamingadminserver.pem.backup
mv /etc/streaming/streamingadminserver.pem /etc/streaming/streamingadminserver.pem.backup
fi
if [ -f /etc/streaming/qtusers ]; then
echo backing up /etc/streaming/qtusers to /etc/streaming/qtusers.backup
mv /etc/streaming/qtusers /etc/streaming/qtusers.backup
fi
if [ -f /etc/streaming/qtgroups ]; then
echo backing up /etc/streaming/qtgroups to /etc/streaming/qtgroups.backup
mv /etc/streaming/qtgroups /etc/streaming/qtgroups.backup
fi
if [ -e StreamingLoadTool ]; then
if [ -f /etc/streaming/streamingloadtool.conf ]; then
echo backing up /etc/streaming/streamingloadtool.conf to /etc/streaming/streamingloadtool.conf.backup
mv /etc/streaming/streamingloadtool.conf /etc/streaming/streamingloadtool.conf.backup
fi
fi
if [ -f /etc/streaming/relayconfig.xml ]; then
echo backing up /etc/streaming/relayconfig.xml to /etc/streaming/relayconfig.xml.backup
mv /etc/streaming/relayconfig.xml /etc/streaming/relayconfig.xml.backup
fi
echo
## CHANGE PERL PATH IN streamingadminserver.pl AND parse_xml.cgi ##
# Look for perl in the default locations
if [ -x /usr/freeware/bin/perl ]; then
perldef=/usr/freeware/bin/perl
elif [ -x /usr/local/bin/perl ]; then
perldef=/usr/local/bin/perl
elif [ -x /usr/bin/perl ]; then
perldef=/usr/bin/perl
else
perldef=""
fi
# Test if it is really perl
$perldef -e 'print "foobar\n"' 2>/dev/null | grep foobar >/dev/null
# if it isn't really perl
if [ $? != "0" ]; then
# prompt the user to enter the path to perl
if [ "$perl" = "" ]; then
if [ "$perldef" = "" ]; then
printf "Full path to perl: "
read perl
if [ "$perl" = "" ]; then
echo "ERROR: No path entered!"
echo ""
exit 4
fi
else
printf "Full path to perl (default $perldef): "
read perl
if [ "$perl" = "" ]; then
perl=$perldef
fi
fi
fi
echo ""
# Test perl
echo "Testing Perl ..."
if [ ! -x $perl ]; then
echo "ERROR: Failed to find perl at $perl"
echo ""
exit 1
fi
$perl -e 'print "foobar\n"' 2>/dev/null | grep foobar >/dev/null
if [ $? != "0" ]; then
echo "ERROR: Failed to run test perl script. Maybe $perl is"
echo "not the perl interpreter, or is not installed properly"
echo ""
exit 1
fi
$perl -e 'exit ($] < 5.002 ? 1 : 0)'
if [ $? = "1" ]; then
echo "ERROR: Detected old perl version. The streaming server admin requires"
echo "perl 5.002 or better to run"
echo ""
exit 1
fi
else
if [ "$perl" = "" ]; then
perl=$perldef
fi
fi
if [ "$noperlpath" = "" ]; then
echo "Inserting path to perl into scripts.."
$perl WebAdmin/perlpath.pl $perl WebAdmin/src/streamingadminserver.pl WebAdmin/WebAdminHtml/parse_xml.cgi
echo ""
fi
# Add the unprivileged user qtss as the server's run user
echo "Creating unprivileged user to run the server = \"qtss\"."
if [ $INSTALL_OS = "Linux" ]; then
/usr/sbin/groupadd qtss > /dev/null 2>&1
/usr/sbin/useradd -M qtss > /dev/null 2>&1
else
/usr/sbin/groupadd qtss > /dev/null 2>&1
/usr/sbin/useradd qtss > /dev/null 2>&1
fi
## INSTALL NEW VERSION ##
if [ ! -d /usr/local/sbin ]; then
echo creating "/usr/local/sbin" directory
mkdir -p /usr/local/sbin
fi
if [ ! -d /usr/local/bin ]; then
echo creating "/usr/local/bin" directory
mkdir -p /usr/local/bin
fi
echo copying "DarwinStreamingServer" to "/usr/local/sbin/DarwinStreamingServer"
cp -f DarwinStreamingServer /usr/local/sbin/
echo copying "PlaylistBroadcaster" to "/usr/local/bin/PlaylistBroadcaster"
cp -f ./PlaylistBroadcaster.tproj/PlaylistBroadcaster /usr/local/bin/
echo copying "MP3Broadcaster" to "/usr/local/bin/MP3Broadcaster"
cp -f ./MP3Broadcaster/MP3Broadcaster /usr/local/bin/
echo copying "qtpasswd" to "/usr/local/bin/qtpasswd"
cp -f ./qtpasswd.tproj/qtpasswd /usr/local/bin/
# For now, do not copy modules as there are no supported dynamic modules
# echo copying modules to "/usr/local/sbin/StreamingServerModules"
if [ ! -d /usr/local/sbin/StreamingServerModules ]; then
echo creating "/usr/local/sbin/StreamingServerModules" directory
mkdir /usr/local/sbin/StreamingServerModules
fi
#cp -f StreamingServerModules/* /usr/local/sbin/StreamingServerModules/
if [ -e /usr/local/sbin/StreamingServerModules/QTSSHomeDirectoryModule ]; then
echo copying "createuserstreamingdir" to "/usr/local/bin/createuserstreamingdir"
cp -f createuserstreamingdir $INSTALLROOT/usr/local/bin/
fi
if [ ! -d /etc/streaming ]; then
echo creating "/etc/streaming" directory
mkdir -p /etc/streaming
fi
if [ ! -e /etc/streaming/streamingserver.xml ]; then
/usr/local/sbin/DarwinStreamingServer -x
fi
chmod 600 /etc/streaming/streamingserver.xml
chown qtss /etc/streaming/streamingserver.xml
echo;echo copying "relayconfig.xml-Sample" to "/etc/streaming/relayconfig.xml-Sample"
cp -f relayconfig.xml-Sample /etc/streaming/relayconfig.xml-Sample
chmod 600 /etc/streaming/relayconfig.xml-Sample
if [ -e /etc/streaming/relayconfig.xml ]; then
chown qtss /etc/streaming/relayconfig.xml
fi
echo;echo copying "qtusers" to "/etc/streaming/qtusers"
cp -f qtusers /etc/streaming/qtusers
chmod 600 /etc/streaming/qtusers
chown qtss /etc/streaming/qtusers
echo;echo copying "qtgroups" to "/etc/streaming/qtgroups"
cp -f qtgroups /etc/streaming/qtgroups
chmod 600 /etc/streaming/qtgroups
chown qtss /etc/streaming/qtgroups
#echo;echo copying "streamingadminserver.pem" to "/etc/streaming/streamingadminserver.pem"
#cp -f streamingadminserver.pem /etc/streaming/streamingadminserver.pem
#chmod 400 /etc/streaming/streamingadminserver.pem
if [ ! -d /var/streaming ]; then
echo creating "/var/streaming" directory
mkdir -p /var/streaming
fi
echo copying "readme.txt" to "/var/streaming/readme.txt"
cp -f ./Documentation/readme.txt /var/streaming/readme.txt
echo copying "3rdPartyAcknowledgements.rtf" to "/var/streaming/3rdPartyAcknowledgements.rtf"
cp -f ./Documentation/3rdPartyAcknowledgements.rtf /var/streaming/3rdPartyAcknowledgements.rtf
if [ ! -d /var/streaming/logs ]; then
echo creating "/var/streaming/logs" directory
mkdir -p /var/streaming/logs
fi
if [ ! -d /usr/local/movies ]; then
echo creating "/usr/local/movies" directory
mkdir -p /usr/local/movies
fi
if [ ! -d /var/streaming/playlists ]; then
echo creating "/var/streaming/playlists" directory
mkdir -p /var/streaming/playlists
fi
chmod 770 /var/streaming/playlists
chmod 775 /usr/local/movies
echo copying "sample_100kbit.mov" into "/usr/local/movies/sample_100kbit.mov"
cp -f sample_100kbit.mov /usr/local/movies/
echo copying "sample_300kbit.mov" into "/usr/local/movies/sample_300kbit.mov"
cp -f sample_300kbit.mov /usr/local/movies/
echo copying "sample_100kbit.mp4" into "/usr/local/movies/sample_100kbit.mp4"
cp -f sample_100kbit.mp4 /usr/local/movies/
echo copying "sample_300kbit.mp4" into "/usr/local/movies/sample_300kbit.mp4"
cp -f sample_300kbit.mp4 /usr/local/movies/
echo copying "sample.mp3" into "/usr/local/movies/sample.mp3"
cp -f sample.mp3 /usr/local/movies/
echo copying "sample_50kbit.3gp" into "/usr/local/movies/sample_50kbit.3gp"
cp -f sample_50kbit.3gp /usr/local/movies/
echo copying "sample_h264_100kbit.mp4" into "/usr/local/movies/sample_h264_100kbit.mp4"
cp -f sample_h264_100kbit.mp4 /usr/local/movies/
echo copying "sample_h264_300kbit.mp4" into "/usr/local/movies/sample_h264_300kbit.mp4"
cp -f sample_h264_300kbit.mp4 /usr/local/movies/
echo copying "sample_h264_1mbit.mp4" into "/usr/local/movies/sample_h264_1mbit.mp4"
cp -f sample_h264_1mbit.mp4 /usr/local/movies/
if [ -e StreamingLoadTool ]; then
echo copying "StreamingLoadTool" to "/usr/local/bin/StreamingLoadTool"
cp -f ./StreamingLoadTool/StreamingLoadTool /usr/local/bin/
echo copying "streamingloadtool.conf" to "/etc/streaming/streamingloadtool.conf"
cp -f ./StreamingLoadTool/streamingloadtool.conf /etc/streaming/
fi
#WebAdmin install
echo copying "streamingadminserver.pl" into "/usr/local/sbin/streamingadminserver.pl"
cp -f ./WebAdmin/src/streamingadminserver.pl /usr/local/sbin/streamingadminserver.pl
if [ -d /var/streaming/AdminHtml/ ]; then
echo removing old version of html from "/var/streaming/AdminHtml"
rm -r -f /var/streaming/AdminHtml
fi
if [ ! -d /var/streaming/ ]; then
echo creating "/var/streaming/AdminHtml" directory
mkdir -p /var/streaming/
fi
echo copying Admin HTML to "/var/streaming/AdminHtml" directory
cp -f -r WebAdmin/WebAdminHtml /var/streaming/AdminHtml
chown -R -f qtss /var/streaming/
chown -R -f qtss /etc/streaming/
chown -R -f qtss /usr/local/movies/
echo;echo "Launching streamingadminserver.pl"
/usr/local/sbin/streamingadminserver.pl
echo;echo Installation Complete
# Setup for DSS
# Prompts for a username and password
# that can be used to administer the server
echo;echo Darwin Streaming Server Setup;echo
# prompt the user to enter the admin username
while [ "$username" = "" ]; do
printf "In order to administer the Darwin Streaming Server you must create an administrator user [Note: The administrator user name cannot contain spaces, or single or double quote characters, and cannot be more than 255 characters long].\n"
printf "Please enter a new administrator user name: "
read username
if [ "$username" = "" ]; then
echo ""
echo "Error: No username entered!"
echo ""
fi
done
echo ""
# prompt the user to enter the admin password
while [ "$password" = "" ]; do
printf "\nYou must also enter a password for the administrator user [Note: The administrator password cannot contain spaces, or quotes, either single or double, and cannot be more than 80 characters long].\n"
printf "Please enter a new administrator Password: "
stty -echo
read password
stty echo
echo ""
printf "Re-enter the new administrator password: "
stty -echo
read password1
stty echo
if [ "$password" = "" ]; then
echo ""
echo "Error: No password entered!"
echo ""
fi
if [ "$password" != "$password1" ]; then
echo ""
echo "Error: passwords entered do not match!"
echo ""
password=""
fi
done
echo ""
# Add the new admin username to /etc/streaming/qtusers
/usr/local/bin/qtpasswd -p $password $username
# Add the new admin username to /etc/streaming/qtgroups
# and delete the default admin username
echo admin: $username > /etc/streaming/qtgroups.tmp
mv /etc/streaming/qtgroups.tmp /etc/streaming/qtgroups
# Remove the default admin username to /etc/streaming/qtusers
/usr/local/bin/qtpasswd -F -d 'aGFja21l' > /dev/null
chown -R -f qtss /etc/streaming/
echo Setup Complete!
else
echo "Unable to perform install"
echo "You must be logged in as root to install Darwin Streaming Server";echo
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment