summaryrefslogtreecommitdiff
path: root/libs/networking/src
diff options
context:
space:
mode:
Diffstat (limited to 'libs/networking/src')
-rw-r--r--libs/networking/src/ConnectionHandler.cc13
-rw-r--r--libs/networking/src/HTTPResponse.cc18
2 files changed, 19 insertions, 12 deletions
diff --git a/libs/networking/src/ConnectionHandler.cc b/libs/networking/src/ConnectionHandler.cc
index 9ad24a6..abed00f 100644
--- a/libs/networking/src/ConnectionHandler.cc
+++ b/libs/networking/src/ConnectionHandler.cc
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
- *
+ *
* File: ConnectionHandler.cc
* Created: 4. Juli 2012, 07
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
* Project: libnetworking: classes for tcp/ip sockets and http-protocol handling
- *
+ *
* 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 <ConnectionHandler.h>
@@ -369,6 +369,7 @@ void cConnectionHandler::TransferResponse(cHTTPResponse *Response)
if (nTrans < 1) {
esyslog("failed to transmit chunk. Error #%d", errno);
+ Response->HandleAbort();
break;
}
total += nTrans;
diff --git a/libs/networking/src/HTTPResponse.cc b/libs/networking/src/HTTPResponse.cc
index c49483c..e9ae8eb 100644
--- a/libs/networking/src/HTTPResponse.cc
+++ b/libs/networking/src/HTTPResponse.cc
@@ -1,25 +1,25 @@
/**
* ======================== legal notice ======================
- *
+ *
* File: HTTPResponse.cc
* Created: 4. Juli 2012, 06
* Author: <a href="mailto:geronimo013@gmx.de">Geronimo</a>
* Project: libnetworking: classes for tcp/ip sockets and http-protocol handling
- *
+ *
* 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 <HTTPResponse.h>
@@ -80,6 +80,12 @@ void cHTTPResponse::SetDefaultStatusBody(HTTPStatusCode Status)
"</HTML>\n");
}
+void cHTTPResponse::HandleAbort(void)
+///< handle cases where client closes connection while transfer was in progress
+{
+ // default: do nothing
+}
+
size_t cHTTPResponse::ReadContentChunk(char* Buf, size_t bufSize)
{
return content.Copy(Buf, bufSize);