catch exceptions
This commit is contained in:
+2
-2
@@ -2,8 +2,8 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.github.shadowsocks"
|
||||
android:installLocation="auto"
|
||||
android:versionCode="2"
|
||||
android:versionName="1.0.1">
|
||||
android:versionCode="3"
|
||||
android:versionName="1.0.2">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
|
||||
+8
-3
@@ -162,10 +162,10 @@
|
||||
|
||||
net = require("net");
|
||||
|
||||
console.log("calculating ciphers");
|
||||
|
||||
console.log = function() {};
|
||||
|
||||
console.log("calculating ciphers");
|
||||
|
||||
tables = getTable(KEY);
|
||||
|
||||
encryptTable = tables[0];
|
||||
@@ -189,8 +189,13 @@
|
||||
if (stage === 5) {
|
||||
encrypt(encryptTable, data);
|
||||
// Android Patch
|
||||
if (data == null || !remote.write(data)) {
|
||||
try {
|
||||
if (remote == null || !remote.write(data)) {
|
||||
connection.pause();
|
||||
}
|
||||
} catch (e) {
|
||||
connection.pause();
|
||||
console.warn("unexpected exception: " + e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user