summaryrefslogtreecommitdiff
path: root/vdr-vdrmanager/vdrmanager.cpp
diff options
context:
space:
mode:
authorbju <bju@maxi.fritz.box>2013-03-24 04:14:45 +0100
committerbju <bju@maxi.fritz.box>2013-03-24 23:44:04 +0100
commit3cc7911fedcbea2337237a04658495b369c73d35 (patch)
treeb2671551f65d6b2c02cad2ee0bb072fac45f0ff4 /vdr-vdrmanager/vdrmanager.cpp
parentdbf28d356eb97b3075229bbc42a8a3ccf1c94ec0 (diff)
downloadvdr-manager-compression.tar.gz
vdr-manager-compression.tar.bz2
the answer traffic is now compressed if enabled on the server using zip or gzipcompression
Diffstat (limited to 'vdr-vdrmanager/vdrmanager.cpp')
-rw-r--r--vdr-vdrmanager/vdrmanager.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/vdr-vdrmanager/vdrmanager.cpp b/vdr-vdrmanager/vdrmanager.cpp
index 2b81464..4d00f41 100644
--- a/vdr-vdrmanager/vdrmanager.cpp
+++ b/vdr-vdrmanager/vdrmanager.cpp
@@ -12,6 +12,7 @@
#include <vdr/device.h>
#include <vdr/player.h>
#include "vdrmanagerthread.h"
+#include "compressor.h"
#define VDRMANAGER_PORT 6420
@@ -26,6 +27,7 @@ private:
const char * password;
bool forceCheckSvdrp;
bool forceDelete;
+ int compressionMode;
protected:
public:
cVdrManager(void);
@@ -73,12 +75,17 @@ cMenuSetupPage * cVdrManager::SetupMenu(void) {
}
const char * cVdrManager::CommandLineHelp(void) {
- return " -p port port number to listen to\n -P password password (none if not given). No password forces check against svdrphosts.conf.\n -s force check against svdrphosts.conf, even if a password was given\n -f force delete of a timer or a recording even if they are active\n";
+ return
+ " -p port port number to listen to\n"
+ " -P password password (none if not given). No password forces check against svdrphosts.conf.\n"
+ " -s force check against svdrphosts.conf, even if a password was given\n"
+ " -f force delete of a timer or a recording even if they are active\n"
+ " -c compression selects the compression mode to use (zlib, gzip or none)";
}
bool cVdrManager::ProcessArgs(int argc, char *argv[]) {
int c;
- while ((c = getopt(argc, argv, "p:P:s:f")) != -1)
+ while ((c = getopt(argc, argv, "c:p:P:sf")) != -1)
switch (c) {
case 'p':
port = atoi(optarg);
@@ -92,13 +99,16 @@ bool cVdrManager::ProcessArgs(int argc, char *argv[]) {
case 'f':
forceDelete = true;
break;
+ case 'c':
+ if (optarg[0] == 'g') {
+ compressionMode = COMPRESSION_GZIP;
+ } else if (optarg[0] == 'z') {
+ compressionMode = COMPRESSION_ZLIB;
+ } else {
+ compressionMode = COMPRESSION_NONE;
+ }
+ break;
case '?':
- if (optopt == 'c') {
- fprintf(stderr, "Option -%c requires an argument.\n", optopt);
- } else if (isprint(optopt))
- fprintf(stderr, "Unknown option `-%c'.\n", optopt);
- else
- fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
return false;
default:
return false;
@@ -115,7 +125,7 @@ bool cVdrManager::Initialize(void) {
// Initialize any background activities the plugin shall perform.
// Start any background activities the plugin shall perform.
- Thread = new cVdrManagerThread(port, password, forceCheckSvdrp);
+ Thread = new cVdrManagerThread(port, password, forceCheckSvdrp, compressionMode);
return Thread != NULL;
}