From d2769982da50332c9354344e2e196f581f7d888b Mon Sep 17 00:00:00 2001 From: geronimo Date: Fri, 27 Jul 2012 07:18:23 +0200 Subject: remove yajl dependency, handle connection abort if client closes connection during play --- cmps/server.cbp.save | 9 +-------- cmps/server.layout | 2 +- cmps/server.layout.save | 2 +- cmps/serverlib/include/HTTPMediaResponse.h | 4 ++++ cmps/serverlib/serverlib.layout | 8 ++++---- cmps/serverlib/serverlib.layout.save | 8 ++++---- cmps/serverlib/src/HTTPMediaResponse.cc | 17 +++++++++++------ 7 files changed, 26 insertions(+), 24 deletions(-) (limited to 'cmps') diff --git a/cmps/server.cbp.save b/cmps/server.cbp.save index 55c4f6d..fd89233 100644 --- a/cmps/server.cbp.save +++ b/cmps/server.cbp.save @@ -46,17 +46,10 @@ - - - - - - - - + diff --git a/cmps/server.layout b/cmps/server.layout index 6418deb..140c8d3 100644 --- a/cmps/server.layout +++ b/cmps/server.layout @@ -1,7 +1,7 @@ - + diff --git a/cmps/server.layout.save b/cmps/server.layout.save index 33999bc..140c8d3 100644 --- a/cmps/server.layout.save +++ b/cmps/server.layout.save @@ -1,7 +1,7 @@ - + diff --git a/cmps/serverlib/include/HTTPMediaResponse.h b/cmps/serverlib/include/HTTPMediaResponse.h index 298f43c..40830c4 100644 --- a/cmps/serverlib/include/HTTPMediaResponse.h +++ b/cmps/serverlib/include/HTTPMediaResponse.h @@ -35,8 +35,12 @@ public: virtual size_t ReadContentChunk(char *Buf, size_t bufSize); +protected: + virtual void HandleAbort(void); + private: cAbstractMedia *media; + friend class cConnectionHandler; }; #endif /* HTTPMEDIARESPONSE_H */ diff --git a/cmps/serverlib/serverlib.layout b/cmps/serverlib/serverlib.layout index 270cbed..51b7661 100644 --- a/cmps/serverlib/serverlib.layout +++ b/cmps/serverlib/serverlib.layout @@ -1,14 +1,14 @@ - + - + - + - + diff --git a/cmps/serverlib/serverlib.layout.save b/cmps/serverlib/serverlib.layout.save index 270cbed..51b7661 100644 --- a/cmps/serverlib/serverlib.layout.save +++ b/cmps/serverlib/serverlib.layout.save @@ -1,14 +1,14 @@ - + - + - + - + diff --git a/cmps/serverlib/src/HTTPMediaResponse.cc b/cmps/serverlib/src/HTTPMediaResponse.cc index ca08576..e403afe 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 @@ -43,6 +43,11 @@ cHTTPMediaResponse::~cHTTPMediaResponse() { } +void cHTTPMediaResponse::HandleAbort(void) +{ + if (media) media->Reset(); +} + size_t cHTTPMediaResponse::ReadContentChunk(char* Buf, size_t bufSize) { if (!media) return 0; -- cgit v1.2.3