Commit b76f410c authored by Max Lv's avatar Max Lv

Refine header parser

parent d3678531
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
[bypass_all] [bypass_all]
[white_list] [white_list]
# Telegram IPs
91.108.4.0/22
91.108.56.0/22
149.154.160.0/20
.*4tern\.com .*4tern\.com
.*adorama\.com .*adorama\.com
.*akiba-web\.com .*akiba-web\.com
......
...@@ -390,6 +390,7 @@ LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/src/, $(SHADOWSOCKS_SOURCES)) ...@@ -390,6 +390,7 @@ LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/src/, $(SHADOWSOCKS_SOURCES))
LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_LOCAL \ LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_LOCAL \
-DUSE_CRYPTO_MBEDTLS -DANDROID -DHAVE_CONFIG_H \ -DUSE_CRYPTO_MBEDTLS -DANDROID -DHAVE_CONFIG_H \
-DCONNECT_IN_PROGRESS=EINPROGRESS \ -DCONNECT_IN_PROGRESS=EINPROGRESS \
-I$(LOCAL_PATH)/include/shadowsocks-libev \
-I$(LOCAL_PATH)/include \ -I$(LOCAL_PATH)/include \
-I$(LOCAL_PATH)/libancillary \ -I$(LOCAL_PATH)/libancillary \
-I$(LOCAL_PATH)/mbedtls/include \ -I$(LOCAL_PATH)/mbedtls/include \
...@@ -399,8 +400,7 @@ LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_LOCAL \ ...@@ -399,8 +400,7 @@ LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_LOCAL \
-I$(LOCAL_PATH)/shadowsocks-libev/libsodium/src/libsodium/include \ -I$(LOCAL_PATH)/shadowsocks-libev/libsodium/src/libsodium/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libsodium/src/libsodium/include/sodium \ -I$(LOCAL_PATH)/shadowsocks-libev/libsodium/src/libsodium/include/sodium \
-I$(LOCAL_PATH)/shadowsocks-libev/libipset/include \ -I$(LOCAL_PATH)/shadowsocks-libev/libipset/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libev \ -I$(LOCAL_PATH)/shadowsocks-libev/libev
-I$(LOCAL_PATH)/include/shadowsocks-libev
LOCAL_STATIC_LIBRARIES := libev libmbedtls libipset libcork libudns \ LOCAL_STATIC_LIBRARIES := libev libmbedtls libipset libcork libudns \
libsodium libancillary libpcre libsodium libancillary libpcre
......
...@@ -417,3 +417,9 @@ ...@@ -417,3 +417,9 @@
/* Define as `fork' if `vfork' does not work. */ /* Define as `fork' if `vfork' does not work. */
/* #undef vfork */ /* #undef vfork */
/* Define to 1 if you have the <pcre.h> header file. */
#define HAVE_PCRE_H 1
/* Define to 1 if you have the <pcre/pcre.h> header file. */
/* #undef HAVE_PCRE_PCRE_H */
Subproject commit 42d9b68dcc1c6ccd9d766b3755e674c2d0c45a57 Subproject commit e5c325445092dc80d3c8bba2d8ab07beee6e4d4d
...@@ -97,14 +97,17 @@ class GuardedProcess(cmd: Seq[String]) { ...@@ -97,14 +97,17 @@ class GuardedProcess(cmd: Seq[String]) {
semaphore.release semaphore.release
process.waitFor process.waitFor
if (isRestart) { this.synchronized {
isRestart = false if (isRestart) {
} else { isRestart = false
if (currentTimeMillis - startTime < 1000) { } else {
Log.w(TAG, "process exit too fast, stop guard: " + cmd) if (currentTimeMillis - startTime < 1000) {
isDestroyed = true Log.w(TAG, "process exit too fast, stop guard: " + cmd)
isDestroyed = true
}
} }
} }
} }
} catch { } catch {
case ignored: InterruptedException => case ignored: InterruptedException =>
...@@ -134,8 +137,10 @@ class GuardedProcess(cmd: Seq[String]) { ...@@ -134,8 +137,10 @@ class GuardedProcess(cmd: Seq[String]) {
} }
def restart() { def restart() {
isRestart = true this.synchronized {
process.destroy() isRestart = true
process.destroy()
}
} }
@throws(classOf[InterruptedException]) @throws(classOf[InterruptedException])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment