| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
For non-Mingw32 build, set FD_CLOEXEC to file descriptors which live
beyond function scope. For Mingw32 build, just pass false to
bInheritHandles parameter of CreateProcessW.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Without file allocation, we cannot map file because file length could
be zero.
This could fix bug reported at GH-478
|
| |
|
|
| |
This will slow down checksum checking but does not thrash cache.
|
| |
|
|
|
| |
The latter persists for the lifetime of the file, while the former
affects only the current descriptor.
|
| |
|
|
| |
Closes #215
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Courtesy of llvm cpp11-migrate 3.3
|
| |
|
|
|
|
|
|
| |
Android NDK R8e does not provide ftruncate64, but bionic has the
assembler code to access kernel function. We borrowed those
ftruncate64.S files from android source code repository. It turns out
that x86 asm.h in NDK R8e is also broken, so latest asm.h was also
borrowed.
|
| | |
|
| | |
|
| |
|
|
|
| |
The warning was just a mistake. SetFilePointerEx + SetEndOfFile
actually allocate disk space.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I tried CreateFile but the subsequent ReadFile fails with Access
Denied if sparse file is read on NTFS. I mostly reverted previous
changes and use _wsopen with read/write share enabled instead of
CreateFile.
This change also includes --enable-mmap support for MinGW32
build. Memory mapped file may be useful for 64-bits OS and lots of
RAM. Currently, FlushViewOfFile is not called during the download, so
it is slightly vulnerable against sudden power loss. I found lots of
read when resuming download due to page fault. So for now it is useful
for the initial download. I recommend not to use
--file-allocation=prealloc with --enable-mmap for MinGW32, because it
triggers page faults even in the initial download. Anyway, the option
is experimental.
|
| |
|
|
| |
Now file has been opened by aria2 is now readable by other processes.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Using off_t, at least, in DiskAdaptor layer is problematic because
torrent can contain under 2GiB files but total sum of those files may
exceed 2GiB limit, which makes off_t overflow in 32 bit system without
large file support. So we use int64_t in API. We'll check the file
length before download so that it does not exceed max off_t.
|
| | |
|
| |
|
|
|
| |
If this option is used, map files into memory using mmap(2). This
option is experimental.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
~AbstractDiskWriter calles closeFile(), but suppresses exception.
MultiDiskAdaptor::closeFile() logs error if child
DiskWriter::closeFile() throws exception. This exception is not
rethrown. If at least one exception is caught,
MultiDiskAdaptor::closeFile() throws new DlAbortEx.
RequestGroupMan::closeFile() just logs exception and suppress each
exception. Generally, don't call closeFile() in destructor. If you
need to call it, it must suppress the exception.
|
| |
|
|
|
| |
Since off_t is int64_t with LFS, we cannot take advantage of extra
capacity of uint64_t.
|
| |
|
|
|
|
|
| |
We replaced most of std::cerr with global::cerr. windows.h is now
included from common.h. Before including it, we define WINVER. We
renamed some variable name because some macros in windows.h collide
with them.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
We use SetFilePointerEx and SetEndOfFile to allocate extents. This
only works with NTFS. To enable this feature, --file-allocation=falloc
must be given.
|
| |
|
|
| |
GetLastError() returns DWORD, not C-String.
|
| |
|
|
| |
does not have fallocate().
|
| |
|
|
|
| |
I have not set error code for all exception invocation.
In this change, I set error code where error likely occurs.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Replaced StringFormat with fmt
|
| |
|
|
|
|
|
| |
Rewritten Logger interface. Logger now writes source file name and
line number in log file.
|
| |
|
|
|
|
|
|
| |
Retry open(2) and fallocate(2) when they are interrupted by
signal.
* src/AbstractDiskWriter.cc
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Capture errno right after system/library call to avoid it to get
overwritten. Use util::safeStrerror instead of strerror directly
because strerror might return NULL. We don't check errno for
std::fstream anymore.
* src/AbstractDiskWriter.cc
* src/CookieStorage.cc
* src/DHTAutoSaveCommand.cc
* src/DHTRoutingTableDeserializer.cc
* src/DHTRoutingTableSerializer.cc
* src/DefaultBtProgressInfoFile.cc
* src/EpollEventPoll.cc
* src/IteratableChunkChecksumValidator.cc
* src/KqueueEventPoll.cc
* src/Logger.cc
* src/MessageDigestHelper.cc
* src/PortEventPoll.cc
* src/SelectEventPoll.cc
* src/SocketCore.cc
* src/message.h
* src/util.cc
* src/util.h
|
| |
|
|
|
|
|
| |
Rewritten AbstractDiskWriter::openFile() without File::exists().
* src/AbstractCommand.cc
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When allocating disk space, for Linux system with fallocate()
system call, first check file system supports fallocate. This
just run fallocate with small chunk and see it succeeds or fails.
If it succeeds, use fallocate() to allocate entire file otherwise
fall back to traditional slower method: writing zeros. This
behavior is enabled in --file-allocation=prealloc, so this is
enabled by default for most modern Linux.
* configure.ac
* src/AbstractDiskWriter.cc
* src/AbstractDiskWriter.h
* src/AbstractSingleDiskAdaptor.cc
* src/AdaptiveFileAllocationIterator.cc
* src/AdaptiveFileAllocationIterator.h
* src/DefaultPieceStorage.cc
* src/DiskAdaptor.cc
* src/DiskAdaptor.h
* src/FallocFileAllocationIterator.cc
* src/Makefile.am
* src/MultiFileAllocationIterator.cc
* src/OptionHandlerFactory.cc
* test/FallocFileAllocationIteratorTest.cc
* test/Makefile.am
|
| |
|
|
|
|
|
| |
Changed naming standards for class member variable: now it looks
like var_ instead of _var.
|
| |
|
|
|
|
|
|
| |
Made protected member variable private. Added accessor funcs.
* src/AbstractDiskWriter.cc
* src/AbstractDiskWriter.h
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed compile error with i586-mingw32msvc-g++. Always Cut console
readout by 80 characters in mingw32 build. Catch exception in
DHTMessageReceiver::receiveMessage().
* src/AbstractDiskWriter.cc
* src/ConsoleStatCalc.cc
* src/DHTMessageReceiver.cc
* src/File.cc
* src/RequestGroupMan.cc
* src/a2io.h
* test/FileTest.cc
|