mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-18 07:06:18 +00:00
Compare commits
4 Commits
0c507c581f
...
v0.16.23
| Author | SHA1 | Date | |
|---|---|---|---|
| 3787dbe7f3 | |||
| 282c86597a | |||
| c41e63248a | |||
| 641626029a |
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
m4_pattern_allow([PKG_CHECK_EXISTS])
|
m4_pattern_allow([PKG_CHECK_EXISTS])
|
||||||
|
|
||||||
AC_INIT([rtorrent],[0.16.22],[sundell.software@gmail.com])
|
AC_INIT([rtorrent],[0.16.23],[sundell.software@gmail.com])
|
||||||
|
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
AC_CONFIG_MACRO_DIRS([scripts])
|
AC_CONFIG_MACRO_DIRS([scripts])
|
||||||
@@ -14,7 +14,7 @@ AX_CXX_COMPILE_STDCXX(20, noext, mandatory)
|
|||||||
|
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
|
|
||||||
AC_DEFINE([API_VERSION], [26], [api version])
|
AC_DEFINE([API_VERSION], [27], [api version])
|
||||||
|
|
||||||
RAK_CHECK_CFLAGS
|
RAK_CHECK_CFLAGS
|
||||||
RAK_CHECK_CXXFLAGS
|
RAK_CHECK_CXXFLAGS
|
||||||
@@ -49,7 +49,7 @@ fi
|
|||||||
|
|
||||||
PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"])
|
PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"])
|
||||||
PKG_CHECK_MODULES([ZLIB], [zlib])
|
PKG_CHECK_MODULES([ZLIB], [zlib])
|
||||||
PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.16.22])
|
PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.16.23])
|
||||||
|
|
||||||
AC_LANG_PUSH(C++)
|
AC_LANG_PUSH(C++)
|
||||||
TORRENT_WITH_XMLRPC_C
|
TORRENT_WITH_XMLRPC_C
|
||||||
|
|||||||
+1
-1
@@ -131,7 +131,7 @@ ipv4_range_parse(const char* address, uint32_t* address_start, uint32_t* address
|
|||||||
// copy everything up to '#' to address_copy and work from there
|
// copy everything up to '#' to address_copy and work from there
|
||||||
while(address[address_start_index] != '#' && address[address_start_index] != '\r' &&
|
while(address[address_start_index] != '#' && address[address_start_index] != '\r' &&
|
||||||
address[address_start_index] != '\n' && address[address_start_index] != '\0' &&
|
address[address_start_index] != '\n' && address[address_start_index] != '\0' &&
|
||||||
address_start_index < 4096 ) {
|
address_start_index < 4095 ) {
|
||||||
|
|
||||||
address_copy[address_start_index] = address[address_start_index];
|
address_copy[address_start_index] = address[address_start_index];
|
||||||
address_start_index++;
|
address_start_index++;
|
||||||
|
|||||||
+3
-1
@@ -77,16 +77,18 @@ xmlrpc_list_entry_to_value(xmlrpc_env* env, xmlrpc_value* src, int index) {
|
|||||||
{
|
{
|
||||||
const char* str;
|
const char* str;
|
||||||
xmlrpc_read_string(env, tmp, &str);
|
xmlrpc_read_string(env, tmp, &str);
|
||||||
|
xmlrpc_DECREF(tmp);
|
||||||
|
|
||||||
if (env->fault_occurred)
|
if (env->fault_occurred)
|
||||||
throw xmlrpc_error_c(env);
|
throw xmlrpc_error_c(env);
|
||||||
|
|
||||||
const char* end = str;
|
const char* end = str;
|
||||||
int64_t v3 = ::strtoll(str, (char**)&end, 0);
|
int64_t v3 = ::strtoll(str, (char**)&end, 0);
|
||||||
|
bool invalid = *str == '\0' || *end != '\0';
|
||||||
|
|
||||||
::free((void*)str);
|
::free((void*)str);
|
||||||
|
|
||||||
if (*str == '\0' || *end != '\0')
|
if (invalid)
|
||||||
throw xmlrpc_error_c(XMLRPC_TYPE_ERROR, "Invalid index.");
|
throw xmlrpc_error_c(XMLRPC_TYPE_ERROR, "Invalid index.");
|
||||||
|
|
||||||
return v3;
|
return v3;
|
||||||
|
|||||||
@@ -127,8 +127,12 @@ save_stream(const std::string& path, bool use_fsyncdisk, const std::stringstream
|
|||||||
if (!output.good())
|
if (!output.good())
|
||||||
throw torrent::storage_error("failed to write stream to file : " + path);
|
throw torrent::storage_error("failed to write stream to file : " + path);
|
||||||
|
|
||||||
|
// The data only reaches the kernel here, so this is where a full disk is seen.
|
||||||
output.close();
|
output.close();
|
||||||
|
|
||||||
|
if (!output.good())
|
||||||
|
throw torrent::storage_error("failed to flush stream to file : " + path);
|
||||||
|
|
||||||
// Ensure that the new file is actually written to the disk
|
// Ensure that the new file is actually written to the disk
|
||||||
int fd = ::open(path.c_str(), O_WRONLY);
|
int fd = ::open(path.c_str(), O_WRONLY);
|
||||||
|
|
||||||
@@ -137,13 +141,19 @@ save_stream(const std::string& path, bool use_fsyncdisk, const std::stringstream
|
|||||||
|
|
||||||
if (use_fsyncdisk) {
|
if (use_fsyncdisk) {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
::fsync(fd);
|
int sync_result = ::fsync(fd);
|
||||||
#else
|
#else
|
||||||
::fdatasync(fd);
|
int sync_result = ::fdatasync(fd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (sync_result == -1) {
|
||||||
|
::close(fd);
|
||||||
|
throw torrent::storage_error("failed to sync file to disk : " + path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
::close(fd);
|
if (::close(fd) == -1)
|
||||||
|
throw torrent::storage_error("failed to close file descriptor : " + path);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace anonymous
|
} // namespace anonymous
|
||||||
|
|||||||
Reference in New Issue
Block a user