From 138df2fd5d6de7a54d2ee4879e95e532bcdb2790 Mon Sep 17 00:00:00 2001 From: Nick Peng Date: Sun, 2 Aug 2020 17:43:38 +0800 Subject: [PATCH] luci: fix no-check-certificate config not working issue --- package/openwrt/files/etc/init.d/smartdns | 4 ++-- src/http_parse.c | 1 + src/include/atomic.h | 6 ------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/package/openwrt/files/etc/init.d/smartdns b/package/openwrt/files/etc/init.d/smartdns index d04a36af8e..2bf799e0a2 100644 --- a/package/openwrt/files/etc/init.d/smartdns +++ b/package/openwrt/files/etc/init.d/smartdns @@ -156,7 +156,7 @@ load_server() config_get type "$section" "type" "udp" config_get ip "$section" "ip" "" config_get tls_host_verify "$section" "tls_host_verify" "" - config_get no_check_certificate "$section" "no_check_certificate" "" + config_get no_check_certificate "$section" "no_check_certificate" "0" config_get host_name "$section" "host_name" "" config_get http_host "$section" "http_host" "" config_get server_group "$section" "server_group" "" @@ -187,7 +187,7 @@ load_server() fi [ -z "$tls_host_verify" ] || ADDITIONAL_ARGS="$ADDITIONAL_ARGS -tls-host-verify $tls_host_verify" - [ -z "$no_check_certificate" ] || ADDITIONAL_ARGS="$ADDITIONAL_ARGS -no-check-certificate" + [ "$no_check_certificate" = "0" ] || ADDITIONAL_ARGS="$ADDITIONAL_ARGS -no-check-certificate" [ -z "$host_name" ] || ADDITIONAL_ARGS="$ADDITIONAL_ARGS -host-name $host_name" [ -z "$http_host" ] || ADDITIONAL_ARGS="$ADDITIONAL_ARGS -http-host $http_host" [ -z "$server_group" ] || ADDITIONAL_ARGS="$ADDITIONAL_ARGS -group $server_group" diff --git a/src/http_parse.c b/src/http_parse.c index e79d3368d1..55906326fb 100644 --- a/src/http_parse.c +++ b/src/http_parse.c @@ -19,6 +19,7 @@ #include "http_parse.h" #include "hash.h" #include "hashtable.h" +#include "util.h" #include "jhash.h" #include "list.h" #include diff --git a/src/include/atomic.h b/src/include/atomic.h index 037b070a1a..1fbbed65dc 100644 --- a/src/include/atomic.h +++ b/src/include/atomic.h @@ -20,12 +20,6 @@ #ifndef _GENERIC_ATOMIC_H #define _GENERIC_ATOMIC_H - -/* Check GCC version, just to be safe */ -#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC_MINOR__ < 1) -# error atomic.h works only with GCC newer than version 4.1 -#endif /* GNUC >= 4.1 */ - /** * Atomic type. */