summaryrefslogtreecommitdiff
path: root/jni
diff options
context:
space:
mode:
authorYves <yvesf-git@xapek.org>2015-03-12 18:31:05 +0100
committerYves <yvesf-git@xapek.org>2015-03-12 18:31:05 +0100
commitcd2e99c0a6c7bcd5c43b028c3b9f33fd45b94ea7 (patch)
treef10e17ab0a6eb42279bf97bf6adeba57145319be /jni
parentcbccbd1f73aceea461b47a6b118a63b3a5804c9c (diff)
parentb6f70d7ed03ab25f184e6a9c14afbfea380b1dbc (diff)
downloadandiodine-cd2e99c0a6c7bcd5c43b028c3b9f33fd45b94ea7.tar.gz
andiodine-cd2e99c0a6c7bcd5c43b028c3b9f33fd45b94ea7.zip
Merge pull request #16 from 2m/wip-custom-sizes
Custom request hostname and response fragment sizes
Diffstat (limited to 'jni')
-rw-r--r--jni/iodine-client.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/jni/iodine-client.c b/jni/iodine-client.c
index 11ef7cf..2c08229 100644
--- a/jni/iodine-client.c
+++ b/jni/iodine-client.c
@@ -85,7 +85,7 @@ JNIEXPORT jint JNICALL Java_org_xapek_andiodine_IodineClient_getDnsFd(
JNIEXPORT jint JNICALL Java_org_xapek_andiodine_IodineClient_connect(
JNIEnv *env, jclass klass, jstring j_nameserv_addr, jstring j_topdomain, jboolean j_raw_mode, jboolean j_lazy_mode,
- jstring j_password) {
+ jstring j_password, jint j_request_hostname_size, jint j_response_fragment_size) {
// XXX strdup leaks
const char *__p_nameserv_addr = (*env)->GetStringUTFChars(env,
@@ -109,14 +109,14 @@ JNIEXPORT jint JNICALL Java_org_xapek_andiodine_IodineClient_connect(
strncpy(passwordField, p_password, 32);
(*env)->ReleaseStringUTFChars(env, j_password, p_password);
- tun_config_android.request_disconnect = 0;
+ tun_config_android.request_disconnect = 0;
int selecttimeout = 2; // original: 4
int lazy_mode;
- int hostname_maxlen = 0xFF;
+ int hostname_maxlen = j_request_hostname_size;
int raw_mode;
- int autodetect_frag_size = 1;
- int max_downstream_frag_size = 3072;
+ int autodetect_frag_size = j_response_fragment_size == 0 ? 1 : 0;
+ int max_downstream_frag_size = j_response_fragment_size;
if (j_raw_mode) {
raw_mode = 1;