mirror of
https://github.com/aria2/aria2.git
synced 2026-04-11 23:39:05 +00:00
Fixed chunk checksum validation cannot detect trailing garbage data. BUG#2074141 * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/CheckIntegrityEntry.cc * src/CheckIntegrityEntry.h * src/DiskAdaptor.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/RequestGroup.cc * test/DirectDiskAdaptorTest.cc * test/MultiDiskAdaptorTest.cc * test/TestUtil.cc * test/TestUtil.h
16 lines
256 B
C++
16 lines
256 B
C++
#include "TestUtil.h"
|
|
#include "a2io.h"
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <fcntl.h>
|
|
|
|
namespace aria2 {
|
|
|
|
void createFile(const std::string& path, size_t length)
|
|
{
|
|
int fd = creat(path.c_str(), OPEN_MODE);
|
|
ftruncate(fd, length);
|
|
}
|
|
|
|
};
|