tags 683680 +patch thanks Hi,
On Thu, 02 Aug 2012 20:48:51 +0200 florian <fgr...@hotmail.com> wrote: > amule launch if delete statistics.dat. file was 0 byte Thanks for the report. This is tracked upstream at http://www.amule.org/abugs/view.php?id=1704 and fixed in revision 10754. I have backported that fix to 2.3.1 (see the attached file). Sandro: Can you please upload a new version with that patch applied? If you don’t have time, are you OK with me NMUing? Best regards, Michael
Description: Cope with empty statistics.dat file If, for some reason (corruption), the ~/.aMule/statistics.dat is empty, aMule will refuse to start until the file is deleted. This patch catches the occuring exception, logs the problem, and then continues as if the file did not exist in the first place. Bug-Debian: http://bugs.debian.org/683680 Last-Update: 2012-02-11 Origin: upstream Forwarded: not-needed --- a/src/Statistics.cpp +++ b/src/Statistics.cpp @@ -50,6 +50,7 @@ #endif #include "amule.h" // Needed for theApp +#include "Logger.h" #include <wx/intl.h> #ifdef __BSD__ @@ -311,12 +311,16 @@ s_totalSent = 0; s_totalReceived = 0; - if (f.Open(JoinPaths(theApp->ConfigDir, wxT("statistics.dat")))) { - uint8_t version = f.ReadUInt8(); - if (version == 0) { - s_totalSent = f.ReadUInt64(); - s_totalReceived = f.ReadUInt64(); + try { + if (f.Open(JoinPaths(theApp->ConfigDir, wxT("statistics.dat")))) { + uint8_t version = f.ReadUInt8(); + if (version == 0) { + s_totalSent = f.ReadUInt64(); + s_totalReceived = f.ReadUInt64(); + } } + } catch (CSafeIOException e) { + AddLogLineN(e.what()); } // Load old values from config