]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10365 [mod_http_cache] Add mod_http_cache to the windows build.
authorAndrey Volk <andywolk@gmail.com>
Fri, 2 Jun 2017 22:01:08 +0000 (01:01 +0300)
committerAndrey Volk <andywolk@gmail.com>
Fri, 2 Jun 2017 22:01:08 +0000 (01:01 +0300)
Freeswitch.2015.sln
src/mod/applications/mod_http_cache/azure.c
src/mod/applications/mod_http_cache/mod_http_cache.c
src/mod/applications/mod_http_cache/mod_http_cache.vcxproj [new file with mode: 0644]

index 0c8d3a1946f39c307b7283a1ccc370eb469f3102..40fbd26688d5bad7c975ebd170021b36674e3d4a 100644 (file)
@@ -1,6 +1,6 @@
 Microsoft Visual Studio Solution File, Format Version 12.00\r
 # Visual Studio 14\r
-VisualStudioVersion = 14.0.23107.0\r
+VisualStudioVersion = 14.0.25420.1\r
 MinimumVisualStudioVersion = 10.0.40219.1\r
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}"\r
 EndProject\r
@@ -649,6 +649,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libx264", "libs\wi
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download tiff", "libs\win32\Download tiff.2015.vcxproj", "{583D8CEA-4171-4493-9025-B63265F408D8}"\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_http_cache", "src\mod\applications\mod_http_cache\mod_http_cache.vcxproj", "{87933C2D-0159-46F7-B326-E1B6E982C21E}"\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                All|Win32 = All|Win32\r
@@ -2903,6 +2905,18 @@ Global
                {583D8CEA-4171-4493-9025-B63265F408D8}.Release|Win32.ActiveCfg = Release|Win32\r
                {583D8CEA-4171-4493-9025-B63265F408D8}.Release|Win32.Build.0 = Release|Win32\r
                {583D8CEA-4171-4493-9025-B63265F408D8}.Release|x64.ActiveCfg = Release|Win32\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.All|Win32.ActiveCfg = Release|Win32\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.All|Win32.Build.0 = Release|Win32\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.All|x64.ActiveCfg = Release|x64\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.All|x64.Build.0 = Release|x64\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|Win32.Build.0 = Debug|Win32\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|x64.ActiveCfg = Debug|x64\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|x64.Build.0 = Debug|x64\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|Win32.ActiveCfg = Release|Win32\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|Win32.Build.0 = Release|Win32\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|x64.ActiveCfg = Release|x64\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|x64.Build.0 = Release|x64\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
@@ -3134,5 +3148,6 @@ Global
                {20179127-853B-4FE9-B7C0-9E817E6A3A72} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}\r
                {6D1BC01C-3F97-4C08-8A45-69C9B94281AA} = {C120A020-773F-4EA3-923F-B67AF28B750D}\r
                {583D8CEA-4171-4493-9025-B63265F408D8} = {C120A020-773F-4EA3-923F-B67AF28B750D}\r
+               {87933C2D-0159-46F7-B326-E1B6E982C21E} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
        EndGlobalSection\r
 EndGlobal\r
index 61a2b2fd9570e4ec40485734cb58e0ba1a580df9..f1e4cf8925401b68cd6b56a793dc96c8a99268c0 100644 (file)
@@ -49,6 +49,10 @@ struct curl_memory_read {
 };
 typedef struct curl_memory_read curl_memory_read_t;
 
+#if defined(_WIN32) || defined(_WIN64)
+# define strtok_r strtok_s
+#endif
+
 /**
  * Convert query string parameters into string to be appended to
  * Azure authentication header
index e84074dd9391e8f3202935554949d0aa18a4dea9..2af2cd17707c9089ff875c08e0505d286b52ee16 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef WIN32
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+
+#include <stdlib.h>
+#include <ctype.h>
+
+char *strcasestr(const char *str, const char *pattern) {
+       size_t i;
+
+       if (!*pattern)
+               return (char*)str;
+
+       for (; *str; str++) {
+               if (toupper(*str) == toupper(*pattern)) {
+                       for (i = 1;; i++) {
+                               if (!pattern[i])
+                                       return (char*)str;
+                               if (toupper(str[i]) != toupper(pattern[i]))
+                                       break;
+                       }
+               }
+       }
+       return NULL;
+}
+
+char *strndup(const char *s, size_t n)
+{
+       char *p;
+
+       p = (char *)malloc(n + 1);
+       if (p == NULL)
+               return NULL;
+       memcpy(p, s, n);
+       p[n] = '\0';
+       return p;
+}
+#endif
+
 /* 253 max domain size + '/' + NUL byte */
 #define DOMAIN_BUF_SIZE 255
 
@@ -1496,10 +1535,10 @@ static switch_status_t do_config(url_cache_t *cache)
        /* set default config */
        max_urls = 4000;
        default_max_age_sec = 86400;
-       cache->location = SWITCH_PREFIX_DIR "/http_cache";
+       cache->location = switch_core_sprintf(cache->pool, "%s%s", SWITCH_GLOBAL_dirs.base_dir, "/http_cache");
        cache->prefetch_queue_size = 100;
        cache->prefetch_thread_count = 8;
-       cache->ssl_cacert = SWITCH_PREFIX_DIR "/conf/cacert.pem";
+       cache->ssl_cacert = switch_core_sprintf(cache->pool, "%s%s", SWITCH_GLOBAL_dirs.certs_dir, "/cacert.pem");
        cache->ssl_verifyhost = 1;
        cache->ssl_verifypeer = 1;
        cache->enable_file_formats = 0;
diff --git a/src/mod/applications/mod_http_cache/mod_http_cache.vcxproj b/src/mod/applications/mod_http_cache/mod_http_cache.vcxproj
new file mode 100644 (file)
index 0000000..1e00d0e
--- /dev/null
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectName>mod_http_cache</ProjectName>
+    <RootNamespace>mod_http_cache</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+    <ProjectGuid>{87933C2D-0159-46F7-B326-E1B6E982C21E}</ProjectGuid>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />  
+  <Import Project="$(SolutionDir)\w32\openssl.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\..\..\w32\module_release.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\..\..\w32\module_debug.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\..\..\w32\module_release.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\..\..\w32\module_debug.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)\src\include;$(SolutionDir)libs\curl-7.35.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+    </ClCompile>
+    <Link>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)\src\include;$(SolutionDir)\libs\curl-7.35.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+    </ClCompile>
+    <Link>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX64</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)\src\include;$(SolutionDir)\libs\curl-7.35.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+    </ClCompile>
+    <Link>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(SolutionDir)\src\include;$(SolutionDir)\libs\curl-7.35.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+    </ClCompile>
+    <Link>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX64</TargetMachine>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="mod_http_cache.c" />
+    <ClCompile Include="aws.c" />
+    <ClCompile Include="azure.c" />
+    <ClCompile Include="common.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="$(SolutionDir)\libs\win32\curl\curllib.2015.vcxproj">
+      <Project>{87ee9da4-de1e-4448-8324-183c98dca588}</Project>
+    </ProjectReference>
+    <ProjectReference Include="$(SolutionDir)\libs\win32\openssl\libeay32.2015.vcxproj">
+      <Project>{d331904d-a00a-4694-a5a3-fcff64ab5dbe}</Project>
+    </ProjectReference>
+    <ProjectReference Include="$(SolutionDir)\libs\win32\openssl\ssleay32.2015.vcxproj">
+      <Project>{b4b62169-5ad4-4559-8707-3d933ac5db39}</Project>
+    </ProjectReference>
+    <ProjectReference Include="$(SolutionDir)\w32\Library\FreeSwitchCore.2015.vcxproj">
+      <Project>{202d7a4e-760d-4d0e-afa1-d7459ced30ff}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file