forked from premiere/premiere-libtorrent
merged RC_1_1 into master
This commit is contained in:
commit
244d18dcf8
|
@ -77,6 +77,8 @@
|
|||
* resume data no longer has timestamps of files
|
||||
* require C++11 to build libtorrent
|
||||
|
||||
* fix full allocation failure on APFS
|
||||
|
||||
1.1.5 release
|
||||
|
||||
* fix infinite loop when parsing certain invalid magnet links
|
||||
|
|
|
@ -338,6 +338,7 @@ void bind_alert()
|
|||
class_<torrent_alert, bases<alert>, noncopyable>(
|
||||
"torrent_alert", no_init)
|
||||
.add_property("handle", make_getter(&torrent_alert::handle, by_value()))
|
||||
.add_property("torrent_name", &torrent_alert::torrent_name)
|
||||
;
|
||||
|
||||
class_<tracker_alert, bases<torrent_alert>, noncopyable>(
|
||||
|
|
|
@ -336,6 +336,8 @@ class test_alerts(unittest.TestCase):
|
|||
ses.wait_for_alert(1000) # milliseconds
|
||||
alerts = ses.pop_alerts()
|
||||
for a in alerts:
|
||||
if a.what() == 'add_torrent_alert':
|
||||
self.assertEquals(a.torrent_name, 'temp')
|
||||
print(a.message())
|
||||
for field_name in dir(a):
|
||||
if field_name.startswith('__'):
|
||||
|
|
26
src/file.cpp
26
src/file.cpp
|
@ -1193,17 +1193,23 @@ namespace {
|
|||
fstore_t f = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, s, 0};
|
||||
if (fcntl(native_handle(), F_PREALLOCATE, &f) < 0)
|
||||
{
|
||||
if (errno != ENOSPC)
|
||||
// It appears Apple's new filesystem (APFS) does not
|
||||
// support this control message and fails with EINVAL
|
||||
// if so, just skip it
|
||||
if (errno != EINVAL)
|
||||
{
|
||||
ec.assign(errno, system_category());
|
||||
return false;
|
||||
}
|
||||
// ok, let's try to allocate non contiguous space then
|
||||
f.fst_flags = F_ALLOCATEALL;
|
||||
if (fcntl(native_handle(), F_PREALLOCATE, &f) < 0)
|
||||
{
|
||||
ec.assign(errno, system_category());
|
||||
return false;
|
||||
if (errno != ENOSPC)
|
||||
{
|
||||
ec.assign(errno, system_category());
|
||||
return false;
|
||||
}
|
||||
// ok, let's try to allocate non contiguous space then
|
||||
f.fst_flags = F_ALLOCATEALL;
|
||||
if (fcntl(native_handle(), F_PREALLOCATE, &f) < 0)
|
||||
{
|
||||
ec.assign(errno, system_category());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // F_PREALLOCATE
|
||||
|
|
Loading…
Reference in New Issue