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

List:       helix-filesystem-cvs
Subject:    [Filesystem-cvs] http wince-420.pcf, NONE, 1.1 cache.cpp, 1.6,
From:       rishimathew () helixcommunity ! org
Date:       2004-04-23 23:12:25
[Download RAW message or body]

Update of /cvsroot/filesystem/http
In directory cvs-new:/tmp/cvs-serv8965

Modified Files:
	cache.cpp httpfsys.cpp 
Added Files:
	wince-420.pcf 
Log Message:
Adding support for Wince 4.2 on X86


--- NEW FILE: wince-420.pcf ---
# 
# ***** BEGIN LICENSE BLOCK ***** 
# Version: RCSL 1.0/RPSL 1.0 
#  
# Portions Copyright (c) 1995-2002 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 
# Version 1.0 (the "RPSL") available at 
# http://www.helixcommunity.org/content/rpsl unless you have licensed 
# the file under the RealNetworks Community Source License Version 1.0 
# (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 ***** 
# 

# CE specific fixes
if "HELIX_FEATURE_MIN_HEAP" in project.defines:
	project.AddDefines('HELIX_FEATURE_FEEL_ANY_ERROR_ON_STREAM')

Index: httpfsys.cpp
===================================================================
RCS file: /cvsroot/filesystem/http/httpfsys.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- httpfsys.cpp	1 Mar 2004 23:02:45 -0000	1.29
+++ httpfsys.cpp	23 Apr 2004 23:12:23 -0000	1.30
@@ -954,8 +954,13 @@
     , m_bPartialData(FALSE)
     , m_bUseHTTPS(FALSE)
     
+#ifdef _IIS_HTTP_SERVER_NO_SEEK_SUPPORT_BUG
+    , m_bSupportsByteRanges(FALSE)
+    , m_bDisableByteRanges(TRUE)
+#else  //_IIS_HTTP_SERVER_NO_SEEK_SUPPORT_BUG
     , m_bSupportsByteRanges(TRUE)
     , m_bDisableByteRanges(FALSE)
+#endif //_IIS_HTTP_SERVER_NO_SEEK_SUPPORT_BUG
     , m_bExternalByteRangeRequests(FALSE)
     , m_uByteRangeSeekOffset(0)
     , m_bByteRangeSeekPending(FALSE)
@@ -1128,7 +1133,7 @@
 
 CHTTPFileObject::~CHTTPFileObject()
 {
-    LOGX ((szDbgTemp, "FileObject destructor"));
+    LOGX ((szDbgTemp, "FileObject destructor (%s)", m_bClosed?"Closed":"Not closed") );
     if(m_bInDestructor)
     {
         return;
@@ -1837,18 +1842,17 @@
 		m_pOptions
             );
 
-            if (!pFileObject)
-            {
-                response->FileObjectReady(HXR_OUTOFMEMORY, NULL);
-                return HXR_OUTOFMEMORY;
-            }
-
             lReturnVal = pFileObject->QueryInterface
             (
                 IID_IUnknown, 
                 (void**)&pUnknown
             );
         }
+	else
+	{
+            response->FileObjectReady(HXR_OUTOFMEMORY, NULL);
+            return HXR_OUTOFMEMORY;
+	}
     }
 
     response->FileObjectReady
@@ -2762,7 +2766,7 @@
                 // Read directly into the buffer
                 ULONG32 ulActual = 0;
 
-                m_pChunkyRes->GetData(m_ulCurrentReadPosition,
+                HX_RESULT hxr = m_pChunkyRes->GetData(m_ulCurrentReadPosition,
                                     (char*) pBuffer->GetBuffer(),
                                     ulReadCount,
                                     &ulActual);
@@ -3893,7 +3897,11 @@
 			    // "accept-ranges: bytes" but DON'T! That's why
 			    // we must verify that byte ranges work!
 
+#ifdef _IIS_HTTP_SERVER_NO_SEEK_SUPPORT_BUG
+                m_bSupportsByteRanges = FALSE;
+#else  //_IIS_HTTP_SERVER_NO_SEEK_SUPPORT_BUG
                 m_bSupportsByteRanges = TRUE;
+#endif //_IIS_HTTP_SERVER_NO_SEEK_SUPPORT_BUG
 
                 // Confirm the byte offset seek worked
                 if (m_bByteRangeSeekPending)

Index: cache.cpp
===================================================================
RCS file: /cvsroot/filesystem/http/cache.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cache.cpp	3 Oct 2003 22:56:17 -0000	1.6
+++ cache.cpp	23 Apr 2004 23:12:23 -0000	1.7
@@ -57,6 +57,16 @@
 #define  LOG_FILE       "C:/Temp/cache.log"
 #include "http_debug.h"
 
+#if defined(_WIN32) && !defined(_WINCE)
+#define WANT_GETDISKFREESPACEEX_WRAPPER
+#define COMPILE_NEWAPIS_STUBS
+#include <newapis.h>
+#endif
+
+#ifdef _WIN32
+#include <tchar.h>
+#endif
+ 
 DB*  g_pCacheDbHeader  = NULL;
 DB*  g_pCacheDbData    = NULL;
 DB*  g_pCacheDbUsage   = NULL;
@@ -898,22 +908,15 @@
 GetFreeMbyteCount (const char *pDirectoryName)
 {
     BOOL	bOK                           = FALSE;
-    BOOL	bUseExtFunc		      = FALSE;
+    BOOL	bUseExtFunc					  = FALSE;
     ULONG32	ulFreeMbytes                  = 0;
     ULONGLONG	ullFreeBytesAvailableToCaller = 0;
     ULONGLONG	ullTotalNumberOfBytes         = 0;
     ULONGLONG	ullTotalNumberOfFreeBytes     = 0;
-    DWORD	dwSectorsPerCluster = 0;	    // pointer to sectors per cluster
-    DWORD	dwBytesPerSector = 0;		    // pointer to bytes per sector
-    DWORD	dwNumberOfFreeClusters = 0;	    // pointer to number of free clusters
-    DWORD	dwTotalNumberOfClusters = 0;	    // pointer to total number of clusters	
     LPVOID	lpMsgBuf = NULL;
 
     CHAR	pucDisk[4]                    = { 0 };
-    
-    GETDISKFREESPACEEX	_getDiskFreeSpaceEx = NULL;
-    HINSTANCE		hLib		    = NULL;
-    
+
     /* 
      * If there is an error creating the database, we do not store the 
      * directory name in m_pszDbDir in CCacheEntry constructor
@@ -927,25 +930,12 @@
     strncpy (pucDisk, pDirectoryName, 3); /* Flawfinder: ignore */
     pucDisk[3] = '\0';
 
-    // Windows 95 OSR2: The GetDiskFreeSpaceEx function is available on Windows 95 
-    // systems beginning with OEM Service Release 2 (OSR2). 
-    //
-    // To determine whether GetDiskFreeSpaceEx is available, call the LoadLibrary 
-    // load the KERNEL32.DLL file, then call the GetProcAddress function to obtain 
-    // an address for GetDiskFreeSpaceEx. If GetProcAddress fails, use the 
-    // GetDiskFreeSpace function instead of GetDiskFreeSpaceEx.
-    //
-    // NOTE: if we don't do so, the httpfsys will not be loaded by the plugin handler!!
-    if (!(hLib = LoadLibrary(OS_STRING("kernel32.dll"))))
-    {
-	goto cleanup;
-    }    
-
-    _getDiskFreeSpaceEx = (GETDISKFREESPACEEX)GetProcAddress(hLib, OS_STRING("GetDiskFreeSpaceExA"));
-
-    if (_getDiskFreeSpaceEx)
-    {
-	bOK = _getDiskFreeSpaceEx(OS_STRING(pucDisk),
+	bOK = GetDiskFreeSpaceEx(
+#ifdef UNICODE
+			OS_STRING(pucDisk),
+#else
+			pucDisk,
+#endif
 				  (PULARGE_INTEGER) &ullFreeBytesAvailableToCaller,
 				  (PULARGE_INTEGER) &ullTotalNumberOfBytes,
 				  (PULARGE_INTEGER) &ullTotalNumberOfFreeBytes);
@@ -953,31 +943,8 @@
 	if (bOK)
 	{
 	    ulFreeMbytes = (ULONG32)(ullTotalNumberOfFreeBytes >> 20);
-	    goto cleanup;
 	}
-    }
-
-#ifndef _WINCE
-    bOK = GetDiskFreeSpace(OS_STRING(pucDisk),
-                          (LPDWORD) &dwSectorsPerCluster,
-                          (LPDWORD) &dwBytesPerSector,
-                          (LPDWORD) &dwNumberOfFreeClusters,
-			  (LPDWORD) &dwTotalNumberOfClusters);
-
-    if (bOK)
-    {
-        ulFreeMbytes = (ULONG32)(dwBytesPerSector * dwSectorsPerCluster * dwNumberOfFreeClusters);
-    }
-#endif /* _WINCE */
-
-cleanup:
-
-    if (hLib)
-    {
-	FreeLibrary(hLib);
-    }
-
-    return(ulFreeMbytes);
+	return(ulFreeMbytes);
 }            
 #elif defined(_MACINTOSH)
 UINT32



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

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