Compare commits

..

1 Commits
v10.2 ... v10.1

Author SHA1 Message Date
Andrey Prygunkov
aa78a360fe version 10.1 2013-03-31 20:12:14 +00:00
8 changed files with 23 additions and 50 deletions

View File

@@ -673,21 +673,13 @@ bool ArticleDownloader::PrepareFile(char* szLine)
/* creates output file and subdirectores */
bool ArticleDownloader::CreateOutputFile(int iSize)
{
if (g_pOptions->GetDirectWrite() && Util::FileExists(m_szOutputFilename) &&
Util::FileSize(m_szOutputFilename) == iSize)
{
// keep existing old file from previous program session
return true;
}
// delete eventually existing old file from previous program session
remove(m_szOutputFilename);
// ensure the directory exist
char szDestDir[1024];
int iMaxlen = Util::BaseFileName(m_szOutputFilename) - m_szOutputFilename;
if (iMaxlen > 1024-1) iMaxlen = 1024-1;
strncpy(szDestDir, m_szOutputFilename, iMaxlen);
strncpy(szDestDir, m_szOutputFilename, iMaxlen < 1024 ? iMaxlen : 1024-1);
szDestDir[iMaxlen] = '\0';
if (!Util::ForceDirectories(szDestDir))
@@ -1045,8 +1037,7 @@ void ArticleDownloader::CompleteFileParts()
debug("Checking old dir for: %s", m_szOutputFilename);
char szOldDestDir[1024];
int iMaxlen = Util::BaseFileName(m_szOutputFilename) - m_szOutputFilename;
if (iMaxlen > 1024-1) iMaxlen = 1024-1;
strncpy(szOldDestDir, m_szOutputFilename, iMaxlen);
strncpy(szOldDestDir, m_szOutputFilename, iMaxlen < 1024 ? iMaxlen : 1024-1);
szOldDestDir[iMaxlen] = '\0';
if (Util::DirEmpty(szOldDestDir))
{

View File

@@ -1,14 +1,3 @@
nzbget-10.2:
- fixed potential segfault which could happen with file paths longer
than 1024 characters;
- fixed: when options <DirectWrite> and <ContinuePartial> were both
active, a restart or reload of the program during download may cause
damaged files in the active download;
- increased width of speed indication ui-element to avoid layout
breaking on some linux-browsers;
- fixed a race condition in unpacker which could lead to a segfault
(although the chances were low because the code wasn't executed often).
nzbget-10.1:
- fixed: articles with decoding errors (incomplete or damaged posts)
caused infinite retry-loop in downloader.

View File

@@ -156,16 +156,19 @@ void UnpackController::Run()
if (m_bHasRarFiles)
{
m_pPostInfo->SetProgressLabel("");
ExecuteUnrar();
}
if (m_bHasSevenZipFiles && m_bUnpackOK)
{
m_pPostInfo->SetProgressLabel("");
ExecuteSevenZip(false);
}
if (m_bHasSevenZipMultiFiles && m_bUnpackOK)
{
m_pPostInfo->SetProgressLabel("");
ExecuteSevenZip(true);
}
@@ -220,9 +223,8 @@ void UnpackController::ExecuteUnrar()
m_bAllOKMessageReceived = false;
m_eUnpacker = upUnrar;
SetProgressLabel("");
int iExitCode = Execute();
SetProgressLabel("");
m_pPostInfo->SetProgressLabel("");
m_bUnpackOK = iExitCode == 0 && m_bAllOKMessageReceived && !GetTerminated();
m_bUnpackStartError = iExitCode == -1;
@@ -268,9 +270,8 @@ void UnpackController::ExecuteSevenZip(bool bMultiVolumes)
m_eUnpacker = upSevenZip;
PrintMessage(Message::mkInfo, "Executing 7-Zip");
SetProgressLabel("");
int iExitCode = Execute();
SetProgressLabel("");
m_pPostInfo->SetProgressLabel("");
m_bUnpackOK = iExitCode == 0 && m_bAllOKMessageReceived && !GetTerminated();
m_bUnpackStartError = iExitCode == -1;
@@ -582,7 +583,7 @@ void UnpackController::AddMessage(Message::EKind eKind, bool bDefaultKind, const
if (m_eUnpacker == upUnrar && !strncmp(szMsgText, "Extracting ", 11))
{
SetProgressLabel(szMsgText);
m_pPostInfo->SetProgressLabel(szMsgText);
}
if (m_eUnpacker == upUnrar && !strncmp(szText, "Extracting from ", 16))
@@ -590,7 +591,7 @@ void UnpackController::AddMessage(Message::EKind eKind, bool bDefaultKind, const
const char *szFilename = szText + 16;
debug("Filename: %s", szFilename);
m_archiveFiles.push_back(strdup(szFilename));
SetProgressLabel(szText);
m_pPostInfo->SetProgressLabel(szText);
}
if ((m_eUnpacker == upUnrar && !strncmp(szText, "All OK", 6)) ||
@@ -607,13 +608,6 @@ void UnpackController::Stop()
Terminate();
}
void UnpackController::SetProgressLabel(const char* szProgressLabel)
{
g_pDownloadQueueHolder->LockQueue();
m_pPostInfo->SetProgressLabel(szProgressLabel);
g_pDownloadQueueHolder->UnlockQueue();
}
void MoveController::StartMoveJob(PostInfo* pPostInfo)
{

View File

@@ -81,7 +81,6 @@ protected:
bool HasParFiles();
bool HasBrokenFiles();
void CheckArchiveFiles();
void SetProgressLabel(const char* szProgressLabel);
#ifndef DISABLE_PARCHECK
void RequestParCheck(bool bRename);
#endif

20
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for nzbget 10.2.
# Generated by GNU Autoconf 2.61 for nzbget 10.1.
#
# Report bugs to <hugbug@users.sourceforge.net>.
#
@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='nzbget'
PACKAGE_TARNAME='nzbget'
PACKAGE_VERSION='10.2'
PACKAGE_STRING='nzbget 10.2'
PACKAGE_VERSION='10.1'
PACKAGE_STRING='nzbget 10.1'
PACKAGE_BUGREPORT='hugbug@users.sourceforge.net'
ac_unique_file="nzbget.cpp"
@@ -1235,7 +1235,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures nzbget 10.2 to adapt to many kinds of systems.
\`configure' configures nzbget 10.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1306,7 +1306,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of nzbget 10.2:";;
short | recursive ) echo "Configuration of nzbget 10.1:";;
esac
cat <<\_ACEOF
@@ -1452,7 +1452,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
nzbget configure 10.2
nzbget configure 10.1
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1466,7 +1466,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by nzbget $as_me 10.2, which was
It was created by nzbget $as_me 10.1, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2262,7 +2262,7 @@ fi
# Define the identity of the package.
PACKAGE=nzbget
VERSION=10.2
VERSION=10.1
cat >>confdefs.h <<_ACEOF
@@ -9283,7 +9283,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by nzbget $as_me 10.2, which was
This file was extended by nzbget $as_me 10.1, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -9336,7 +9336,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
nzbget config.status 10.2
nzbget config.status 10.1
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

View File

@@ -2,9 +2,9 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(nzbget, 10.2, hugbug@users.sourceforge.net)
AC_INIT(nzbget, 10.1, hugbug@users.sourceforge.net)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(nzbget, 10.2)
AM_INIT_AUTOMAKE(nzbget, 10.1)
AC_CONFIG_SRCDIR([nzbget.cpp])
AC_CONFIG_HEADERS([config.h])

View File

@@ -225,7 +225,7 @@ body.navfixed.scrolled .navbar-fixed-top .navbar-inner {
margin-right: 10px;
padding-top: 2px;
cursor: pointer;
width: 86px;
width: 85px;
}
#InfoBlock div {

View File

@@ -74,7 +74,7 @@
/* Define to 1 if spinlocks are supported */
#define HAVE_SPINLOCK
#define VERSION "10.2"
#define VERSION "10.1"
/* Suppress warnings */
#define _CRT_SECURE_NO_DEPRECATE