summaryrefslogtreecommitdiff
path: root/server/connection.h
diff options
context:
space:
mode:
authorschmirl <schmirl>2010-07-19 13:50:11 +0000
committerschmirl <schmirl>2010-07-19 13:50:11 +0000
commitfa578940f7770876d884093a57f657b03213cea3 (patch)
tree6b7d56a314e4ed9b90102a8d53f08e769dc7a1e9 /server/connection.h
parenta43455f660040140fcfd9401ceb81f1e13f8bd7d (diff)
downloadvdr-plugin-streamdev-fa578940f7770876d884093a57f657b03213cea3.tar.gz
vdr-plugin-streamdev-fa578940f7770876d884093a57f657b03213cea3.tar.bz2
- using SIGINT in externremux to kill mencoder works better than SIGTERM;
especially x264 still needs a SIGKILL sometimes - added --remove-destination to cp commands installing plugins - updated Italian translation (thanks to Diego Pierotto) - config option "client may suspend" hidden if not applicable - updated and enhanced README - added support for HTTP method HEAD - rewrite of externremux.sh, including support for various URL parameters, logging and improved shutdown - start externremux script in a separate process group - changed HTTP URL path for externremux from EXTERN to EXT (suggested by Rolf Ahrenberg) - HTTP headers now have to be emitted by externremux script - pass channel related information and URL parameters to externremux script through environment - implement CGI like interface for externremux script Modified Files: Tag: v0_4 CONTRIBUTORS HISTORY Makefile README common.c common.h i18n.c remux/extern.c remux/extern.h server/connection.c server/connection.h server/connectionHTTP.c server/connectionHTTP.h server/connectionIGMP.c server/connectionVTP.c server/livestreamer.c server/livestreamer.h server/menuHTTP.c server/setup.c server/setup.h server/streamer.c server/streamer.h streamdev/externremux.sh streamdev/streamdevhosts.conf
Diffstat (limited to 'server/connection.h')
-rw-r--r--server/connection.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/server/connection.h b/server/connection.h
index 7979e35..95881e7 100644
--- a/server/connection.h
+++ b/server/connection.h
@@ -1,5 +1,5 @@
/*
- * $Id: connection.h,v 1.5.2.3 2009/09/18 10:41:11 schmirl Exp $
+ * $Id: connection.h,v 1.5.2.4 2010/07/19 13:50:14 schmirl Exp $
*/
#ifndef VDR_STREAMDEV_SERVER_CONNECTION_H
@@ -8,6 +8,11 @@
#include "tools/socket.h"
#include "common.h"
+#include <map>
+
+typedef std::map<std::string,std::string> tStrStrMap;
+typedef std::pair<std::string,std::string> tStrStr;
+
class cChannel;
class cDevice;
@@ -28,6 +33,8 @@ private:
uint m_WriteBytes;
uint m_WriteIndex;
+ tStrStrMap m_Headers;
+
protected:
/* Will be called when a command terminated by a newline has been
received */
@@ -41,7 +48,10 @@ protected:
virtual bool Respond(const char *Message, bool Last = true, ...);
//__attribute__ ((format (printf, 2, 4)));
- static const cChannel *ChannelFromString(const char *String, int *Apid = NULL);
+ /* Add a request header */
+ void SetHeader(const char *Name, const char *Value, const char *Prefix = "") { m_Headers.insert(tStrStr(std::string(Prefix) + Name, Value)); }
+
+ static const cChannel *ChannelFromString(const char *String, int *Apid = NULL, int *Dpid = NULL);
public:
/* If you derive, specify a short string such as HTTP for Protocol, which
@@ -89,6 +99,12 @@ public:
virtual void Detach(void) = 0;
virtual void Attach(void) = 0;
+
+ /* This connections protocol name */
+ virtual const char* Protocol(void) const { return m_Protocol; }
+
+ /* std::map with additional information */
+ const tStrStrMap& Headers(void) const { return m_Headers; }
};
inline bool cServerConnection::HasData(void) const