Browse Source

Fix 'detect encrypted inuot' logic, it was reversed

Georgi Chorbadzhiyski 6 years ago
parent
commit
7dd2c7cccd
2 changed files with 4 additions and 4 deletions
  1. 1
    1
      config.h
  2. 3
    3
      tomcast.c

+ 1
- 1
config.h View File

@@ -81,7 +81,7 @@ struct config {
81 81
 	int					server_port;
82 82
 	int					server_socket;
83 83
 	pthread_t			server_thread;
84
-	int					allow_encrypted_input;
84
+	int					detect_encrypted_input;
85 85
 
86 86
 	char				*channels_file;
87 87
 

+ 3
- 3
tomcast.c View File

@@ -929,7 +929,7 @@ void * proxy_ts_stream(void *self) {
929 929
 				fdwrite(r->clientsock, reset, FRAME_PACKET_SIZE);
930 930
 			}
931 931
 
932
-			if (!config.allow_encrypted_input) {
932
+			if (config.detect_encrypted_input) {
933 933
 				int64_t now = get_time();
934 934
 				int ret;
935 935
 				if ((ret = ts_have_valid_pes((uint8_t *)buf, readen)) == 0) { // Is the output encrypted?
@@ -1052,7 +1052,7 @@ void parse_options(int argc, char **argv, struct config *cfg) {
1052 1052
 				send_reset_opt = 1;
1053 1053
 				break;
1054 1054
 			case 'E':
1055
-				cfg->allow_encrypted_input = 1;
1055
+				cfg->detect_encrypted_input = 1;
1056 1056
 				break;
1057 1057
 			case 'H':
1058 1058
 			case 'h':
@@ -1085,7 +1085,7 @@ void parse_options(int argc, char **argv, struct config *cfg) {
1085 1085
 	}
1086 1086
 	if (send_reset_opt)
1087 1087
 		printf("\tSend reset packets.\n");
1088
-	if (cfg->allow_encrypted_input)
1088
+	if (cfg->detect_encrypted_input)
1089 1089
 		printf("\tDetect encrypted input.\n");
1090 1090
 	if (cfg->pidfile) {
1091 1091
 		printf("\tDaemonize         : %s\n", cfg->pidfile);

Loading…
Cancel
Save