Skip to content

Commit

Permalink
update to libtorrent master HEAD, version 2.0.2-14 (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml authored Mar 20, 2021
1 parent 8893dbc commit 6ce65e1
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
submodules: recursive
- name: install packages
run: |
choco install boost-msvc-14.2
choco install openssl
choco install mingw
choco install grep
- name: cmake
run: |
$env:BOOST_ROOT=$env:BOOST_ROOT_1_72_0
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -B build -G "Visual Studio 16 2019" -A x64 swig
- name: build
run: cmake --build build --config Release --parallel 2
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
}

group = "org.libtorrent4j"
version = "2.0.2-13"
version = "2.0.2-14"

java {
// using java 8 for android compatibility
Expand Down
12 changes: 12 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
2.0.2-14

* using libtorrent master
* minimum supported Android 32 bits API >= 19
* minimum supported Android 64 bits API >= 21
* using android NDK r22
* using android prebuilt toolchain
* using android LLD linker
* lt:fix size_on_disk patch
* lt:fix torrent_info::v2 to be correct after freeing piece layers from
torrent_info
* lt:allow no-interest timeouts of peer connections before all connections
slots are full
* lt:add flag to force canonical file order and padding for v1-only torrents
* lt:return nullptr instead of crashing in get_storage_impl
* lt:fix issue where peers entering upload-mode cannot leave upload-mode
* lt:fix issue where a DHT message would count as an incoming connection
* lt:source code cleanup, performance and stability

2.0.2-13

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/libtorrent4j/LibTorrent.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static String version() {
* @return the git revision
*/
public static String revision() {
return "76c8f3fa1ec5bcab595fe964349468a4b0f7be7f";
return "e026f5782477cd2348c06f1a2be3503f366118a8";
}

/**
Expand Down Expand Up @@ -71,7 +71,7 @@ public static String opensslVersion() {
* @return libtorrent4j version.
*/
public static String libtorrent4jVersion() {
return "2.0.2-13";
return "2.0.2-14";
}

/**
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/org/libtorrent4j/TorrentBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,15 @@ public void progress(int i) {
*/
public static final create_flags_t V1_ONLY = create_torrent.v1_only;

/**
* This flag only affects v1-only torrents, and is only relevant
* together with the v1_only_flag. This flag will force the
* same file order and padding as a v2 (or hybrid) torrent would have.
* It has the effect of ordering files and inserting pad files to align
* them with piece boundaries.
*/
public static final create_flags_t CANONICAL_FILES = create_torrent.canonical_files;

/**
*
*/
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/libtorrent4j/swig/create_torrent.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,5 @@ public void set_hash2(int file, int piece, sha256_hash h) {
public final static create_flags_t symlinks = new create_flags_t(libtorrent_jni.create_torrent_symlinks_get(), false);
public final static create_flags_t v2_only = new create_flags_t(libtorrent_jni.create_torrent_v2_only_get(), false);
public final static create_flags_t v1_only = new create_flags_t(libtorrent_jni.create_torrent_v1_only_get(), false);
public final static create_flags_t canonical_files = new create_flags_t(libtorrent_jni.create_torrent_canonical_files_get(), false);
}
1 change: 1 addition & 0 deletions src/main/java/org/libtorrent4j/swig/libtorrent_jni.java
Original file line number Diff line number Diff line change
Expand Up @@ -3221,6 +3221,7 @@ public class libtorrent_jni {
public final static native long create_torrent_symlinks_get();
public final static native long create_torrent_v2_only_get();
public final static native long create_torrent_v1_only_get();
public final static native long create_torrent_canonical_files_get();
public final static native long new_create_torrent__SWIG_0(long jarg1, file_storage jarg1_, int jarg2, long jarg3, create_flags_t jarg3_);
public final static native long new_create_torrent__SWIG_1(long jarg1, file_storage jarg1_, int jarg2);
public final static native long new_create_torrent__SWIG_2(long jarg1, file_storage jarg1_);
Expand Down
12 changes: 12 additions & 0 deletions swig/libtorrent_jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74702,6 +74702,18 @@ SWIGEXPORT jlong JNICALL Java_org_libtorrent4j_swig_libtorrent_1jni_create_1torr
}


SWIGEXPORT jlong JNICALL Java_org_libtorrent4j_swig_libtorrent_1jni_create_1torrent_1canonical_1files_1get(JNIEnv *jenv, jclass jcls) {
jlong jresult = 0 ;
libtorrent::flags::bitfield_flag< unsigned int,libtorrent::create_flags_tag > *result = 0 ;

(void)jenv;
(void)jcls;
result = (libtorrent::flags::bitfield_flag< unsigned int,libtorrent::create_flags_tag > *)&libtorrent::create_torrent::canonical_files;
*(libtorrent::flags::bitfield_flag< unsigned int,libtorrent::create_flags_tag > **)&jresult = result;
return jresult;
}


SWIGEXPORT jlong JNICALL Java_org_libtorrent4j_swig_libtorrent_1jni_new_1create_1torrent_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jlong jarg3, jobject jarg3_) {
jlong jresult = 0 ;
libtorrent::file_storage *arg1 = 0 ;
Expand Down

0 comments on commit 6ce65e1

Please sign in to comment.