Skip to content

Commit

Permalink
update to libtorrent 1.2.1, NDK 19c, boost 1.70.0, version 1.2.1.0 (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed May 5, 2019
1 parent 747b47d commit 34f8ff5
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 102 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Expand Up @@ -20,12 +20,12 @@ branches:

before_install:
# boost: download and bootstrap
- wget -nv -O boost.zip https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.zip
- wget -nv -O boost.zip https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.zip
- unzip -qq boost.zip
- cd boost_1_69_0
- cd boost_1_70_0
- ./bootstrap.sh
- cd ..
- export BOOST_ROOT=$PWD/boost_1_69_0
- export BOOST_ROOT=$PWD/boost_1_70_0

# openssl: download
- wget -nv -O openssl.tar.gz https://www.openssl.org/source/openssl-1.1.1b.tar.gz
Expand All @@ -41,7 +41,7 @@ before_install:
# libtorrent: download and checkout revision
- git clone https://github.com/arvidn/libtorrent
- cd libtorrent
- git checkout 381d5a3c5d170c7e2cbcfe231c8e6108391327d7
- git checkout 4b268297c4cf7beefd6d90e45e2f5c2a2284a870
- cd ..
- export LIBTORRENT_ROOT=$PWD/libtorrent
# perform android specific modifications for posix calls
Expand All @@ -58,10 +58,10 @@ before_install:

# android ndk: download and create toolchain
- if [ $os_build == "android" ]; then
wget -nv -O android-ndk.zip https://dl.google.com/android/repository/android-ndk-r19b-linux-x86_64.zip;
wget -nv -O android-ndk.zip https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip;
echo "Extracting NDK...wait";
unzip -qq android-ndk.zip;
export NDK=$PWD/android-ndk-r19b;
export NDK=$PWD/android-ndk-r19c;
$NDK/build/tools/make_standalone_toolchain.py --arch $os_arch --api $android_api --stl libc++ --install-dir android-toolchain;
export ANDROID_TOOLCHAIN=$PWD/android-toolchain;
fi
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'maven'

group 'org.libtorrent4j'
archivesBaseName = 'libtorrent4j'
version '1.2.0.22'
version '1.2.1.0'

sourceCompatibility = '1.7'
targetCompatibility = '1.7'
Expand Down
20 changes: 20 additions & 0 deletions changelog.txt
@@ -1,3 +1,23 @@
1.2.1.0

* using android NDK r19c
* updated to boost 1.70.0
* removed support for FreeBSD
* lt:make sure session cleanup releases all its references to torrents
* lt:track the mapped port for each NAT mapping transport
* lt:optimize resolve_duplicate_filenames_slow()
* lt:use a more restrictive limit on number of pieces allowed in a torrent
* lt:improve disk I/O logging
* lt:always flush disk I/O job queue before shutdown
* lt:fix typo in validation of reject messages. Make on_choke a bit more
defensive
* lt:tighten up validation of dont-have messages
* lt:tighten up validation of reject messages, to ensure consistency of stats
counters
* lt:tighten up message size checks
* lt:update symlinks to conform to BEP 47
* lt:source code cleanup, performance and stability

1.2.0.22

* updated to OpenSSL 1.1.1b
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/libtorrent4j/LibTorrent.java
Expand Up @@ -46,7 +46,7 @@ public static String version() {
* @return the git revision
*/
public static String revision() {
return "381d5a3c5d170c7e2cbcfe231c8e6108391327d7";
return "4b268297c4cf7beefd6d90e45e2f5c2a2284a870";
}

public static int boostVersionNum() {
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/libtorrent4j/swig/libtorrent_jni.java
Expand Up @@ -13,7 +13,7 @@ public class libtorrent_jni {

public static String libtorrent4jVersion() {
// extracted from the gradle with the run-swig step
return "1.2.0.22";
return "1.2.1.0";
}

static {
Expand Down Expand Up @@ -2972,8 +2972,7 @@ public static String libtorrent4jVersion() {
public final static native boolean peer_connection_handle_can_disconnect(long jarg1, peer_connection_handle jarg1_, long jarg2, error_code jarg2_);
public final static native boolean peer_connection_handle_has_metadata(long jarg1, peer_connection_handle jarg1_);
public final static native boolean peer_connection_handle_in_handshake(long jarg1, peer_connection_handle jarg1_);
public final static native void peer_connection_handle_send_buffer__SWIG_0(long jarg1, peer_connection_handle jarg1_, String jarg2, int jarg3, long jarg4);
public final static native void peer_connection_handle_send_buffer__SWIG_1(long jarg1, peer_connection_handle jarg1_, String jarg2, int jarg3);
public final static native void peer_connection_handle_send_buffer(long jarg1, peer_connection_handle jarg1_, String jarg2, int jarg3);
public final static native long peer_connection_handle_last_seen_complete(long jarg1, peer_connection_handle jarg1_);
public final static native boolean peer_connection_handle_op_eq(long jarg1, peer_connection_handle jarg1_, long jarg2, peer_connection_handle jarg2_);
public final static native boolean peer_connection_handle_op_ne(long jarg1, peer_connection_handle jarg1_, long jarg2, peer_connection_handle jarg2_);
Expand Down
Expand Up @@ -139,12 +139,8 @@ public boolean in_handshake() {
return libtorrent_jni.peer_connection_handle_in_handshake(swigCPtr, this);
}

public void send_buffer(String begin, int size, long flags) {
libtorrent_jni.peer_connection_handle_send_buffer__SWIG_0(swigCPtr, this, begin, size, flags);
}

public void send_buffer(String begin, int size) {
libtorrent_jni.peer_connection_handle_send_buffer__SWIG_1(swigCPtr, this, begin, size);
libtorrent_jni.peer_connection_handle_send_buffer(swigCPtr, this, begin, size);
}

public long last_seen_complete() {
Expand Down
48 changes: 0 additions & 48 deletions swig/build-freebsd.sh

This file was deleted.

2 changes: 1 addition & 1 deletion swig/build-macos.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

export DEVELOPMENT_ROOT=~/Development
export BOOST_ROOT=$DEVELOPMENT_ROOT/boost_1_69_0
export BOOST_ROOT=$DEVELOPMENT_ROOT/boost_1_70_0
export LIBTORRENT_ROOT=$DEVELOPMENT_ROOT/libtorrent
export OPENSSL_ROOT=$DEVELOPMENT_ROOT/openssl-macos

Expand Down
1 change: 1 addition & 0 deletions swig/libtorrent.i
Expand Up @@ -1227,6 +1227,7 @@ namespace libtorrent {
%ignore libtorrent::file_storage::add_file(std::string const&, std::int64_t, std::uint32_t, std::time_t, string_view);
%ignore libtorrent::file_storage::file_range;
%ignore libtorrent::file_storage::piece_range;
%ignore libtorrent::file_storage::sanitize_symlinks;
%ignore libtorrent::create_torrent::add_url_seed(string_view);
%ignore libtorrent::create_torrent::add_http_seed(string_view);
%ignore libtorrent::create_torrent::add_tracker(string_view);
Expand Down
42 changes: 5 additions & 37 deletions swig/libtorrent_jni.cpp
Expand Up @@ -25641,7 +25641,7 @@ SWIGEXPORT jint JNICALL Java_org_libtorrent4j_swig_libtorrent_1jni_LIBTORRENT_1V

(void)jenv;
(void)jcls;
result = (int)(0);
result = (int)(1);
jresult = (jint)result;
return jresult;
}
Expand All @@ -25653,7 +25653,7 @@ SWIGEXPORT jint JNICALL Java_org_libtorrent4j_swig_libtorrent_1jni_LIBTORRENT_1V

(void)jenv;
(void)jcls;
result = (int)(((1*10000) +(2*100) +0));
result = (int)(((1*10000) +(2*100) +1));
jresult = (jint)result;
return jresult;
}
Expand All @@ -25665,7 +25665,7 @@ SWIGEXPORT jstring JNICALL Java_org_libtorrent4j_swig_libtorrent_1jni_LIBTORRENT

(void)jenv;
(void)jcls;
result = (char *)("1.2.0.0");
result = (char *)("1.2.1.0");
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}
Expand All @@ -25677,7 +25677,7 @@ SWIGEXPORT jstring JNICALL Java_org_libtorrent4j_swig_libtorrent_1jni_LIBTORRENT

(void)jenv;
(void)jcls;
result = (char *)("c76e9cc5e");
result = (char *)("f21a39496");
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}
Expand Down Expand Up @@ -65749,39 +65749,7 @@ SWIGEXPORT jboolean JNICALL Java_org_libtorrent4j_swig_libtorrent_1jni_peer_1con
}


SWIGEXPORT void JNICALL Java_org_libtorrent4j_swig_libtorrent_1jni_peer_1connection_1handle_1send_1buffer_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3, jlong jarg4) {
libtorrent::peer_connection_handle *arg1 = (libtorrent::peer_connection_handle *) 0 ;
char *arg2 = (char *) 0 ;
int arg3 ;
std::uint32_t arg4 ;

(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(libtorrent::peer_connection_handle **)&jarg1;
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
if (!arg2) return ;
}
arg3 = (int)jarg3;
arg4 = (std::uint32_t)jarg4;
{
try {
(arg1)->send_buffer((char const *)arg2,arg3,arg4);
} catch (std::exception& e) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what());
return ;
} catch (...) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type");
return ;
}
}
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
}


SWIGEXPORT void JNICALL Java_org_libtorrent4j_swig_libtorrent_1jni_peer_1connection_1handle_1send_1buffer_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) {
SWIGEXPORT void JNICALL Java_org_libtorrent4j_swig_libtorrent_1jni_peer_1connection_1handle_1send_1buffer(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) {
libtorrent::peer_connection_handle *arg1 = (libtorrent::peer_connection_handle *) 0 ;
char *arg2 = (char *) 0 ;
int arg3 ;
Expand Down

0 comments on commit 34f8ff5

Please sign in to comment.