Commit 8d1d018f authored by Mygod's avatar Mygod

Remove boot script to disable fast open

Fix #828.
parent 3c5bc277
...@@ -28,14 +28,14 @@ object TcpFastOpen { ...@@ -28,14 +28,14 @@ object TcpFastOpen {
file.canRead && (Utils.readAllLines(file).toInt & 1) > 0 file.canRead && (Utils.readAllLines(file).toInt & 1) > 0
} }
def enabled(value: Boolean) = if (true) { def enabled(value: Boolean) =
val fastopen = "echo " + (if (value) 3 else 0) + " > /proc/sys/net/ipv4/tcp_fastopen"
Shell.run("su", Array( Shell.run("su", Array(
"if " + fastopen + "; then", "if echo " + (if (value) 3 else 0) + " > /proc/sys/net/ipv4/tcp_fastopen; then",
" success=-1", " success=-1",
" if mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name/system /system; then", " if mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name/system /system; then",
" echo '#!/system/bin/sh", if (value) " echo '#!/system/bin/sh\n" +
fastopen + "' > /etc/init.d/tcp_fastopen && chmod 755 /etc/init.d/tcp_fastopen", "echo 3 > /proc/sys/net/ipv4/tcp_fastopen' > /etc/init.d/tcp_fastopen && chmod 755 /etc/init.d/tcp_fastopen"
else "rm -f /etc/init.d/tcp_fastopen",
" success=$?", " success=$?",
" mount -o ro,remount /dev/block/platform/msm_sdcc.1/by-name/system /system", " mount -o ro,remount /dev/block/platform/msm_sdcc.1/by-name/system /system",
" fi", " fi",
...@@ -47,5 +47,4 @@ object TcpFastOpen { ...@@ -47,5 +47,4 @@ object TcpFastOpen {
"else", "else",
" echo Failed.", " echo Failed.",
"fi"), null, true).asScala.mkString("\n") "fi"), null, true).asScala.mkString("\n")
} else null
} }
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