Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Merge branch 'oscam-svn'
Browse files Browse the repository at this point in the history
  • Loading branch information
WXbet committed Mar 25, 2024
2 parents 7d81839 + 32c513a commit 472d7c2
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 163 deletions.
7 changes: 0 additions & 7 deletions Distribution/doc/html/oscam.1.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,6 @@ <H2>OPTIONS</H2>

<P>

<B>-u</B>|<B>--utf8</B>
<DL COMPACT><DT><DD>
enable output of web interface in UTF-8 charset
</DL>

<P>

<B>-V</B>|<B>--build-info</B>
<DL COMPACT><DT><DD>
show OSCam version info
Expand Down
5 changes: 0 additions & 5 deletions Distribution/doc/man/oscam.1
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@ capture segmentation faults
use <directory> for temporary data, default:temporary directory of OS
.RE
.PP
\fB-u\fP|\fB--utf8\fP
.RS 3n
enable output of web interface in UTF-8 charset
.RE
.PP
\fB-V\fP|\fB--build-info\fP
.RS 3n
show OSCam version info
Expand Down
3 changes: 0 additions & 3 deletions Distribution/doc/txt/oscam.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ OPTIONS
-t|--temp-dir <directory>
use <directory> for temporary data, default:temporary directory of OS

-u|--utf8
enable output of web interface in UTF-8 charset

-V|--build-info
show OSCam version info

Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ ifeq ($(uname_S),Cygwin)
DEFAULT_PCSC_LIB += -lwinscard
endif

DEFAULT_UTF8_FLAGS = -DWITH_UTF8

# Function to initialize USE related variables
# Usage: $(eval $(call prepare_use_flags,FLAG_NAME,PLUS_TARGET_TEXT))
define prepare_use_flags
Expand Down Expand Up @@ -201,7 +199,6 @@ $(eval $(call prepare_use_flags,LIBCRYPTO,))
$(eval $(call prepare_use_flags,LIBUSB,libusb))
$(eval $(call prepare_use_flags,PCSC,pcsc))
$(eval $(call prepare_use_flags,LIBDVBCSA,libdvbcsa))
$(eval $(call prepare_use_flags,UTF8))

# Add PLUS_TARGET and EXTRA_TARGET to TARGET
ifdef NO_PLUS_TARGET
Expand Down Expand Up @@ -726,8 +723,6 @@ OSCam build system documentation\n\
LIBDVBCSA_CFLAGS='$(DEFAULT_LIBDVBCSA_FLAGS)'\n\
LIBDVBCSA_LDFLAGS='$(DEFAULT_LIBDVBCSA_FLAGS)'\n\
LIBDVBCSA_LIB='$(DEFAULT_LIBDVBCSA_LIB)'\n\
\n\
USE_UTF8=1 - Request UTF-8 enabled webif by default.\n\
\n\
Automatically intialized variables:\n\
\n\
Expand Down
2 changes: 1 addition & 1 deletion README.config
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Examples:
./config.sh -D card_readers -E CARDREADER_INTERNAL

Available options:
addons: WEBIF WEBIF_LIVELOG WEBIF_JQUERY TOUCH WITH_SSL HAVE_DVBAPI IRDETO_GUESSING CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CS_CACHEEX_AIO CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT
addons: WEBIF WEBIF_LIVELOG WEBIF_JQUERY WITH_SSL HAVE_DVBAPI IRDETO_GUESSING CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CS_CACHEEX_AIO CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT
protocols: MODULE_CAMD33 MODULE_CAMD35 MODULE_CAMD35_TCP MODULE_NEWCAMD MODULE_CCCAM MODULE_CCCSHARE MODULE_GBOX MODULE_RADEGAST MODULE_SCAM MODULE_SERIAL MODULE_CONSTCW MODULE_PANDORA MODULE_GHTTP
readers: READER_NAGRA READER_NAGRA_MERLIN READER_IRDETO READER_CONAX READER_CRYPTOWORKS READER_SECA READER_VIACCESS READER_VIDEOGUARD READER_DRE READER_TONGFANG READER_BULCRYPT READER_GRIFFIN READER_DGCRYPT
card_readers: CARDREADER_PHOENIX CARDREADER_INTERNAL CARDREADER_SC8IN1 CARDREADER_MP35 CARDREADER_SMARGO CARDREADER_DB2COM CARDREADER_STAPI CARDREADER_STINGER
Expand Down
1 change: 0 additions & 1 deletion config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#define WEBIF 1
#define WEBIF_LIVELOG 1
#define WEBIF_JQUERY 1
//#define TOUCH 1
//#define WITH_SSL 1
#if defined(__linux__) || defined(__CYGWIN__)
#define HAVE_DVBAPI 1
Expand Down
4 changes: 1 addition & 3 deletions config.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

addons="WEBIF WEBIF_LIVELOG WEBIF_JQUERY TOUCH WITH_SSL HAVE_DVBAPI WITH_EXTENDED_CW WITH_NEUTRINO READ_SDT_CHARSETS CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CS_CACHEEX_AIO CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT WITH_ARM_NEON WITH_EMU WITH_SOFTCAM"
addons="WEBIF WEBIF_LIVELOG WEBIF_JQUERY WITH_SSL HAVE_DVBAPI WITH_EXTENDED_CW WITH_NEUTRINO READ_SDT_CHARSETS CS_ANTICASC WITH_DEBUG MODULE_MONITOR WITH_LB CS_CACHEEX CS_CACHEEX_AIO CW_CYCLE_CHECK LCDSUPPORT LEDSUPPORT CLOCKFIX IPV6SUPPORT WITH_ARM_NEON WITH_EMU WITH_SOFTCAM"
protocols="MODULE_CAMD33 MODULE_CAMD35 MODULE_CAMD35_TCP MODULE_NEWCAMD MODULE_CCCAM MODULE_CCCSHARE MODULE_GBOX MODULE_RADEGAST MODULE_SCAM MODULE_SERIAL MODULE_CONSTCW MODULE_PANDORA MODULE_GHTTP MODULE_STREAMRELAY"
readers="READER_NAGRA READER_NAGRA_MERLIN READER_IRDETO READER_CONAX READER_CRYPTOWORKS READER_SECA READER_VIACCESS READER_VIDEOGUARD READER_DRE READER_TONGFANG READER_BULCRYPT READER_GRIFFIN READER_DGCRYPT"
card_readers="CARDREADER_PHOENIX CARDREADER_INTERNAL CARDREADER_SC8IN1 CARDREADER_MP35 CARDREADER_SMARGO CARDREADER_DB2COM CARDREADER_STAPI CARDREADER_STAPI5 CARDREADER_STINGER CARDREADER_DRECAS"
Expand All @@ -9,7 +9,6 @@ defconfig="
CONFIG_WEBIF=y
CONFIG_WEBIF_LIVELOG=y
CONFIG_WEBIF_JQUERY=y
# CONFIG_TOUCH=n
# CONFIG_WITH_SSL=n
CONFIG_HAVE_DVBAPI=y
# CONFIG_WITH_EXTENDED_CW=n
Expand Down Expand Up @@ -458,7 +457,6 @@ menu_addons() {
WEBIF "Web Interface" $(check_test "WEBIF") \
WEBIF_LIVELOG "LiveLog" $(check_test "WEBIF_LIVELOG") \
WEBIF_JQUERY "Jquery onboard (if disabled webload)" $(check_test "WEBIF_JQUERY") \
TOUCH "Touch Web Interface" $(check_test "TOUCH") \
WITH_SSL "OpenSSL support" $(check_test "WITH_SSL") \
HAVE_DVBAPI "DVB API" $(check_test "HAVE_DVBAPI") \
WITH_EXTENDED_CW "DVB API EXTENDED CW API" $(check_test "WITH_EXTENDED_CW") \
Expand Down
42 changes: 23 additions & 19 deletions module-dvbapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -6674,14 +6674,6 @@ static void *dvbapi_main_local(void *cli)
memset(assoc_fd, 0, sizeof(assoc_fd));
dvbapi_read_priority();
dvbapi_load_channel_cache();
dvbapi_detect_api();

if(selected_box == -1 || selected_api == -1)
{
cs_log("ERROR: Could not detect DVBAPI version.");
free(mbuf);
return NULL;
}

// detect box type first and then get descrambler info
dvbapi_get_descrambler_info();
Expand Down Expand Up @@ -8174,10 +8166,10 @@ void dvbapi_write_ecminfo_file(struct s_client *client, ECM_REQUEST *er, uint8_t
reader_name, from_name, from_port, proto_name);
}
else
{
fprintf(ecmtxt, "reader: %s\nfrom: %s - %s\nprotocol: %s\n",
reader_name, from_name, from_device, proto_name);
}
{
fprintf(ecmtxt, "reader: %s\nfrom: %s - %s\nprotocol: %s\n",
reader_name, from_name, from_device, proto_name);
}
}
break;

Expand All @@ -8198,8 +8190,16 @@ void dvbapi_write_ecminfo_file(struct s_client *client, ECM_REQUEST *er, uint8_t
case E_FOUND:
if(er->selected_reader)
{
fprintf(ecmtxt, "reader: %s\nfrom: %s:%d\nprotocol: %s\nhops: %d\n",
reader_name, from_name, from_port, proto_name, hops);
if(is_network_reader(er->selected_reader))
{
fprintf(ecmtxt, "reader: %s\nfrom: %s:%d\nprotocol: %s\nhops: %d\n",
reader_name, from_name, from_port, proto_name, hops);
}
else
{
fprintf(ecmtxt, "reader: %s\nfrom: %s - %s\nprotocol: %s\nhops: %d\n",
reader_name, from_name, from_device, proto_name, hops);
}
}
break;

Expand Down Expand Up @@ -8290,15 +8290,19 @@ void *dvbapi_start_handler(struct s_client *cl, uint8_t *UNUSED(mbuf), int32_t m
// cs_log("dvbapi loaded fd=%d", idx);
if(cfg.dvbapi_enabled == 1)
{
cl = create_client(get_null_ip());
cl->module_idx = module_idx;
cl->typ = 'c';
dvbapi_detect_api();

int32_t ret = start_thread("dvbapi handler", _main_func, (void *)cl, &cl->thread, 1, 0);
if(ret)
if(selected_box == -1 || selected_api == -1)
{
cs_log("ERROR: Could not detect DVBAPI version.");
return NULL;
}

cl = create_client(get_null_ip());
cl->module_idx = module_idx;
cl->typ = 'c';

start_thread("dvbapi handler", _main_func, (void *)cl, &cl->thread, 1, 0);
}
return NULL;
}
Expand Down
21 changes: 1 addition & 20 deletions module-webif-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,6 @@ void send_file(FILE *f, char *filename, char *subdir, time_t modifiedheader, uin
char *CSS = NULL;
char *JSCRIPT = NULL;
char *JQUERY = NULL;
char *TOUCH_CSS = NULL;
char *TOUCH_JSCRIPT = NULL;

if(!strcmp(filename, "CSS"))
{
Expand Down Expand Up @@ -468,7 +466,7 @@ void send_file(FILE *f, char *filename, char *subdir, time_t modifiedheader, uin
if(filen == 1 && cfg.http_prepend_embedded_css) // Prepend Embedded CSS
{
CSS = tpl_getUnparsedTpl("CSS", 1, "");
snprintf(separator, sizeof(separator), "\n/* Beginn embedded CSS File: %s */\n", cfg.http_css);
snprintf(separator, sizeof(separator), "\n/* Begin embedded CSS File: %s */\n", cfg.http_css);
}

// We need at least size 1 or keepalive gets problems on some browsers...
Expand Down Expand Up @@ -512,24 +510,9 @@ void send_file(FILE *f, char *filename, char *subdir, time_t modifiedheader, uin
CSS = tpl_getUnparsedTpl("CSS", 1, "");
JSCRIPT = tpl_getUnparsedTpl("JSCRIPT", 1, "");
JQUERY = tpl_getUnparsedTpl("JQUERY", 1, "");
#ifdef TOUCH
TOUCH_CSS = tpl_getUnparsedTpl("TOUCH_CSS", 1, "");
TOUCH_JSCRIPT = tpl_getUnparsedTpl("TOUCH_JSCRIPT", 1, "");

if(!subdir || strcmp(subdir, TOUCH_SUBDIR)) {
if( filen == 1 && cs_strlen(CSS)){ result = CSS; }
else if ( filen == 2 && cs_strlen(JSCRIPT)){ result = JSCRIPT; }
else if ( filen == 3 && cs_strlen(JQUERY)){ result = JQUERY; }
} else {
if( filen == 1 && cs_strlen(TOUCH_CSS)){ result = TOUCH_CSS; }
else if ( filen == 2 && cs_strlen(TOUCH_JSCRIPT)){ result = TOUCH_JSCRIPT; }
else if ( filen == 3 && cs_strlen(JQUERY)){ result = JQUERY; }
}
#else
if(filen == 1 && cs_strlen(CSS) > 0){ result = CSS;}
else if(filen == 2 && cs_strlen(JSCRIPT) > 0){result = JSCRIPT;}
else if(filen == 3 && cs_strlen(JQUERY) > 0){result = JQUERY;}
#endif
moddate = first_client->login;
}

Expand All @@ -548,8 +531,6 @@ void send_file(FILE *f, char *filename, char *subdir, time_t modifiedheader, uin
NULLFREE(CSS);
NULLFREE(JSCRIPT);
NULLFREE(JQUERY);
NULLFREE(TOUCH_CSS);
NULLFREE(TOUCH_JSCRIPT);
}

/* Parse url parameters and save them to params array. The pch pointer is increased to the position where parsing stopped. */
Expand Down
2 changes: 0 additions & 2 deletions module-webif-lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
/* The refresh delay (in seconds) when stopping OSCam via http. */
#define SHUTDOWNREFRESH 30

#define TOUCH_SUBDIR "touch/"

struct s_connection
{
int32_t socket;
Expand Down
14 changes: 4 additions & 10 deletions module-webif-tpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#include "minilzo/minilzo.h"
#endif

extern uint8_t cs_http_use_utf8;

/* struct template templates[] that comes from webif/pages.c is recreated as
struct tpl tpls[] because we need to add additional fields such as tpl_name_hash
and possibly preprocess templates[] struct before using it. */
Expand Down Expand Up @@ -360,9 +358,6 @@ char *tpl_getUnparsedTpl(const char *name, int8_t removeHeader, const char *subd
char path[255];
if((cs_strlen(tpl_getFilePathInSubdir(tpl_path, subdir, name, ".tpl", path, 255)) > 0 && file_exists(path))
|| (cs_strlen(subdir) > 0
#ifdef TOUCH
&& strcmp(subdir, TOUCH_SUBDIR)
#endif
&& cs_strlen(tpl_getFilePathInSubdir(tpl_path, "" , name, ".tpl", path, 255)) > 0 && file_exists(path)))
{
FILE *fp;
Expand Down Expand Up @@ -414,7 +409,6 @@ char *tpl_getUnparsedTpl(const char *name, int8_t removeHeader, const char *subd
check_conf(CARDREADER_STAPI5, ptr2);
check_conf(WEBIF_LIVELOG, ptr2);
check_conf(WEBIF_JQUERY, ptr2);
check_conf(TOUCH, ptr2);
check_conf(CS_ANTICASC, ptr2);
check_conf(CS_CACHEEX, ptr2);
check_conf(CS_CACHEEX_AIO, ptr2);
Expand Down Expand Up @@ -783,15 +777,15 @@ char *xml_encode(struct templatevars *vars, const char *chartoencode)
pos += 6;
break;
case '\'':
memcpy(encoded + pos, "&#39;", 5);
pos += 5;
break; // &apos; not supported on older IE
memcpy(encoded + pos, "&apos;", 5);
pos += 6;
break;
case '\n':
memcpy(encoded + pos, "\n", 1);
pos += 1;
break;
default:
if(tmp < 32 || (cs_http_use_utf8 != 1 && tmp > 127))
if(tmp < 32 || tmp > 127)
{
snprintf(buffer, 7, "&#%d;", tmp);
memcpy(encoded + pos, buffer, cs_strlen(buffer));
Expand Down
2 changes: 0 additions & 2 deletions module-webif-tpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
/* Templates: Appends a variable or adds it if doesn't exist yet. The variable will be reset to "" after being used once. See TPLADDONCE for details. */
#define TPLAPPENDONCE 3

#define TOUCH_SUBDIR "touch/"

struct templatevars
{
uint32_t varscnt;
Expand Down
18 changes: 5 additions & 13 deletions module-webif.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
extern const struct s_cardreader *cardreaders[];
extern char cs_confdir[];
extern uint32_t ecmcwcache_size;
extern uint8_t cs_http_use_utf8;
extern uint32_t cfg_sidtab_generation;
extern int32_t exit_oscam;
extern uint8_t cacheex_peer_id[8];
Expand Down Expand Up @@ -6661,11 +6660,7 @@ static char *send_oscam_status(struct templatevars * vars, struct uriparams * pa
cs_readunlock(__func__, &clientlist_lock);
cs_readunlock(__func__, &readerlist_lock);

uint8_t is_touch = 0;
if(config_enabled(TOUCH) && streq(tpl_getVar(vars, "SUBDIR"), TOUCH_SUBDIR))
{is_touch=1;}

if(cfg.http_status_log || (apicall == 1 && strcmp(getParam(params, "appendlog"), "1") == 0) || is_touch)
if(cfg.http_status_log || (apicall == 1 && strcmp(getParam(params, "appendlog"), "1") == 0))
{
if(cfg.loghistorylines && log_history)
{
Expand Down Expand Up @@ -6849,7 +6844,7 @@ static char *send_oscam_status(struct templatevars * vars, struct uriparams * pa
}

#ifdef WITH_DEBUG
if(cfg.http_status_log || is_touch)
if(cfg.http_status_log)
{
// Debuglevel Selector
int32_t lvl;
Expand Down Expand Up @@ -6886,7 +6881,7 @@ static char *send_oscam_status(struct templatevars * vars, struct uriparams * pa
}
#endif

if(cfg.http_status_log || is_touch)
if(cfg.http_status_log)
tpl_addVar(vars, TPLADDONCE, "LOG_HISTORY", tpl_getTpl(vars, "LOGHISTORYBIT"));

if(apicall)
Expand Down Expand Up @@ -6918,10 +6913,7 @@ static char *send_oscam_status(struct templatevars * vars, struct uriparams * pa
}
}

if(is_touch)
{ return tpl_getTpl(vars, "TOUCH_STATUS"); }
else
{ return tpl_getTpl(vars, "STATUS"); }
return tpl_getTpl(vars, "STATUS");
}

static char *send_oscam_services_edit(struct templatevars * vars, struct uriparams * params)
Expand Down Expand Up @@ -9484,7 +9476,7 @@ static int32_t process_request(FILE * f, IN_ADDR_T in)
tpl_addVar(vars, TPLADD, "LOCALE_DECPOINT", strstr(tpl_getVar(vars, "TMP_DECPOINT"), ",") ? ",": ".");
}

tpl_addVar(vars, TPLADD, "HTTP_CHARSET", cs_http_use_utf8 ? "UTF-8" : "ISO-8859-1");
tpl_addVar(vars, TPLADD, "HTTP_CHARSET", "UTF-8");
if(cfg.http_picon_size > 0)
{
tpl_printf(vars, TPLADD, "HTTPPICONSIZEINS", "img.statususericon, img.protoicon, img.usericon, img.readericon {height:%dpx !important;max-height:%dpx !important;}", cfg.http_picon_size, cfg.http_picon_size);
Expand Down
17 changes: 0 additions & 17 deletions oscam.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ char cs_confdir[128];
uint16_t cs_dblevel = 0; // Debug Level
int32_t thread_pipe[2] = {0, 0};
static int8_t cs_restart_mode = 1; // Restartmode: 0=off, no restart fork, 1=(default)restart fork, restart by webif, 2=like=1, but also restart on segfaults
#ifdef WITH_UTF8
uint8_t cs_http_use_utf8 = 1;
#else
uint8_t cs_http_use_utf8 = 0;
#endif
static int8_t cs_capture_SEGV;
static int8_t cs_dump_stack;
static uint16_t cs_waittime = 60;
Expand Down Expand Up @@ -206,10 +201,6 @@ static void show_usage(void)
printf("\n Settings:\n");
printf(" -p, --pending-ecm <num> | Set the maximum number of pending ECM packets.\n");
printf(" . Default: 32 Max: 4096\n");
if(config_enabled(WEBIF))
{
printf(" -u, --utf8 | Enable WebIf support for UTF-8 charset.\n");
}
printf("\n Debug parameters:\n");
printf(" -a, --crash-dump | Write oscam.crash file on segfault. This option\n");
printf(" . needs GDB to be installed and OSCam executable to\n");
Expand Down Expand Up @@ -250,7 +241,6 @@ static const struct option long_options[] =
{ "show-sensitive", no_argument, NULL, 'S' },
{ "capture-segfaults", no_argument, NULL, 's' },
{ "temp-dir", required_argument, NULL, 't' },
{ "utf8", no_argument, NULL, 'u' },
{ "build-info", no_argument, NULL, 'V' },
{ "wait", required_argument, NULL, 'w' },
{ 0, 0, 0, 0 }
Expand Down Expand Up @@ -335,13 +325,6 @@ static void parse_cmdline_params(int argc, char **argv)
}
break;
}
case 'u': // --utf8
if(config_enabled(WEBIF))
{
cs_http_use_utf8 = 1;
printf("WARNING: Web interface UTF-8 mode enabled. Carefully read documentation as bugs may arise.\n");
}
break;
case 'V': // --build-info
write_versionfile(true);
exit(EXIT_SUCCESS);
Expand Down
Loading

0 comments on commit 472d7c2

Please sign in to comment.