News:

Latest versions:
Server plugin: 0.5.1
MVP dongle: 0.5.2
Raspberry Pi client: 0.5.2
Windows client: 0.5.2-1

Main Menu

Crash on full disk

Started by winni, December 07, 2009, 17:48:29

Previous topic - Next topic

winni

Hi,

just to mention: when calling the recordings menu in the client the server crashes if the disk is full, i.e. 100% used.
Tested with 0.3.0-9.

BR,

winni

davep

This should fix it (untested):


--- vompclientrrproc.c  2009-05-30 15:22:59.000000000 +0100
+++ vompclientrrproc.new.c      2009-12-13 15:37:54.000000000 +0000
@@ -586,10 +586,16 @@

int VompClientRRProc::processGetRecordingsList()
{
-  int FreeMB;
+  int FreeMB, Total;
   int Percent = VideoDiskSpace(&FreeMB);
-  int Total = (FreeMB / (100 - Percent)) * 100;
-
+  if (Percent == 100)
+  {
+    Total = 0;
+  }
+  else
+  {
+    Total = (FreeMB / (100 - Percent)) * 100;
+  }
   resp->addULONG(Total);
   resp->addULONG(FreeMB);
   resp->addULONG(Percent);