Skip to content

Commit

Permalink
Merge pull request #1 from rakshasa/master
Browse files Browse the repository at this point in the history
merge master
  • Loading branch information
Novik authored Aug 27, 2018
2 parents 37fb7d0 + a4b281a commit 42395c4
Show file tree
Hide file tree
Showing 50 changed files with 2,009 additions and 820 deletions.
86 changes: 70 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,74 @@
language: cpp
compiler:
- gcc
- clang

before_install:
- sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get build-dep rtorrent libtorrent-dev

- if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.7; fi
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.7" CC="gcc-4.7"; fi
matrix:
include:
- compiler: clang
env: COMPILER=clang++ SKIP_CHECK=true
- compiler: clang
env: COMPILER=clang++
addons:
apt:
packages:
- libcppunit-dev
- compiler: clang
env: COMPILER=clang++-3.6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
packages:
- clang-3.6
- libcppunit-dev
- compiler: clang
env: COMPILER=clang++-3.7
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
packages:
- clang-3.7
- libcppunit-dev
- compiler: clang
env: COMPILER=clang++-3.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
- libcppunit-dev
- compiler: gcc
env: COMPILER=g++-4.7 SKIP_CHECK=true
addons:
apt:
sources: ubuntu-toolchain-r-test
packages:
- g++-4.7
- compiler: gcc
env: COMPILER=g++-4.7
addons:
apt:
sources: ubuntu-toolchain-r-test
packages:
- g++-4.7
- libcppunit-dev
- compiler: gcc
env: COMPILER=g++-4.8
addons:
apt:
sources: ubuntu-toolchain-r-test
packages:
- g++-4.8
- libcppunit-dev

# prevent `macro `AM_PATH_CPPUNIT' not found in library` in `autogen.sh`
- sudo apt-get install libcppunit-dev

- git clone https://github.com/rakshasa/libtorrent.git && cd libtorrent && ./autogen.sh && configure && make -j12 && sudo make install && cd ..
# TODO: Use the same branch name if libtorrent has it.
before_install:
- git clone https://github.com/rakshasa/libtorrent.git
- cd libtorrent && ./autogen.sh && CXX="$COMPILER" ./configure && make -j12 && sudo make install

# Figure out how to fix the issue running 'make check'.
script: ./autogen.sh && ./configure && make -j12 && sudo make install
script:
- ./autogen.sh && CXX="$COMPILER" ./configure && make -j12
- if [ ! $SKIP_CHECK ]; then make -j12 check; fi
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Jari Sundell <jaris@ifi.uio.no>
Jari Sundell <sundell.software@gmail.com>
9 changes: 7 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ DEPENDENCIES

CONTACT

Send bug reports, suggestions and patches to <jaris@ifi.uio.no> or
to the mailinglist.
Jari Sundell

Skomakerveien 33
3185 Skoppum, NORWAY

Send bug reports, suggestions and patches to
<sundell.software@gmail.com> or to the mailinglist.
25 changes: 11 additions & 14 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
AC_INIT(rtorrent, 0.9.6, sundell.software@gmail.com)
AC_INIT(rtorrent, 0.9.7, sundell.software@gmail.com)

AC_DEFINE(API_VERSION, 9, api version)

AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(config.h)
AM_PATH_CPPUNIT(1.9.6)

AC_PROG_RANLIB
AC_PROG_CXX
AC_PROG_LIBTOOL

RAK_CHECK_CFLAGS
RAK_CHECK_CXXFLAGS
RAK_ENABLE_DEBUG
RAK_ENABLE_EXTRA_DEBUG
RAK_ENABLE_WERROR
Expand All @@ -33,21 +35,16 @@ AX_PTHREAD([], AC_MSG_ERROR([requires pthread]))
AX_WITH_CURSES

if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then
AC_MSG_ERROR([requires either NcursesW or Ncurses library])
AC_MSG_ERROR([requires either NcursesW or Ncurses library])
fi

CFLAGS="$CFLAGS $PTHREAD_CFLAGS $CURSES_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS $CURSES_CFLAGS"
LIBS="$PTHREAD_LIBS $CURSES_LIB $LIBS"
PKG_CHECK_MODULES([LIBCURL], [libcurl], , [LIBCURL_CHECK_CONFIG])
PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"])
PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.13.7])

PKG_CHECK_MODULES([libcurl], libcurl >= 7.15.4,
CXXFLAGS="$CXXFLAGS $libcurl_CFLAGS";
LIBS="$LIBS $libcurl_LIBS")

PKG_CHECK_MODULES([libtorrent], libtorrent >= 0.13.6,
CXXFLAGS="$CXXFLAGS $libtorrent_CFLAGS";
LIBS="$LIBS $libtorrent_LIBS",
[AC_MSG_ERROR([libtorrent >= 0.13.6 not found. Install from https://github.com/rakshasa/libtorrent.git])])
LIBS="$PTHREAD_LIBS $CURSES_LIB $CPPUNIT_LIBS $LIBCURL $LIBCURL_LIBS $DEPENDENCIES_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS $CPPUNIT_CFLAGS $LIBCURL_CPPFLAGS $LIBCURL_CFLAGS $DEPENDENCIES_CFLAGS $CURSES_CFLAGS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS $CPPUNIT_CFLAGS $LIBCURL_CPPFLAGS $LIBCURL_CFLAGS $DEPENDENCIES_CFLAGS $CURSES_CFLAGS"

AC_LANG_PUSH(C++)
TORRENT_WITH_XMLRPC_C
Expand Down
82 changes: 55 additions & 27 deletions doc/rtorrent.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,76 @@
# uncomment the options you wish to enable.

# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
#max_peers = 100
#
#throttle.min_peers.normal.set = 40
#throttle.max_peers.normal.set = 100

# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
#max_peers_seed = 50
#
#throttle.min_peers.seed.set = 10
#throttle.max_peers.seed.set = 50

# Maximum number of simultanious uploads per torrent.
#max_uploads = 15
#
#throttle.max_uploads.set = 15

# Global upload and download rate in KiB. "0" for unlimited.
#download_rate = 0
#upload_rate = 0
#
#throttle.global_down.max_rate.set_kb = 0
#throttle.global_up.max_rate.set_kb = 0

# Default directory to save the downloaded torrents.
#directory = ./
#
#directory.default.set = ./

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
#session = ./session
#
#session.path.set = ./session

# Watch a directory for new torrents, and stop those that have been
# deleted.
#schedule = watch_directory,5,5,load.start=./watch/*.torrent
#schedule = untied_directory,5,5,stop_untied=
#
#schedule2 = watch_directory,5,5,load.start=./watch/*.torrent
#schedule2 = untied_directory,5,5,stop_untied=

# Close torrents when diskspace is low.
#schedule = low_diskspace,5,60,close_low_diskspace=100M
#
#schedule2 = low_diskspace,5,60,close_low_diskspace=100M

# The ip address reported to the tracker.
#ip = 127.0.0.1
#ip = rakshasa.no
#
#network.local_address.set = 127.0.0.1
#network.local_address.set = rakshasa.no

# The ip address the listening socket and outgoing connections is
# bound to.
#bind = 127.0.0.1
#bind = rakshasa.no
#
#network.bind_address.set = 127.0.0.1
#network.bind_address.set = rakshasa.no

# Port range to use for listening.
#port_range = 6890-6999
#
#network.port_range.set = 6890-6999

# Start opening ports at a random position within the port range.
#port_random = no
#
#network.port_random.set = no

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
#check_hash = no
#
#pieces.hash.on_completion.set = no

# Set whether the client should try to connect to UDP trackers.
#use_udp_trackers = yes
#
#trackers.use_udp.set = yes

# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa
#
#schedule2 = ip_tick,0,1800,ip=rakshasa
#schedule2 = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
Expand All @@ -66,19 +81,32 @@
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
# encryption = allow_incoming,enable_retry,prefer_plaintext
# protocol.encryption.set = allow_incoming,enable_retry,prefer_plaintext

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
#
# dht = auto
# dht.mode.set = auto

# UDP port to use for DHT.
#
# dht_port = 6881
#
#dht.port.set = 6881

# Enable peer exchange (for torrents not marked private)
#
# peer_exchange = yes
#protocol.pex.set = yes

# Set downlad list layout style. ("full", "compact")
#
#ui.torrent_list.layout.set = "full"

# SCGI Connectivity (for alternative rtorrent interfaces, XMLRPC)
#
# Use a IP socket with scgi_port, or a Unix socket with scgi_local.
# schedule can be used to set permissions on the unix socket.
#
#scgi_port = 127.0.0.1:5000
#scgi_local = /home/user/rtorrent/rpc.socket
#schedule = scgi_permission,0,0,"execute.nothrow=chmod,\"g+w,o=\",/home/user/rtorrent/rpc.socket"
7 changes: 5 additions & 2 deletions doc/rtorrent_fast_resume.pl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
my $mtime = (stat "$d$files[$f]")[9];

# Compute number of chunks per file
my $fsize = $t->{info}{files}[$f]{length};
my $fsize = (exists $t->{info}{files}) ? $t->{info}{files}[$f]{length} : 1;
my $fchunks = ($pmod ? 1 : 0);
if ($pmod >= $fsize) { ($fsize, $pmod ) = (0, $pmod-$fsize); }
else { ($pmod, $fsize) = (0, $fsize-$pmod); }
Expand All @@ -101,7 +101,10 @@
$t->{libtorrent_resume}{'uncertain_pieces.timestamp'} = time;

# Some extra information to re-enforce the fact that this is a finished torrent
$d .= $t->{info}{name};
if (exists $t->{info}{files}) {
$d .= $t->{info}{name};
}

$t->{rtorrent} = {
state => 1, # started
state_changed => time,
Expand Down
Loading

0 comments on commit 42395c4

Please sign in to comment.