Refine header parser

This commit is contained in:
Max Lv
2016-09-09 10:30:22 +08:00
parent d3678531b7
commit b76f410c34
5 changed files with 26 additions and 11 deletions
+4
View File
@@ -3,6 +3,10 @@
[bypass_all]
[white_list]
# Telegram IPs
91.108.4.0/22
91.108.56.0/22
149.154.160.0/20
.*4tern\.com
.*adorama\.com
.*akiba-web\.com
+2 -2
View File
@@ -390,6 +390,7 @@ LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/src/, $(SHADOWSOCKS_SOURCES))
LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_LOCAL \
-DUSE_CRYPTO_MBEDTLS -DANDROID -DHAVE_CONFIG_H \
-DCONNECT_IN_PROGRESS=EINPROGRESS \
-I$(LOCAL_PATH)/include/shadowsocks-libev \
-I$(LOCAL_PATH)/include \
-I$(LOCAL_PATH)/libancillary \
-I$(LOCAL_PATH)/mbedtls/include \
@@ -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/sodium \
-I$(LOCAL_PATH)/shadowsocks-libev/libipset/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libev \
-I$(LOCAL_PATH)/include/shadowsocks-libev
-I$(LOCAL_PATH)/shadowsocks-libev/libev
LOCAL_STATIC_LIBRARIES := libev libmbedtls libipset libcork libudns \
libsodium libancillary libpcre
@@ -417,3 +417,9 @@
/* Define as `fork' if `vfork' does not work. */
/* #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 */
@@ -97,14 +97,17 @@ class GuardedProcess(cmd: Seq[String]) {
semaphore.release
process.waitFor
if (isRestart) {
isRestart = false
} else {
if (currentTimeMillis - startTime < 1000) {
Log.w(TAG, "process exit too fast, stop guard: " + cmd)
isDestroyed = true
this.synchronized {
if (isRestart) {
isRestart = false
} else {
if (currentTimeMillis - startTime < 1000) {
Log.w(TAG, "process exit too fast, stop guard: " + cmd)
isDestroyed = true
}
}
}
}
} catch {
case ignored: InterruptedException =>
@@ -134,8 +137,10 @@ class GuardedProcess(cmd: Seq[String]) {
}
def restart() {
isRestart = true
process.destroy()
this.synchronized {
isRestart = true
process.destroy()
}
}
@throws(classOf[InterruptedException])