summaryrefslogtreecommitdiff
path: root/cmps/serverlib
diff options
context:
space:
mode:
authorgeronimo <geronimo013@gmx.de>2012-07-27 07:18:23 +0200
committergeronimo <geronimo013@gmx.de>2012-07-27 07:18:23 +0200
commitd2769982da50332c9354344e2e196f581f7d888b (patch)
tree3986f5c953af85dafebc27fbcb1f6af28cfda49f /cmps/serverlib
parent37dc743591dee0e4326d0100a41f725d4704faf3 (diff)
downloadcmp-d2769982da50332c9354344e2e196f581f7d888b.tar.gz
cmp-d2769982da50332c9354344e2e196f581f7d888b.tar.bz2
remove yajl dependency, handle connection abort if client closes connection during play
Diffstat (limited to 'cmps/serverlib')
-rw-r--r--cmps/serverlib/include/HTTPMediaResponse.h4
-rw-r--r--cmps/serverlib/serverlib.layout8
-rw-r--r--cmps/serverlib/serverlib.layout.save8
-rw-r--r--cmps/serverlib/src/HTTPMediaResponse.cc17
4 files changed, 23 insertions, 14 deletions
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 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug" />
- <File name="src/MediaListHandler.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
+ <File name="src/JSonListAssembler.cc" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
- <Cursor1 position="0" topLine="0" />
+ <Cursor1 position="1183" topLine="0" />
</Cursor>
</File>
- <File name="src/JSonListAssembler.cc" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
+ <File name="src/MediaListHandler.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
- <Cursor1 position="1183" topLine="0" />
+ <Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src/AbstractMediaRequestHandler.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
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 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug" />
- <File name="src/MediaListHandler.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
+ <File name="src/JSonListAssembler.cc" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
- <Cursor1 position="0" topLine="0" />
+ <Cursor1 position="1183" topLine="0" />
</Cursor>
</File>
- <File name="src/JSonListAssembler.cc" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
+ <File name="src/MediaListHandler.cc" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
- <Cursor1 position="1183" topLine="0" />
+ <Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="src/AbstractMediaRequestHandler.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
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: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
* 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 <HTTPMediaResponse.h>
@@ -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;