summaryrefslogtreecommitdiff
path: root/httpresource.c
diff options
context:
space:
mode:
authorthlo <smarttv640@gmail.com>2013-11-26 22:11:45 +0100
committerthlo <smarttv640@gmail.com>2013-11-26 22:11:45 +0100
commit802f35d8a1a7f06dd76068d30f429da6dad9f227 (patch)
treec6cee6003b66ce7097ffeaa139edb18340e7f5ed /httpresource.c
parent3ac54dc3c1f6dd6d8b9adc4024e5003bd4532cae (diff)
downloadvdr-plugin-smarttvweb-802f35d8a1a7f06dd76068d30f429da6dad9f227.tar.gz
vdr-plugin-smarttvweb-802f35d8a1a7f06dd76068d30f429da6dad9f227.tar.bz2
first version of the built-in live solution
Diffstat (limited to 'httpresource.c')
-rwxr-xr-xhttpresource.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/httpresource.c b/httpresource.c
index c6050e3..3ca5ee7 100755
--- a/httpresource.c
+++ b/httpresource.c
@@ -46,6 +46,7 @@
#include "responsefile.h"
#include "responsevdrdir.h"
#include "responsememblk.h"
+#include "responselive.h"
#ifndef STANDALONE
#include <vdr/recording.h>
@@ -488,8 +489,9 @@ int cHttpResource::processRequest() {
if (mPath.find("/live/", 0, 6) == 0) {
*(mLog->log())<< DEBUGPREFIX
- << " Found live request. serving " << mPath << endl;
- //mResponse = new cResponseLive(this, mPath.substr(6));
+ << " Found live request. serving " << mPath
+ << endl;
+ mResponse = new cResponseLive(this, mPath.substr(6));
//((cResponseVdrDir*)mResponse)->sendMediaSegment( &statbuf);
return OKAY;
@@ -599,24 +601,23 @@ int cHttpResource::handleWrite() {
return OKAY;
}
- // if (mResponse->mBlkLen == mResponse->mBlkPos) {
if (mResponse->isBlkWritten()) {
// note the mBlk may be filled with header info first.
if (mResponse->fillDataBlk() != OKAY) {
return ERROR;
}
+ if (mResponse->mBlkLen == 0) {
+ return OKAY;
+ }
}
- // int this_write = write(mFd, &(mResponse->mBlkData[mBlkPos]), mResponse->mBlkLen - mResponse->mBlkPos);
- // int this_write = mResponse->writeData(mFd);
- // if (this_write <=0) {
if (mResponse->writeData(mFd) <=0) {
#ifndef DEBUG
*(mLog->log())<< DEBUGPREFIX
- << " ERROR after write: Stopped (Client terminated Connection)"
+ << " close in write: Stopped (Client terminated Connection)"
<< " mBlkPos= " << mResponse->mBlkPos << " mBlkLen= " << mResponse->mBlkLen
- << DEBUGHDR << endl;
+ << DEBUGHDR << endl;
#endif
mConnState = TOCLOSE;
mConnected = false;