forked from premiere/premiere-libtorrent
merged SetFileValidData fix from RC_0_16
This commit is contained in:
parent
a943fec777
commit
bfdb445890
|
@ -41,6 +41,7 @@
|
|||
* fix uTP edge case where udp socket buffer fills up
|
||||
* fix nagle implementation in uTP
|
||||
|
||||
* SetFileValidData fix on windows (prevents zero-fill)
|
||||
* fix minor lock_files issue on unix
|
||||
|
||||
0.16.15 release
|
||||
|
|
|
@ -322,6 +322,8 @@ namespace libtorrent
|
|||
#endif
|
||||
#if defined TORRENT_WINDOWS
|
||||
mutable int m_cluster_size;
|
||||
|
||||
static bool has_manage_volume_privs;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
10
src/file.cpp
10
src/file.cpp
|
@ -946,6 +946,14 @@ namespace libtorrent
|
|||
};
|
||||
#endif // TORRENT_WINDOWS
|
||||
|
||||
|
||||
#ifdef TORRENT_WINDOWS
|
||||
bool get_manage_volume_privs();
|
||||
|
||||
// this needs to be run before CreateFile
|
||||
bool file::has_manage_volume_privs = get_manage_volume_privs();
|
||||
#endif
|
||||
|
||||
file::file()
|
||||
#ifdef TORRENT_WINDOWS
|
||||
: m_file_handle(INVALID_HANDLE_VALUE)
|
||||
|
@ -2025,8 +2033,6 @@ typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
|
|||
|
||||
void set_file_valid_data(HANDLE f, boost::int64_t size)
|
||||
{
|
||||
static bool has_privs = get_manage_volume_privs();
|
||||
|
||||
typedef BOOL (WINAPI *SetFileValidData_t)(HANDLE, LONGLONG);
|
||||
static SetFileValidData_t pSetFileValidData = NULL;
|
||||
static bool failed_kernel32 = false;
|
||||
|
|
Loading…
Reference in New Issue