[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] fs/adminfs browse_format.cpp,1.2,1.2.30.1
From:       svaidhya () helixcommunity ! org
Date:       2011-01-30 23:58:25
Message-ID: 201101302358.p0UNwAss008155 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/fs/adminfs
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv4223

Modified Files:
      Tag: SERVER_14_2
	browse_format.cpp 
Log Message:
Synopsis
=======
CR: Fix for Bug 269289: file size reported incorrectly with Admin's Content Browser 

Branches:  HEAD, 14.2
Suggested Reviewer: Dean, Chytanya

Description
=========

The filesize returned by the filesystem is of type HX_OFF_T (INT64 ) and we truncate \
it to UINT32. Modified the function to handle UINT64 filesize. 
Also the filesize was written into a char buffer using sprintf. Since we changed to \
UINT64, changed the format specifier to unsigned long long.

Files Affected
===========
./server/fs/adminfs/browse.h
./server/fs/adminfs/browse_format.cpp

Testing Performed
==============
Unit Tests:
- None

Integration Tests:
- Verified that the filesize is displayed as expected in the browse_content section \
and viewsource of the admin system
** With windows it still was not showing correctly despite the fix. Then realized \
JJ's fix for using _stat64 would fix this too. Checking out latestcode and compiling.
Will checkin after testing on  Windows.

Leak Tests:
- None

Performance Tests:
- None

Build verified:linux-rhel5-x86_64, win-x86_64--vc10
Platform tested :linux-rhel5-x86_64, win-x86_64--vc10







Index: browse_format.cpp
===================================================================
RCS file: /cvsroot/server/fs/adminfs/browse_format.cpp,v
retrieving revision 1.2
retrieving revision 1.2.30.1
diff -u -d -r1.2 -r1.2.30.1
--- browse_format.cpp	27 Dec 2007 06:06:18 -0000	1.2
+++ browse_format.cpp	30 Jan 2011 23:58:22 -0000	1.2.30.1
@@ -1,3 +1,40 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Source last modified: $Id$
+ *
+ * Portions Copyright (c) 1995-2003 RealNetworks, Inc. All Rights Reserved.
+ *
+ * The contents of this file, and the files included with this file,
+ * are subject to the current version of the RealNetworks Public
+ * Source License (the "RPSL") available at
+ * http://www.helixcommunity.org/content/rpsl unless you have licensed
+ * the file under the current version of the RealNetworks Community
+ * Source License (the "RCSL") available at
+ * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
+ * will apply. You may also obtain the license terms directly from
+ * RealNetworks.  You may not use this file except in compliance with
+ * the RPSL or, if you have a valid RCSL with RealNetworks applicable
+ * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
+ * the rights, obligations and limitations governing use of the
+ * contents of the file.
+ *
+ * This file is part of the Helix DNA Technology. RealNetworks is the
+ * developer of the Original Code and owns the copyrights in the
+ * portions it created.
+ *
+ * This file, and the files included with this file, is distributed
+ * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
+ * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
+ * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
+ * ENJOYMENT OR NON-INFRINGEMENT.
+ *
+ * Technology Compatibility Kit Test Suite(s) Location:
+ *    http://www.helixcommunity.org/content/tck
+ *
+ * Contributor(s):
+ *
+ * ***** END LICENSE BLOCK ***** */
+
 #include "hxcom.h"	/* IUnknown */
 #include "hxtypes.h" 
 #include "hxcomm.h"	/* IHXCommonClassFactory */
@@ -203,7 +240,7 @@
 }
 
 void 
-CDirFormatterHTML::AddDirEntry(const char* pDirName, UINT32 ulFileModTime)
+CDirFormatterHTML::AddDirEntry(const char* pDirName, UINT64 ulFileModTime)
 {
     HX_ASSERT(m_pQueue);
 
@@ -243,13 +280,13 @@
 }
 
 void
-CDirFormatterHTML::AddFileEntry(const char* pFileName, UINT32 ulFileSize, 
-                                UINT32 ulFileModTime)
+CDirFormatterHTML::AddFileEntry(const char* pFileName, UINT64 ulFileSize, 
+                                UINT64 ulFileModTime)
 {
     HX_ASSERT(m_pQueue);
 
-    char buf[14];
-    sprintf(buf, "%12u ", ulFileSize); //TODO commify
+    char buf[256];
+    sprintf(buf, "%12llu", (unsigned long long)ulFileSize); //TODO commify
     m_pQueue->EnQueue(buf);
     m_pQueue->EnQueue(" ");
 
@@ -428,38 +465,38 @@
 }
 
 void 
-CDirFormatterJS::AddDirEntry(const char* pDirName, UINT32 ulFileModTime)
+CDirFormatterJS::AddDirEntry(const char* pDirName, UINT64 ulFileModTime)
 {
     HX_ASSERT(m_pQueue);
 
-    char buf[20];
+    char buf[256];
 
     m_pQueue->EnQueue("\t\t");
     m_pQueue->EnQueue(m_ulEntryCount++ ? ",'" : " '");
     m_pQueue->EnQueue(pDirName);
     m_pQueue->EnQueue("':{type: 'DIR', size: 0, time: ");
-    sprintf(buf, "%u", ulFileModTime);
+    sprintf(buf, "%llu",(unsigned long long) ulFileModTime);
     m_pQueue->EnQueue(buf);
     m_pQueue->EnQueue("}\n");
 }
 
 void
-CDirFormatterJS::AddFileEntry(const char* pFileName, UINT32 ulFileSize, 
-                              UINT32 ulFileModTime)
+CDirFormatterJS::AddFileEntry(const char* pFileName, UINT64 ulFileSize, 
+                              UINT64 ulFileModTime)
 {
     HX_ASSERT(m_pQueue);
 
-    char buf[20];
+    char buf[256];
 
     m_pQueue->EnQueue("\t\t");
     m_pQueue->EnQueue(m_ulEntryCount++ ? ",'" : " '");
     m_pQueue->EnQueue(pFileName);
     m_pQueue->EnQueue("':{type: 'FILE', size: ");
-    sprintf(buf, "%u", ulFileSize);
+    sprintf(buf, "%llu", (unsigned long long)ulFileSize);
     m_pQueue->EnQueue(buf);
 
     m_pQueue->EnQueue(", time: ");
-    sprintf(buf, "%u", ulFileModTime);
+    sprintf(buf, "%llu", (unsigned long long) ulFileModTime);
     m_pQueue->EnQueue(buf);
     m_pQueue->EnQueue("}\n");
 }


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic