catch exceptions

This commit is contained in:
Max Lv
2012-12-16 18:37:05 +08:00
parent ce3575fa36
commit 17ae465395
3 changed files with 11 additions and 6 deletions
+2 -2
View File
@@ -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
View File
@@ -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;
}
+1 -1
View File
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.shadowsocks</groupId>
<artifactId>shadowsocks</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
<packaging>apk</packaging>
<name>Shadowsocks</name>