Procházet zdrojové kódy

HPCC-12513 Changes following code review

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday před 10 roky
rodič
revize
f1af669167

+ 1 - 1
common/thorhelper/thorsoapcall.cpp

@@ -741,7 +741,7 @@ public:
         logUserMsg = (flags & SOAPFlogusermsg) != 0;
 
         double dval = helper->getTimeout(); // In seconds, but may include fractions of a second...
-        if (dval == -1.0) //not provided
+        if (dval < 0.0) //not provided, or out of range
             timeoutMS = 300*1000; // 300 second default
         else if (dval == 0)
             timeoutMS = WAIT_FOREVER;

+ 8 - 1
dali/daliadmin/daliadmin.cpp

@@ -2104,7 +2104,14 @@ class CXMLSizesParser : public CInterface
         {
             CTreeItem **left = (CTreeItem **)_left;
             CTreeItem **right = (CTreeItem **)_right;
-            return (int)((*right)->size() - (*left)->size());
+            offset_t leftSize = (*left)->size();
+            offset_t rightSize = (*right)->size();
+            if (rightSize > leftSize)
+                return +1;
+            else if (rightSize < leftSize)
+                return -1;
+            else
+                return 0;
         }
     public:
 

+ 1 - 1
dali/ft/ftbase.cpp

@@ -599,7 +599,7 @@ void OutputProgress::restore(IPropertyTree * tree)
     outputCRC = tree->getPropInt("@outputCRC");
     outputLength = tree->getPropInt64("@outputLength");
     resultTime.setString(tree->queryProp("@modified"));
-    hasCompressed = tree->getPropInt("@compressed") != 0;
+    hasCompressed = tree->getPropBool("@compressed");
     compressedPartSize = tree->getPropInt64("@compressedPartSize");
 }
 

+ 5 - 3
esp/clients/LoggingClient/LocalDataLogger.cpp

@@ -167,9 +167,11 @@ MemoryBuffer& CLocalDataLogger::readData(MemoryBuffer& dataCached,const char* ca
                     if (io)
                     {
                         DBGLOG("Managed to open");
-                        //MORE: Should check size isn't > 2^32
-                        size32_t filesize = io->size();
-                        io->read(0, filesize, dataCached.reserveTruncate(filesize));
+                        offset_t filesize = io->size();
+                        size32_t memfilesize = (size32_t)filesize;
+                        //Check size isn't >= 2^32
+                        assertex(filesize == memfilesize);
+                        io->read(0, filesize, dataCached.reserveTruncate(memfilesize));
                         DBGLOG("Managed to read");
                         return dataCached;
                     }

+ 1 - 1
esp/services/ws_workunits/ws_workunitsHelpers.cpp

@@ -346,7 +346,7 @@ void WsWuInfo::addTimerToList(SCMStringBuffer& name, const char * scope, IConstW
     name.s.replace('_', ' '); // yuk!
     t->setName(name.str());
     t->setValue(fd.str());
-    //MORE: This could overflow.
+    //Theoretically this could overflow, in practice it is unlikely - fix in the new stats interface when implemented
     t->setCount((unsigned)stat.getCount());
 
     if (version > 1.19)