summaryrefslogtreecommitdiff
path: root/src/a2io.h
Commit message (Collapse)AuthorAgeFilesLines
* Update android build dependenciesTatsuhiro Tsujikawa2019-09-151-1/+1
| | | | | Update android build dependencies. Use android NDK r20 and build aarch64 binary.
* Enable IndentPPDirectivesTatsuhiro Tsujikawa2018-06-091-87/+87
|
* make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-86/+86
|
* Fixed some typos in code commentsDan Fandrich2015-01-161-1/+1
|
* mingw: Use MoveFileExW for better atomic moveTatsuhiro Tsujikawa2014-10-101-3/+0
|
* Support off64_t for Android buildTatsuhiro Tsujikawa2013-05-061-2/+34
| | | | | | | | 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.
* mingw32: Use HANDLE only for MinGW32 buildTatsuhiro Tsujikawa2012-12-151-0/+6
|
* mingw32: Open file using _wsopen and added --enable-mmap supportTatsuhiro Tsujikawa2012-12-011-2/+9
| | | | | | | | | | | | | | | | | 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.
* Rewritten DefaultBtProgressInfoFile using stdio instead of stream.Tatsuhiro Tsujikawa2011-08-051-0/+2
|
* In MinGW32, open file with UNICODE filename and print them in ANSI.Tatsuhiro Tsujikawa2011-08-041-2/+14
|
* Removed ENABLE_DIRECT_IO macro.Tatsuhiro Tsujikawa2011-07-161-4/+0
|
* 2010-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-311-3/+3
| | | | | | Made #include guard consistent for c++ header files.
* 2010-04-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-191-1/+3
| | | | | | | | | | | | | | | | | | | | | Supported poll() for socket event notification. --event-poll can take value "poll". Fixed the bug that timeout for SocketCore::isReadable()/isWritable() is ignored when epoll is used. * src/OptionHandlerFactory.cc * src/a2io.h * src/prefs.h * src/SocketCore.h * src/Makefile.am * src/main.cc * src/PollEventPoll.h * src/SocketCore.cc * src/DownloadEngineFactory.cc * src/PollEventPoll.cc * src/prefs.cc * configure.ac
* 2010-01-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-241-9/+14
| | | | | | | | | | | | | | | 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
* 2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-051-22/+22
| | | | | | | | | Untabify. Fixed one line in copyright which is longer than 80 columns. * src * test
* 2009-12-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-12-091-1/+3
| | | | | | | | | | If '-' is given as an argument to --metalink-file option, aria2 reads Metalink file from stdin. * src/OptionHandlerFactory.cc * src/OptionHandlerImpl.h * src/a2io.h
* 2009-01-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-01-151-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added --event-poll option to select the method for polling events. The available methods are "select" and "epoll". "epoll" is available on Linux only. The earlier release has the compile option to choose from these methods. * configure.ac * src/RequestGroupMan.cc * src/OptionHandlerFactory.cc * src/EpollEventPoll.h * src/StreamFileAllocationEntry.cc * src/a2io.h * src/SelectEventPoll.h * src/option_processing.cc * src/prefs.h * src/EpollEventPoll.cc * src/EventPoll.h * src/SocketCore.h * src/Makefile.am * src/main.cc * src/DownloadEngine.h * src/SelectEventPoll.cc * src/DownloadEngine.cc * src/SocketCore.cc * src/DownloadEngineFactory.cc * src/Makefile.in * src/prefs.cc * src/usage_text.h
* 2008-07-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-07-061-0/+2
| | | | | | | | | | | | | | | Introduced a2_struct_stat. It is defined as `struct _stati64' if __MINGW32__ is defined, because under MinGW32, _stati64 is used and its second argument is of type `struct _stati64'. Otherwise it is defined as `struct stat'. * src/AbstractDiskWriter.cc * src/File.cc * src/File.h * src/a2io.h
* 2008-07-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-07-051-0/+1
| | | | | | | | | Fixed the compile error in hurd-i386 See the original bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=488602 * src/a2io.h
* 2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-06-161-2/+11
| | | | | | | | | | | Applied Ross's aria2-0.13.2+1-mingw-4.patch. In this change, a2io.h and common.h were modified. * src/a2io.h: Changed seek/stat/tell calls to use 64 bit versions in MinGW. * src/common.h: Changed off_t to 64 bit in MinGW.
* 2008-05-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-311-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added epoll support. Use epoll if it is available. If not, use select. When async dns is enabled in compile time, epoll support is enabled only when aria2 is built with c-ares. This condition statement is defined in a2io.h. Currently aria2 supports both c-ares and ares, but ares is maintained for quite a while and debian already has c-ares package, ares support will be dropped in the future version. * configure.ac * src/AbstractCommand.cc * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/Command.cc * src/Command.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/PeerAbstractCommand.cc * src/SocketCore.cc * src/SocketCore.h * src/a2io.h
* 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-02-081-0/+3
| | | | | | | | | Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
* 2007-11-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-281-2/+2
| | | | | | | Fixed a2io.h * src/a2io.h
* 2007-11-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added direct I/O support. The current implementation uses O_DIRECT, which is not posix standard and is tested on linux 2.6.21. Currently only file allocation uses direct I/O. * src/SingleFileAllocationIterator.{h, cc} * test/SingleFileAllocationIteratorTest.cc * src/MultiFileAllocationIterator.{h, cc} * test/MultiFileAllocationIteratorTest.cc * src/BinaryStream.h * src/DiskWriter.h * src/AbstractDiskWriter.{h, cc} * src/ByteArrayDiskWriter.h * src/DiskAdaptor.h * src/AbstractSingleDiskAdaptor.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/FileAllocationEntry.cc * src/Util.{h, cc} * src/OptionHandlerFactory.cc * src/prefs.h * src/version_usage.cc * src/option_processing.cc Moved FileAllocationMan::markCurrentFileAllocationEntryDone() to handleException. * src/MultiFileAllocationIterator.cc Added EINTR handling * src/SocketCore.cc
* 2007-08-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make a2netcompat.h include a2io.h to fix compilation error: * src/a2netcompat.h * src/SocketCore.cc: Removed include of a2io.h * src/Util.cc: Removed include of a2io.h Gather time related functions to a2time.h: * src/a2time.h: New file. * src/DefaultPeerStorage.cc * src/SimpleLogger.cc * src/Util.{h, cc} * src/SimpleRandomizer.h * src/TimeA2.{h,cc} * src/DownloadCommand.cc * src/main.cc Removed #ifdef __MINGW32__ since gai_strerror is included in a2netcompat.h: * src/NameResolver.cc Fixed compilation error without openssl: * src/SocketCore.{h,cc}: Moved include of openssl/err.h to SocketCore.h Added default block to suppress compiler warnings: * src/MetalinkRequestInfo.cc (AccumulateNonP2PUrl::operator()) 2007-07-26 Ross Smith II <aria2spam at smithii dot com> MinGW build enhancements. The following files are added: * src/gai_strerror.{c,h} * src/gettimeofday.{c,h} Changes to support the above new files: * configure.ac * src/Makefile.am * src/a2netcompat.h * src/TimeA2.cc * src/DefaultPeerStorage.cc * src/NameResolver.cc: removed mingw_strerror() function. * src/SocketCore.cc: removed mingw_strerror() function. Miscellaneous MinGW build fixes. * src/a2io.h: Use _lseeki64() instead of lseek() * src/common.h * src/DefaultFileAllocator.cc * src/GlowFileAllocator.cc * src/main.cc: Moved #include "prefs.h" to quiet compile error. * src/NameResolver.cc (callback): Changed int32_t to int. (resolve): Changed int32_t to int. * src/Platform.cc * src/Platform.h * test/MultiDiskWriterTest.cc * test/PeerMessageUtilTest.cc * src/localtime_r.c: Add DeleteCriticalSection() and at exit(). Other enhancements and fixes. * src/HttpRequestCommand.cc (executeInternal) Use non-blocking socket for HTTPS (MinGW only). * src/SocketCore.cc: (error): New function to abstract errno/WSAGetLastError(). (errorMsg): New function to abstract errno/WSAGetLastError(). (initiateSecureConnection): Added more detailed error reporting. * src/SocketCore.h: Added private variable blocking, to allow proper handling of OpenSSL psuedo-errors. * src/message.h (EX_SSL_INIT_FAILURE) (EX_SSL_IO_ERROR) (EX_SSL_PROTOCOL_ERROR) (EX_SSL_UNKNOWN_ERROR) (EX_SSL_CONNECT_ERROR) (EX_SOCKET_BLOCKING) (EX_SOCKET_NONBLOCKING) (EX_SOCKET_UNKNOWN_ERROR) * src/Util.cc (setGlobalSignalHandler): Renamed signal to sig as signal is a reserved name. (httpGMT): Fixed typo.
* 2007-07-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-07-231-0/+119
Merged Ross's win32 patch(manually) In the course of merging, following files are added. * src/strptime.{h,c} * src/libgen.{h,c} * src/inet_aton.{h,c} * src/Platform.{h,cc} * src/localtime_r.{h,c} * src/getaddrinfo.{h,c} I've gethered network related things, and put them to following file: * src/a2netcompat.h Also io related things are put to following file: * src/a2io.h Changed %lld to %s because mingw32 doesn't recognize %lld. * src/message.h (MSG_ALLOCATION_COMPLETED) (EX_TOO_LARGE_FILE) (EX_SIZE_MISMATCH) (EX_FILE_OFFSET_OUT_OF_RANGE) (EX_INVALID_CHUNK_CHECKSUM) (EX_INVALID_RANGE_HEADER) * src/FileAllocationCommand.cc * src/HttpResponse.cc * src/RequestGroup.cc * src/MultiDiskAdaptor.cc * src/OptionHandlerImpl.h * src/HttpResponseCommand.cc * src/FtpNegotiateCommand.cc * src/IteratableChecksumValidator.cc * src/SegmentMan.cc * src/ChunkChecksumValidator.cc Added Randomizer::getRandomNumber(long int) * src/Randomizer.h (getRandomNumber) * src/SimpleRandomizer.h (getRandomNumber) * src/BitfieldMan.cc (getMissingIndexRandomly): Use this new function. * src/Util.cc (randomAlpha): Use this new function.