forward port fixes from RC_1_0

This commit is contained in:
arvidn 2016-01-03 23:34:57 -05:00
parent 7282195ef0
commit a0678240f3
3 changed files with 24 additions and 5 deletions

View File

@ -76,6 +76,8 @@
* almost completely changed the storage interface (for custom storage) * almost completely changed the storage interface (for custom storage)
* added support for hashing pieces in multiple threads * added support for hashing pieces in multiple threads
* fix long filename issue (on unixes)
* fixed performance bug in DHT torrent eviction
* fixed win64 build (GetFileAttributesEx) * fixed win64 build (GetFileAttributesEx)
* fixed bug when deleting files for magnet links before they had metadata * fixed bug when deleting files for magnet links before they had metadata

View File

@ -3,6 +3,9 @@
import libtorrent as lt import libtorrent as lt
import unittest import unittest
import time
import os
import shutil
import binascii import binascii
# test torrent_info # test torrent_info
@ -21,6 +24,23 @@ class test_torrent_info(unittest.TestCase):
self.assertEqual(f.file_size(0), 1234) self.assertEqual(f.file_size(0), 1234)
self.assertEqual(info.total_size(), 1234) self.assertEqual(info.total_size(), 1234)
class test_alerts(unittest.TestCase):
def test_alert(self):
ses = lt.session()
sett = lt.session_settings()
sett.alert_mask = 0xffffffff
ses.set_alert_mask(0xfffffff)
shutil.copy(os.path.join('..', '..', 'test', 'test_torrents', 'base.torrent'), '.')
ti = lt.torrent_info('base.torrent');
h = ses.add_torrent({'ti': ti, 'save_path': '.'})
time.sleep(1)
ses.remove_torrent(h)
alerts = ses.pop_alerts()
for a in alerts:
print a.message()
class test_bencoder(unittest.TestCase): class test_bencoder(unittest.TestCase):
def test_bencode(self): def test_bencode(self):

View File

@ -373,14 +373,11 @@ POSSIBILITY OF SUCH DAMAGE.
#elif defined MAXPATH #elif defined MAXPATH
#define TORRENT_MAX_PATH MAXPATH #define TORRENT_MAX_PATH MAXPATH
// posix
#elif defined NAME_MAX
#define TORRENT_MAX_PATH NAME_MAX
// none of the above // none of the above
#else #else
// this is the maximum number of characters in a // this is the maximum number of characters in a
// path element / filename on windows // path element / filename on windows and also on many filesystems commonly used
// on linux
#define TORRENT_MAX_PATH 255 #define TORRENT_MAX_PATH 255
#ifdef _MSC_VER #ifdef _MSC_VER