From 85cb3f04252b0228830903b21c08bb64e9919c18 Mon Sep 17 00:00:00 2001 From: geronimo Date: Sun, 29 Jul 2012 15:11:47 +0200 Subject: changed server setup to config file, little rearrangement of sources --- cmps/main.cc | 67 ++++++++----------- cmps/nbproject/Makefile-Debug.mk | 36 +++++++--- cmps/nbproject/configurations.xml | 78 +++++++++++++++++++++- cmps/nbproject/project.xml | 1 + cmps/server.cbp | 5 +- cmps/server.cbp.save | 9 ++- cmps/server.layout | 2 +- cmps/server.layout.save | 2 +- .../include/AbstractMediaRequestHandler.h | 6 +- cmps/serverlib/include/HTMLListAssembler.h | 12 ++-- cmps/serverlib/include/HTTPMediaResponse.h | 12 ++-- cmps/serverlib/nbproject/Makefile-Debug.mk | 28 +++++--- cmps/serverlib/nbproject/configurations.xml | 57 +++++++++++++++- .../serverlib/nbproject/private/configurations.xml | 2 +- cmps/serverlib/nbproject/project.xml | 8 ++- cmps/serverlib/serverlib.cbp | 7 +- cmps/serverlib/serverlib.layout | 8 +-- cmps/serverlib/serverlib.layout.save | 12 ++-- cmps/serverlib/src/AbstractMediaRequestHandler.cc | 8 +-- cmps/serverlib/src/HTMLListAssembler.cc | 12 ++-- cmps/serverlib/src/HTTPMediaResponse.cc | 12 ++-- cmps/serverlib/src/JSonListAssembler.cc | 12 ++-- cmps/serverlib/src/MediaFileHandler.cc | 18 ++--- cmps/serverlib/src/MediaListHandler.cc | 4 +- cmps/tests/ConnectionHandlerTest.cc | 6 +- cmps/tests/FScanTest.cc | 17 +++-- cmps/tests/FileSystemTest.cc | 29 ++++++-- 27 files changed, 321 insertions(+), 149 deletions(-) (limited to 'cmps') diff --git a/cmps/main.cc b/cmps/main.cc index 0f392af..da5b260 100644 --- a/cmps/main.cc +++ b/cmps/main.cc @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -39,16 +39,15 @@ #include static struct option longOptions[] = { - { "port", required_argument, NULL, 'p' } -, { "mediaRoot", required_argument, NULL, 'r' } -, { "favicon", required_argument, NULL, 'i' } -, { "help", no_argument, NULL, 'h' } + { "appDir", required_argument, NULL, 'd' } +, { "realm", required_argument, NULL, 'r' } +, { "help", no_argument, NULL, 'h' } , { NULL, no_argument, NULL, 0 } }; static int refreshScanner(void *opaque, cHTTPRequest &Request) { - cFilesystemScanner *fsc = (cFilesystemScanner *)opaque; + cFSMediaScanner *fsc = (cFSMediaScanner *)opaque; if (fsc) { fsc->Refresh(); @@ -61,19 +60,17 @@ static void usage(void) { fprintf(stderr, "cmps - the backend of CMP (compound media player)\n"); fprintf(stderr, " is streaming- and HTTP-server and accepts these commandline options:\n"); - fprintf(stderr, "-h, --help the help, you are reading\n"); - fprintf(stderr, "-r, --mediaRoot the directory, where to start to scan for media\n"); - fprintf(stderr, " (default is /media)\n"); - fprintf(stderr, "-p, --port ### the servers port to listen for client connections\n"); - fprintf(stderr, " (default is 12345)\n"); - fprintf(stderr, "-i, --favicon the application icon, used by webbrowsers to\n"); - fprintf(stderr, " prefix the urls to identify the server\n"); - fprintf(stderr, " (default is /media/favicon.ico)\n"); + fprintf(stderr, "-h, --help the help, you are reading\n"); + fprintf(stderr, "-d, --appDir the directory, where the server may write config files\n"); + fprintf(stderr, " (default is /var/lib/cmp)\n"); + fprintf(stderr, "-r, --realm absolute path to credential file. That file must be\n"); + fprintf(stderr, " writable to enable remote administration of principals)\n"); + fprintf(stderr, " (default is no file / no authorization required)\n"); exit(0); } -static void parseCommandline(int argc, char *argv[], cServerConfig &config) +static void setup(int argc, char *argv[], cServerConfig &config) { int c; @@ -84,53 +81,43 @@ static void parseCommandline(int argc, char *argv[], cServerConfig &config) while ((c = getopt_long(argc, argv, "hp:r:i:", longOptions, NULL)) != -1) { switch (c) { - case 'p': { - if (isnumber(optarg)) { - int n = atoi(optarg); + case 'd': { + cFile appDir(optarg); - if (n > 0) config.SetPort(n); + if (appDir.Exists() && appDir.IsDirectory() && appDir.CanWrite()) { + config.SetConfigBaseDir(appDir.AbsolutePath()); } } break; case 'r': { - struct stat st; + cFile credentials(optarg); - if (!stat(optarg, &st)) { - if ((st.st_mode & S_IFMT) == S_IFDIR && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) { - config.SetDocumentRoot(optarg); - } - } - } break; - - case 'i': { - struct stat st; - - if (!stat(optarg, &st)) { - if ((st.st_mode & S_IFMT) == S_IFREG && (st.st_mode & (S_IRUSR | S_IRGRP | S_IROTH))) { - config.SetAppIcon(optarg); - } + if (credentials.Exists() && credentials.CanRead()) { + config.SetCredentialsFile(credentials.AbsolutePath()); } } break; case 'h': usage(); break; } } + config.Load("srserver.conf"); + if (!config.CredentialsFile() && config.AuthorizationRequired()) config.SetAuthorizationRequired(false); + config.Dump(); } int main(int argc, char** argv) { - cServerConfig config(12345); - - parseCommandline(argc, argv, config); + cServerConfig config("/var/lib/cmp"); - cFilesystemScanner *scanner = new cFilesystemScanner(); + setup(argc, argv, config); + cFSMediaScanner *scanner = new cFSMediaScanner(); if (!scanner) { fprintf(stderr, "could not initialize application! (1)"); exit(-1); } - scanner->SetMediaFactory(new cMediaFactory(config.DocumentRoot())); + scanner->SetMediaFactory(new cMediaFactory(config)); - cAbstractMediaRequestHandler::SetFilesystemScanner(scanner); + cAbstractMediaRequestHandler::SetFSMediaScanner(scanner); /* * register request handlers with their uri-prefix */ diff --git a/cmps/nbproject/Makefile-Debug.mk b/cmps/nbproject/Makefile-Debug.mk index 183ac43..a86df80 100644 --- a/cmps/nbproject/Makefile-Debug.mk +++ b/cmps/nbproject/Makefile-Debug.mk @@ -52,8 +52,8 @@ TESTFILES= \ CFLAGS= # CC Compiler Flags -CCFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi -CXXFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi +CCFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration +CXXFLAGS=-std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration # Fortran Compiler Flags FFLAGS= @@ -62,7 +62,7 @@ FFLAGS= ASFLAGS= # Link Libraries and Options -LDLIBSOPTIONS=serverlib/dist/Debug/GNU-Linux-x86/libserverlib.a ../libs/fsScan/dist/Debug/GNU-Linux-x86/libfsscan.a ../libs/networking/dist/Debug/GNU-Linux-x86/libnetworking.a ../libs/util/dist/Debug/GNU-Linux-x86/libutil.a ../libs/vdr/dist/Debug/GNU-Linux-x86/libvdr.a -lpthread -lrt -lssl -lcrypt +LDLIBSOPTIONS=serverlib/dist/Debug/GNU-Linux-x86/libserverlib.a ../libs/fsScan/dist/Debug/GNU-Linux-x86/libfsscan.a ../libs/networking/dist/Debug/GNU-Linux-x86/libnetworking.a ../libs/IO/dist/Debug/GNU-Linux-x86/libio.a ../libs/util/dist/Debug/GNU-Linux-x86/libutil.a ../libs/vdr/dist/Debug/GNU-Linux-x86/libvdr.a -lpthread -lrt -lssl -lcrypt -lpcrecpp # Build Targets .build-conf: ${BUILD_SUBPROJECTS} @@ -74,6 +74,8 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ../libs/fsScan/dist/Debug/GNU-L ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ../libs/networking/dist/Debug/GNU-Linux-x86/libnetworking.a +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ../libs/IO/dist/Debug/GNU-Linux-x86/libio.a + ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ../libs/util/dist/Debug/GNU-Linux-x86/libutil.a ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ../libs/vdr/dist/Debug/GNU-Linux-x86/libvdr.a @@ -85,15 +87,22 @@ ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/cmps: ${OBJECTFILES} ${OBJECTDIR}/main.o: main.cc ${MKDIR} -p ${OBJECTDIR} ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.cc # Subprojects .build-subprojects: cd serverlib && ${MAKE} -f Makefile CONF=Debug cd ../libs/fsScan && ${MAKE} -f Makefile CONF=Debug cd ../libs/networking && ${MAKE} -f Makefile CONF=Debug + cd ../libs/IO && ${MAKE} -f Makefile CONF=Debug cd ../libs/util && ${MAKE} -f Makefile CONF=Debug cd ../libs/vdr && ${MAKE} -f Makefile CONF=Debug + cd ../libs/vdr && ${MAKE} -f Makefile CONF=Debug + cd ../libs/util && ${MAKE} -f Makefile CONF=Debug + cd ../libs/networking && ${MAKE} -f Makefile CONF=Debug + cd ../libs/IO && ${MAKE} -f Makefile CONF=Debug + cd ../libs/fsScan && ${MAKE} -f Makefile CONF=Debug + cd serverlib && ${MAKE} -f Makefile CONF=Debug # Build Test Targets .build-tests-conf: .build-conf ${TESTFILES} @@ -121,31 +130,31 @@ ${TESTDIR}/TestFiles/f4: ${TESTDIR}/tests/JSonTest.o ${OBJECTFILES:%.o=%_nomain. ${TESTDIR}/tests/CodecTest.o: tests/CodecTest.cc ${MKDIR} -p ${TESTDIR}/tests ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/CodecTest.o tests/CodecTest.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/CodecTest.o tests/CodecTest.cc ${TESTDIR}/tests/ConnectionHandlerTest.o: tests/ConnectionHandlerTest.cc ${MKDIR} -p ${TESTDIR}/tests ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/ConnectionHandlerTest.o tests/ConnectionHandlerTest.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/ConnectionHandlerTest.o tests/ConnectionHandlerTest.cc ${TESTDIR}/tests/FileSystemTest.o: tests/FileSystemTest.cc ${MKDIR} -p ${TESTDIR}/tests ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/FileSystemTest.o tests/FileSystemTest.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/FileSystemTest.o tests/FileSystemTest.cc ${TESTDIR}/tests/FScanTest.o: tests/FScanTest.cc ${MKDIR} -p ${TESTDIR}/tests ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/FScanTest.o tests/FScanTest.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/FScanTest.o tests/FScanTest.cc ${TESTDIR}/tests/JSonTest.o: tests/JSonTest.cc ${MKDIR} -p ${TESTDIR}/tests ${RM} $@.d - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/JSonTest.o tests/JSonTest.cc + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -I. -MMD -MP -MF $@.d -o ${TESTDIR}/tests/JSonTest.o tests/JSonTest.cc ${OBJECTDIR}/main_nomain.o: ${OBJECTDIR}/main.o main.cc @@ -156,7 +165,7 @@ ${OBJECTDIR}/main_nomain.o: ${OBJECTDIR}/main.o main.cc (echo "$$NMOUTPUT" | ${GREP} 'T _main$$'); \ then \ ${RM} $@.d;\ - $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/util/include -I../libs/vdr/include -Dmain=__nomain -MMD -MP -MF $@.d -o ${OBJECTDIR}/main_nomain.o main.cc;\ + $(COMPILE.cc) -g -Wall -D_GNU_SOURCE=1 -D_REENTRANT -Iinclude -Iserverlib/include -I../libs/fsScan/include -I../libs/networking/include -I../libs/IO/include -I../libs/util/include -I../libs/vdr/include -Dmain=__nomain -MMD -MP -MF $@.d -o ${OBJECTDIR}/main_nomain.o main.cc;\ else \ ${CP} ${OBJECTDIR}/main.o ${OBJECTDIR}/main_nomain.o;\ fi @@ -184,8 +193,15 @@ ${OBJECTDIR}/main_nomain.o: ${OBJECTDIR}/main.o main.cc cd serverlib && ${MAKE} -f Makefile CONF=Debug clean cd ../libs/fsScan && ${MAKE} -f Makefile CONF=Debug clean cd ../libs/networking && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/IO && ${MAKE} -f Makefile CONF=Debug clean cd ../libs/util && ${MAKE} -f Makefile CONF=Debug clean cd ../libs/vdr && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/vdr && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/util && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/networking && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/IO && ${MAKE} -f Makefile CONF=Debug clean + cd ../libs/fsScan && ${MAKE} -f Makefile CONF=Debug clean + cd serverlib && ${MAKE} -f Makefile CONF=Debug clean # Enable dependency checking .dep.inc: .depcheck-impl diff --git a/cmps/nbproject/configurations.xml b/cmps/nbproject/configurations.xml index e30f086..38fad19 100644 --- a/cmps/nbproject/configurations.xml +++ b/cmps/nbproject/configurations.xml @@ -69,10 +69,11 @@ serverlib/include ../libs/fsScan/include ../libs/networking/include + ../libs/IO/include ../libs/util/include ../libs/vdr/include - -std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -ansi + -std=gnu++0x -fomit-frame-pointer -fPIC -pthread -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration _GNU_SOURCE=1 _REENTRANT @@ -117,6 +118,18 @@ OP="${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/libnetworking.a"> + + + + rt ssl crypt + pcrecpp + + + + + + + + + + + + + + diff --git a/cmps/nbproject/project.xml b/cmps/nbproject/project.xml index b24cfef..ddc8162 100644 --- a/cmps/nbproject/project.xml +++ b/cmps/nbproject/project.xml @@ -11,6 +11,7 @@ ../libs/util ../libs/vdr + ../libs/IO ../libs/fsScan serverlib ../libs/networking diff --git a/cmps/server.cbp b/cmps/server.cbp index 4c165d5..f33bde6 100644 --- a/cmps/server.cbp +++ b/cmps/server.cbp @@ -30,12 +30,13 @@ - + + @@ -44,12 +45,14 @@ + + diff --git a/cmps/server.cbp.save b/cmps/server.cbp.save index fd89233..f33bde6 100644 --- a/cmps/server.cbp.save +++ b/cmps/server.cbp.save @@ -7,7 +7,7 @@ - - - + + diff --git a/cmps/serverlib/serverlib.layout b/cmps/serverlib/serverlib.layout index 8f17071..de6ba2e 100644 --- a/cmps/serverlib/serverlib.layout +++ b/cmps/serverlib/serverlib.layout @@ -11,14 +11,14 @@ - + - + - + - + diff --git a/cmps/serverlib/serverlib.layout.save b/cmps/serverlib/serverlib.layout.save index cd411cc..de6ba2e 100644 --- a/cmps/serverlib/serverlib.layout.save +++ b/cmps/serverlib/serverlib.layout.save @@ -1,22 +1,22 @@ - + - + - + - + - + - + diff --git a/cmps/serverlib/src/AbstractMediaRequestHandler.cc b/cmps/serverlib/src/AbstractMediaRequestHandler.cc index ad845b6..b60bcb8 100644 --- a/cmps/serverlib/src/AbstractMediaRequestHandler.cc +++ b/cmps/serverlib/src/AbstractMediaRequestHandler.cc @@ -23,9 +23,9 @@ * -------------------------------------------------------------- */ #include -#include +#include -static cFilesystemScanner *scanner = NULL; +static cFSMediaScanner *scanner = NULL; cAbstractMediaRequestHandler::cAbstractMediaRequestHandler() { @@ -35,12 +35,12 @@ cAbstractMediaRequestHandler::~cAbstractMediaRequestHandler() { } -cFilesystemScanner *cAbstractMediaRequestHandler::FileSystemScanner(void) +cFSMediaScanner *cAbstractMediaRequestHandler::FSMediaScanner(void) { return scanner; } -void cAbstractMediaRequestHandler::SetFilesystemScanner(cFilesystemScanner* Scanner) +void cAbstractMediaRequestHandler::SetFSMediaScanner(cFSMediaScanner* Scanner) { scanner = Scanner; } \ No newline at end of file diff --git a/cmps/serverlib/src/HTMLListAssembler.cc b/cmps/serverlib/src/HTMLListAssembler.cc index bf190fe..1fc964e 100644 --- a/cmps/serverlib/src/HTMLListAssembler.cc +++ b/cmps/serverlib/src/HTMLListAssembler.cc @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== - * + * * File: HTMLListAssembler.cc * Created: 6. Juli 2012, 09 * Author: Geronimo * Project: cmps - the backend (server) part of compound media player - * + * * CMP - compound media player - * + * * is a client/server mediaplayer intended to play any media from any workstation * without the need to export or mount shares. cmps is an easy to use backend * with a (ready to use) HTML-interface. Additionally the backend supports * authentication via HTTP-digest authorization. * cmpc is a client with vdr-like osd-menues. - * + * * Copyright (c) 2012 Reinhard Mantey, some rights reserved! * published under Creative Commons by-sa * For details see http://creativecommons.org/licenses/by-sa/3.0/ - * + * * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp - * + * * -------------------------------------------------------------- */ #include diff --git a/cmps/serverlib/src/HTTPMediaResponse.cc b/cmps/serverlib/src/HTTPMediaResponse.cc index e403afe..729c46e 100644 --- a/cmps/serverlib/src/HTTPMediaResponse.cc +++ b/cmps/serverlib/src/HTTPMediaResponse.cc @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== - * + * * File: HTTPMediaResponse.cc * Created: 6. Juli 2012, 07 * Author: Geronimo * Project: cmps - the backend (server) part of compound media player - * + * * CMP - compound media player - * + * * is a client/server mediaplayer intended to play any media from any workstation * without the need to export or mount shares. cmps is an easy to use backend * with a (ready to use) HTML-interface. Additionally the backend supports * authentication via HTTP-digest authorization. * cmpc is a client with vdr-like osd-menues. - * + * * Copyright (c) 2012 Reinhard Mantey, some rights reserved! * published under Creative Commons by-sa * For details see http://creativecommons.org/licenses/by-sa/3.0/ - * + * * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp - * + * * -------------------------------------------------------------- */ #include diff --git a/cmps/serverlib/src/JSonListAssembler.cc b/cmps/serverlib/src/JSonListAssembler.cc index 05ff5cc..6cba0bb 100644 --- a/cmps/serverlib/src/JSonListAssembler.cc +++ b/cmps/serverlib/src/JSonListAssembler.cc @@ -1,25 +1,25 @@ /** * ======================== legal notice ====================== - * + * * File: JSonListAssembler.cc * Created: 6. Juli 2012, 09 * Author: Geronimo * Project: cmps - the backend (server) part of compound media player - * + * * CMP - compound media player - * + * * is a client/server mediaplayer intended to play any media from any workstation * without the need to export or mount shares. cmps is an easy to use backend * with a (ready to use) HTML-interface. Additionally the backend supports * authentication via HTTP-digest authorization. * cmpc is a client with vdr-like osd-menues. - * + * * Copyright (c) 2012 Reinhard Mantey, some rights reserved! * published under Creative Commons by-sa * For details see http://creativecommons.org/licenses/by-sa/3.0/ - * + * * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp - * + * * -------------------------------------------------------------- */ #include diff --git a/cmps/serverlib/src/MediaFileHandler.cc b/cmps/serverlib/src/MediaFileHandler.cc index 200c933..c4e237c 100644 --- a/cmps/serverlib/src/MediaFileHandler.cc +++ b/cmps/serverlib/src/MediaFileHandler.cc @@ -1,30 +1,30 @@ /** * ======================== legal notice ====================== - * + * * File: MediaFileHandler.cc * Created: 5. Juli 2012, 08 * Author: Geronimo * Project: cmps - the backend (server) part of compound media player - * + * * CMP - compound media player - * + * * is a client/server mediaplayer intended to play any media from any workstation * without the need to export or mount shares. cmps is an easy to use backend * with a (ready to use) HTML-interface. Additionally the backend supports * authentication via HTTP-digest authorization. * cmpc is a client with vdr-like osd-menues. - * + * * Copyright (c) 2012 Reinhard Mantey, some rights reserved! * published under Creative Commons by-sa * For details see http://creativecommons.org/licenses/by-sa/3.0/ - * + * * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp - * + * * -------------------------------------------------------------- */ #include #include -#include +#include #include #include #include @@ -41,8 +41,8 @@ cMediaFileHandler::~cMediaFileHandler() cHTTPResponse *cMediaFileHandler::ProcessRequest(cHTTPRequest& Request) { isyslog("have to find requested media: >%s<", Request.Url().Path()); - - cAbstractMedia *media = FileSystemScanner()->FindMedia(Request.Url().Path()); + + cAbstractMedia *media = FSMediaScanner()->FindMedia(Request.Url().Path()); isyslog("cMediaFileHandler::ProcessRequest ... %0X", media); diff --git a/cmps/serverlib/src/MediaListHandler.cc b/cmps/serverlib/src/MediaListHandler.cc index cdb2b21..d5aaa78 100644 --- a/cmps/serverlib/src/MediaListHandler.cc +++ b/cmps/serverlib/src/MediaListHandler.cc @@ -24,7 +24,7 @@ */ #include #include -#include +#include #include #include #include @@ -69,7 +69,7 @@ cHTTPResponse *cMediaListHandler::ProcessRequest(cHTTPRequest& Request) if (!la) return new cHTTPResponse(HTTP_NotFound); res = new cHTTPResponse(HTTP_OK); res->SetContentType(la->MediaType()); - la->AssembleList(res->StringBuilder(), FileSystemScanner()->MediaPool(), FileSystemScanner()->Categories(), start, delta); + la->AssembleList(res->StringBuilder(), FSMediaScanner()->MediaPool(), FSMediaScanner()->Categories(), start, delta); return res; } diff --git a/cmps/tests/ConnectionHandlerTest.cc b/cmps/tests/ConnectionHandlerTest.cc index 6e0257b..8ff3cce 100644 --- a/cmps/tests/ConnectionHandlerTest.cc +++ b/cmps/tests/ConnectionHandlerTest.cc @@ -24,7 +24,7 @@ */ #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ private: cServerConfig config; cConnectionHandler ch; const char *name; - cFilesystemScanner *scanner; + cFSMediaScanner *scanner; }; cTestUnit::cTestUnit(const char* Name, cConnectionPoint &cp) @@ -67,7 +67,7 @@ cTestUnit::cTestUnit(const char* Name, cConnectionPoint &cp) config.SetDocumentRoot("/media/video"); config.SetAppIcon("/media/favicon.ico"); - scanner = new cFilesystemScanner(); + scanner = new cFSMediaScanner(); if (!scanner) { fprintf(stderr, "could not initialize application! (1)"); exit(-1); diff --git a/cmps/tests/FScanTest.cc b/cmps/tests/FScanTest.cc index 3a60bfb..a426c0d 100644 --- a/cmps/tests/FScanTest.cc +++ b/cmps/tests/FScanTest.cc @@ -1,33 +1,32 @@ /** * ======================== legal notice ====================== - * + * * File: FScanTest.cc * Created: 02.07.2012, 16 * Author: Geronimo * Project: cmps - the backend (server) part of compound media player - * + * * CMP - compound media player - * + * * is a client/server mediaplayer intended to play any media from any workstation * without the need to export or mount shares. cmps is an easy to use backend * with a (ready to use) HTML-interface. Additionally the backend supports * authentication via HTTP-digest authorization. * cmpc is a client with vdr-like osd-menues. - * + * * Copyright (c) 2012 Reinhard Mantey, some rights reserved! * published under Creative Commons by-sa * For details see http://creativecommons.org/licenses/by-sa/3.0/ - * + * * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp - * + * * -------------------------------------------------------------- */ #include #include #include #include -#include -#include +#include #include #include @@ -73,7 +72,7 @@ void FScanTest::test4() ///< file server (added 18G audio) found 5698 media, in 44653 ms. ///< file server (same files, fresh reboot) found 5698 media, in 54723 ms. { - cFilesystemScanner scanner; + cFSMediaScanner scanner; cAbstractMedia *media; std::cout << "FScanTest test 4" << std::endl; diff --git a/cmps/tests/FileSystemTest.cc b/cmps/tests/FileSystemTest.cc index 42a7836..3908941 100644 --- a/cmps/tests/FileSystemTest.cc +++ b/cmps/tests/FileSystemTest.cc @@ -1,10 +1,27 @@ -/* - * File: FileSystemTest.cc - * Author: django - * - * Created on 21.07.2012, 12:40:48 +/** + * ======================== legal notice ====================== + * + * File: FileSystemTest.cc + * Created: 21.07.2012, 12 + * Author: Geronimo + * Project: cmps - the backend (server) part of compound media player + * + * CMP - compound media player + * + * is a client/server mediaplayer intended to play any media from any workstation + * without the need to export or mount shares. cmps is an easy to use backend + * with a (ready to use) HTML-interface. Additionally the backend supports + * authentication via HTTP-digest authorization. + * cmpc is a client with vdr-like osd-menues. + * + * Copyright (c) 2012 Reinhard Mantey, some rights reserved! + * published under Creative Commons by-sa + * For details see http://creativecommons.org/licenses/by-sa/3.0/ + * + * The cmp project's homepage is at http://projects.vdr-developer.org/projects/cmp + * + * -------------------------------------------------------------- */ - #include #include #include -- cgit v1.2.3