diff options
author | Martynas Mickevičius <mmartynas@gmail.com> | 2015-03-08 20:36:37 +0200 |
---|---|---|
committer | Martynas Mickevičius <mmartynas@gmail.com> | 2015-03-10 11:15:31 +0200 |
commit | b6f70d7ed03ab25f184e6a9c14afbfea380b1dbc (patch) | |
tree | f10e17ab0a6eb42279bf97bf6adeba57145319be /jni/iodine-client.c | |
parent | cbccbd1f73aceea461b47a6b118a63b3a5804c9c (diff) | |
download | andiodine-b6f70d7ed03ab25f184e6a9c14afbfea380b1dbc.tar.gz andiodine-b6f70d7ed03ab25f184e6a9c14afbfea380b1dbc.zip |
Allow to customize request hostname size and response fragment size.
Diffstat (limited to 'jni/iodine-client.c')
-rw-r--r-- | jni/iodine-client.c | 10 |
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; |