diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml new file mode 100644 index 0000000..279b03f --- /dev/null +++ b/.github/workflows/cppcheck.yml @@ -0,0 +1,35 @@ +name: cpp check workflows + +on: + push: + branches: + - 'develop' + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout main repository code + uses: actions/checkout@v4 + with: + ref: 'develop' + + - name: Create static_analysis directory + run: mkdir -p static_analysis + + - name: Run Cppcheck + run: | + sudo apt-get install -y cppcheck + cppcheck --enable=all --language=c++ --std=c++20 ./XEngine_Source/ --output-file=static_analysis/log.xml --xml + continue-on-error: true + + - name: Upload Cppcheck Results + uses: actions/upload-artifact@v4 + with: + name: cppcheck_results + path: static_analysis/log.xml \ No newline at end of file diff --git a/.github/workflows/linuxbuild.yml b/.github/workflows/linuxbuild.yml deleted file mode 100644 index 1d347e5..0000000 --- a/.github/workflows/linuxbuild.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: ubuntu build workflows - -on: - push: - branches: [ "develop" ] - pull_request: - branches: [ "develop" ] - -permissions: - contents: read - -jobs: - build: - strategy: - # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. - fail-fast: false - matrix: - include: - - os: ubuntu-22.04 - #- os: ubuntu-24.04 - runs-on: ${{ matrix.os }} - - steps: - # 检出您的主仓库代码 - - name: Checkout main repository code - uses: actions/checkout@v4 - with: - ref: 'develop' - - # 检出依赖的xengine仓库到指定的xengine目录 - - name: Checkout dependency repository (xengine) - uses: actions/checkout@v4 - with: - repository: libxengine/libxengine - path: libxengine - - - name: sub module checkout (opensource) - run: | - git submodule init - git submodule update - - # 设置依赖库的环境变量 - - name: Set up Dependency Environment Variables - run: | - cd libxengine - chmod 777 * - sudo ./XEngine_LINEnv.sh -i 3 - cd .. - #编译 - - name: make - run: | - cd XEngine_Source - make - make FLAGS=InstallAll - make FLAGS=CleanAll - - make RELEASE=1 - make FLAGS=InstallAll - make FLAGS=CleanAll - cd .. - - name: test - run: | - cd XEngine_Release - ./XEngine_XStorageApp -t \ No newline at end of file diff --git a/.github/workflows/macbuild.yml b/.github/workflows/macbuild.yml index c2e8fc6..d5c717f 100644 --- a/.github/workflows/macbuild.yml +++ b/.github/workflows/macbuild.yml @@ -2,10 +2,13 @@ name: macos build workflows on: push: - branches: [ "develop" ] - pull_request: - branches: [ "develop" ] - + branches: + - 'develop' + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' + permissions: contents: read @@ -15,6 +18,7 @@ jobs: matrix: include: - os: macos-13 + - os: macos-14 runs-on: ${{ matrix.os }} steps: @@ -38,14 +42,30 @@ jobs: - name: brew install run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - # 设置依赖库的环境变量 - - name: Set up Dependency Environment Variables + - name: Set up Dependency x86_64 Environment + if: matrix.os == 'macos-13' run: | cd libxengine chmod 777 * ./XEngine_LINEnv.sh -i 3 - cd .. - #编译 + - name: Set up Dependency Arm64 Environment + if: matrix.os == 'macos-14' + run: | + cd libxengine + chmod 777 * + ./XEngine_LINEnv.sh -i 0 + + latest_tag=$(git ls-remote --tags --sort="v:refname" https://github.com/libxengine/libxengine.git | awk '{print $2}' | sed 's/refs\/tags\///' | tail -n 1) + + wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Mac_Arm64.zip + unzip ./XEngine_Mac_Arm64.zip -d ./XEngine_Mac_Arm64 + cd XEngine_Mac_Arm64 + + sudo mkdir -p /usr/local/include + sudo mkdir -p /usr/local/lib + sudo cp -rf ./XEngine_Include /usr/local/include + sudo find ./XEngine_Mac -name "*.dylib" -exec cp {} /usr/local/lib \; + - name: make debug run: | cd XEngine_Source @@ -62,3 +82,16 @@ jobs: run: | cd XEngine_Release ./XEngine_XStorageApp -t + + - name: Upload folder as artifact with mac x64 + if: matrix.os == 'macos-13' + uses: actions/upload-artifact@v4 + with: + name: XEngine_XStorageApp-x86_64-Mac + path: XEngine_Release/ + - name: Upload folder as artifact with mac arm + if: matrix.os == 'macos-14' + uses: actions/upload-artifact@v4 + with: + name: XEngine_XStorageApp-Arm64-Mac + path: XEngine_Release/ \ No newline at end of file diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 627328d..822dd69 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -2,37 +2,37 @@ name: windows build workflows on: push: - branches: [ "develop" ] - pull_request: - branches: [ "develop" ] - + branches: + - 'develop' + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' + permissions: contents: read jobs: build: strategy: - # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. fail-fast: false matrix: configuration: [Debug ,Release] platform: [x86 ,x64] - runs-on: windows-latest # 最新的 Windows 环境 + runs-on: windows-latest steps: - # 检出您的主仓库代码 - name: Checkout main repository code uses: actions/checkout@v4 with: ref: 'develop' - # 检出依赖的xengine仓库到指定的xengine目录 - name: Checkout dependency repository (xengine) uses: actions/checkout@v4 with: repository: libxengine/libxengine - path: xengine + path: libxengine - name: sub module checkout (opensource) run: | @@ -40,21 +40,33 @@ jobs: git submodule update shell: pwsh - # 设置依赖库的环境变量 - - name: Set up Dependency Environment Variables + - name: Set up Dependency x86_64 Environment + if: matrix.platform == 'x64' run: | - echo "XENGINE_INCLUDE=${{ github.workspace }}/xengine" | Out-File -FilePath $env:GITHUB_ENV -Append - echo "XENGINE_LIB32=${{ github.workspace }}/xengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append - echo "XENGINE_LIB64=${{ github.workspace }}/xengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append shell: pwsh - - # 配置 MSBuild 的路径,准备构建 VC++ 项目 + - name: Set up Dependency x86_32 Environment + if: matrix.platform == 'x86' + run: | + $response = Invoke-RestMethod -Uri "https://api.github.com/repos/libxengine/libxengine/releases/latest" -Headers @{"Accept"="application/vnd.github.v3+json"} + $latest_tag = $response.tag_name + Write-Host "Latest Tag: $latest_tag" + + $url = "https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Windows_x86-32.zip" + Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_x86-32.zip" + Expand-Archive -Path ./XEngine_Windows_x86-32.zip -DestinationPath ./XEngine_Windows -Force + + echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "XENGINE_LIB32=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append + shell: pwsh + - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1.0.2 - #编译 + uses: microsoft/setup-msbuild@v2 + - name: Build Solution run: msbuild XEngine_Source/XEngine_StorageApp.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} - #测试 + - name: Conditional Step for x86 Release if: matrix.configuration == 'Release' && matrix.platform == 'x86' run: | @@ -75,3 +87,17 @@ jobs: ./VSCopy_x86.bat ./XEngine_StorageApp.exe -t shell: pwsh + + - name: Upload folder as artifact with x86 + if: matrix.configuration == 'Release' && matrix.platform == 'x64' + uses: actions/upload-artifact@v4 + with: + name: XEngine_StorageApp-x86_32-Windows + path: XEngine_Release/ + + - name: Upload folder as artifact with x64 + if: matrix.configuration == 'Release' && matrix.platform == 'x64' + uses: actions/upload-artifact@v4 + with: + name: XEngine_StorageApp-x86_64-Windows + path: XEngine_Release/ \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5a95fca --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,89 @@ +name: release packet + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # 检出代码并包含标签 + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download ubuntubuild + uses: dawidd6/action-download-artifact@v6 + with: + workflow: ubuntubuild.yml + workflow_conclusion: success + check_artifacts: false + skip_unpack: true + if_no_artifact_found: fail + path: ./XRelease/ + - name: Download macbuild + uses: dawidd6/action-download-artifact@v6 + with: + workflow: macbuild.yml + workflow_conclusion: success + check_artifacts: false + skip_unpack: true + if_no_artifact_found: fail + path: ./XRelease/ + - name: Download msbuild + uses: dawidd6/action-download-artifact@v6 + with: + workflow: msbuild.yml + workflow_conclusion: success + check_artifacts: false + skip_unpack: true + if_no_artifact_found: fail + path: ./XRelease/ + + - name: Display structure of downloaded files + run: ls -al ./XRelease/ + + - name: Get current version and increment X + id: versioning + run: | + latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) + echo "Latest tag: $latest_tag" + # 提取 X 的值并递增 + major=$(echo $latest_tag | cut -d '.' -f 1) + minor=$(echo $latest_tag | cut -d '.' -f 2) + patch=$(echo $latest_tag | cut -d '.' -f 3) + build=$(echo $latest_tag | cut -d '.' -f 4) + + new_minor=$((minor + 1)) + new_version="$major.$new_minor.$patch.$build" + echo "New version: $new_version" + echo "new_tag=$new_version" >> $GITHUB_OUTPUT + echo "prev_tag=$latest_tag" >> $GITHUB_OUTPUT + + - name: Create and push new tag + run: | + git tag ${{ steps.versioning.outputs.new_tag }} + git push origin ${{ steps.versioning.outputs.new_tag }} + + - name: Generate release notes + run: | + logs=$(git log ${{ steps.versioning.outputs.prev_tag }}..${{ steps.versioning.outputs.new_tag }} --pretty=format:"* %h - %s - %an" --no-merges) + release_notes=$(echo "$logs" | sed 's/ qyt$/ @xengine-qyt/') + echo "$release_notes" + echo "$release_notes" > release_notes.txt + + - name: Release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + draft: false + prerelease: false + tag_name: ${{ steps.versioning.outputs.new_tag }} + name: XEngine_Storage ${{ steps.versioning.outputs.new_tag }} + body_path: release_notes.txt + files: ./XRelease/*.zip diff --git a/.github/workflows/ubuntubuild.yml b/.github/workflows/ubuntubuild.yml new file mode 100644 index 0000000..e64e10e --- /dev/null +++ b/.github/workflows/ubuntubuild.yml @@ -0,0 +1,94 @@ +name: ubuntu build workflows + +on: + push: + branches: + - 'develop' + paths: + - 'XEngine_Source/**' + - 'XEngine_Release/**' + - '.github/**' + +permissions: + contents: read + +jobs: + build: + strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false + matrix: + include: + - os: ubuntu-22.04 + - os: ubuntu-24.04 + runs-on: ${{ matrix.os }} + + steps: + # 检出您的主仓库代码 + - name: Checkout main repository code + uses: actions/checkout@v4 + with: + ref: 'develop' + + # 检出依赖的xengine仓库到指定的xengine目录 + - name: Checkout dependency repository (xengine) + uses: actions/checkout@v4 + with: + repository: libxengine/libxengine + path: libxengine + + - name: sub module checkout (opensource) + run: | + git submodule init + git submodule update + + - name: Set up Dependency ubuntu24.04 Environment + if: matrix.os == 'ubuntu-24.04' + run: | + cd libxengine + chmod 777 * + sudo ./XEngine_LINEnv.sh -i 3 + - name: Set up Dependency ubuntu22.04 Environment + if: matrix.os == 'ubuntu-22.04' + run: | + cd libxengine + chmod 777 * + sudo ./XEngine_LINEnv.sh -i 0 + + latest_tag=$(curl -s https://api.github.com/repos/libxengine/libxengine/releases/latest | jq -r .tag_name) + wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_UBuntu_22.04_x86-64.zip + unzip ./XEngine_UBuntu_22.04_x86-64.zip -d ./XEngine_UBuntu_22.04_x86-64 + cd XEngine_UBuntu_22.04_x86-64 + + sudo cp -rf ./XEngine_Include /usr/local/include + sudo find ./XEngine_Linux -name "*.so" -exec cp {} /usr/local/lib \; + sudo ldconfig + + - name: make + run: | + cd XEngine_Source + make + make FLAGS=InstallAll + make FLAGS=CleanAll + + make RELEASE=1 + make FLAGS=InstallAll + make FLAGS=CleanAll + cd .. + - name: test + run: | + cd XEngine_Release + ./XEngine_XStorageApp -t + + - name: Upload folder as artifact with ubuntu22.04 + if: matrix.os == 'ubuntu-22.04' + uses: actions/upload-artifact@v4 + with: + name: XEngine_XStorageApp-x86_64-Ubuntu-22.04 + path: XEngine_Release/ + - name: Upload folder as artifact with ubuntu24.04 + if: matrix.os == 'ubuntu-24.04' + uses: actions/upload-artifact@v4 + with: + name: XEngine_XStorageApp-x86_64-Ubuntu-24.04 + path: XEngine_Release/ \ No newline at end of file diff --git a/CHANGELOG b/CHANGELOG index a972f59..e32eba9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,21 @@ +XEngine_Storage V3.18.0.1001 + +added:MKCOL method support for webdav +modify:Do not allow deletion of non-empty directories +update:depend library +update:xengine v9 workflows support +update:more release support +fixed:build warn +fixed:return is incorrect for webdav + +增加:WEBDAV MKCOL方法支持 +更新:子模块支持库 +更新:xengine v9支持 +更新:更多发布系统支持 +修改:现在不支持WEBDAV删除空文件夹 +修正:编译警告 +修正:WEBDAV返回值处理不正确 +====================================================================================== XEngine_Storage V3.17.0.1001 added:workflows support diff --git a/README.en.md b/README.en.md index 9ad95fd..e184acf 100644 --- a/README.en.md +++ b/README.en.md @@ -39,7 +39,7 @@ feature list: ## install #### XEngine Evn -you must install XEngine,need V8.10 or above,install XEngine can be refer to xengine Readme docment +you must install XEngine,need V9.x or above,install XEngine can be refer to xengine Readme docment GITEE:https://gitee.com/libxengine/libxengine GITHUB:https://github.com/libxengine/libxengine @@ -60,7 +60,7 @@ Just Run it,use XEngine_AuthorizeApp if you need bt protocol support,you must install bt library by vcpkg:./vcpkg.exe install libtorrent #### Linux -use makefile compile,UBUNTU22.04 x64 or RockyLinux9 x64 +use makefile compile,UBUNTU22.04 or above Run it on the terminal if you need bt protocol support,you must install bt library:sudo apt install libtorrent-rasterbar-dev -y diff --git a/README.md b/README.md index 63c7f5b..36489a3 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ c c++ file storage service 此服务器更偏向于存储传输与API接口管理,此服务可以用于上传下载的管理,网络文件共享或者软件更新服务. 目前最好的HTTP存储服务,更方便管理,代码更简洁.持续维护中... +## 注意 +编译发布版本将只在github上面发布. + ## 软件特性 基于libXEngine开发并实现的一套简洁高性能跨平台网络存储服务 软件特性: @@ -38,7 +41,7 @@ c c++ file storage service ## 安装教程 #### XEngine环境 -必须安装XEngine,版本需要V8.10或者以上版本,安装XEngine可以参考其Readme文档 +必须安装XEngine,版本需要V9.x或者以上版本,安装XEngine可以参考其Readme文档 GITEE:https://gitee.com/libxengine/libxengine GITHUB:https://github.com/libxengine/libxengine @@ -60,7 +63,7 @@ git submodule update 如果需要bt协议支持,需要通过vcpkg安装bt支持库:./vcpkg.exe install libtorrent #### Linux -Linux使用Makefile编译,UBUNTU22.04 x64或者RockyLinux x64 +Linux使用Makefile编译,UBUNTU22.04以上系统 在控制台运行 如果需要bt协议支持,需要安装bt库,比如,在ubuntu下面安装:sudo apt install libtorrent-rasterbar-dev -y diff --git a/XEngine_APPClient/APPClient_BTorrent/APPClient_BTorrent.cpp b/XEngine_APPClient/APPClient_BTorrent/APPClient_BTorrent.cpp index 151fdf0..1c7c65b 100644 --- a/XEngine_APPClient/APPClient_BTorrent/APPClient_BTorrent.cpp +++ b/XEngine_APPClient/APPClient_BTorrent/APPClient_BTorrent.cpp @@ -40,7 +40,7 @@ int BTorrent_Parse(LPCXSTR lpszFile) { printf("BTorrent_Parse_GetNode:%d = %s\n", ppSt_ParseNode[i]->nValue, ppSt_ParseNode[i]->tszValue); } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ParseNode, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ParseNode, nListCount); nListCount = 0; if (!BTorrent_Parse_GetTracker(xhToken, &ppSt_ParseNode, &nListCount)) @@ -52,7 +52,7 @@ int BTorrent_Parse(LPCXSTR lpszFile) { printf("BTorrent_Parse_GetTracker:%d = %s\n", ppSt_ParseNode[i]->nValue, ppSt_ParseNode[i]->tszValue); } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ParseNode, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ParseNode, nListCount); nListCount = 0; if (!BTorrent_Parse_GetSeeds(xhToken, &ppSt_ParseNode, &nListCount)) @@ -64,7 +64,7 @@ int BTorrent_Parse(LPCXSTR lpszFile) { printf("BTorrent_Parse_GetSeeds:%d = %s\n", ppSt_ParseNode[i]->nValue, ppSt_ParseNode[i]->tszValue); } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ParseNode, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ParseNode, nListCount); nListCount = 0; int nPieceLen = 0; @@ -103,7 +103,7 @@ int BTorrent_Parse(LPCXSTR lpszFile) { printf("BTorrent_Parse_GetFile:%s %s %s %s %lld %lld %lld %d %d\n", ppSt_FileList[i]->tszFileHash, ppSt_FileList[i]->tszFilePath, ppSt_FileList[i]->tszFileName, ppSt_FileList[i]->tszFileLink, ppSt_FileList[i]->nFileOffset, ppSt_FileList[i]->nFileSize, ppSt_FileList[i]->nFileTime, ppSt_FileList[i]->nFileStart, ppSt_FileList[i]->nFileEnd); } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_FileList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_FileList, nListCount); BTorrent_Parse_Destory(xhToken); return 0; @@ -178,7 +178,7 @@ int BTorrent_Download() break; } std::this_thread::sleep_for(std::chrono::seconds(1)); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppenEventList, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppenEventList, nListCount); } BTorrent_DLoader_Close(xhToken); diff --git a/XEngine_APPClient/APPClient_Download/APPClient_Download.cpp b/XEngine_APPClient/APPClient_Download/APPClient_Download.cpp index f5628ff..3a71a2c 100644 --- a/XEngine_APPClient/APPClient_Download/APPClient_Download.cpp +++ b/XEngine_APPClient/APPClient_Download/APPClient_Download.cpp @@ -193,7 +193,7 @@ int main() } P2PFile_Create(&stl_ListFile, lpszFile); - BaseLib_OperatorMemory_FreeCStyle((VOID**)&ptszMsgBody); + BaseLib_Memory_FreeCStyle((VOID**)&ptszMsgBody); #ifdef _MSC_BUILD WSACleanup(); diff --git a/XEngine_APPClient/APPClient_RestApi/APPClient_RestApi.cpp b/XEngine_APPClient/APPClient_RestApi/APPClient_RestApi.cpp index 698740e..657f0dc 100644 --- a/XEngine_APPClient/APPClient_RestApi/APPClient_RestApi.cpp +++ b/XEngine_APPClient/APPClient_RestApi/APPClient_RestApi.cpp @@ -2,7 +2,7 @@ #include #include #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") -#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption") #pragma comment(lib,"XEngine_Client/XClient_APIHelp") #pragma comment(lib,"Ws2_32") #ifdef _WIN64 @@ -21,8 +21,8 @@ #include #include #include -#include -#include +#include +#include #include #include using namespace std; @@ -53,7 +53,7 @@ void API_Manage_Query() return; } _xtprintf("API_Manage_Query:%d,%s\n", nCode, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } //插入 void API_Manage_Insert() @@ -81,7 +81,7 @@ void API_Manage_Insert() return; } _xtprintf("API_Manage_Insert:%d,%s\n", nCode, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } //删除 void API_Manage_Delete() @@ -106,7 +106,7 @@ void API_Manage_Delete() return; } _xtprintf("API_Manage_Delete:%d,%s\n", nCode, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } //文件夹 void API_Manage_Dir() @@ -126,7 +126,7 @@ void API_Manage_Dir() return; } _xtprintf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); //查询 st_JsonRoot.clear(); st_JsonRoot["lpszBuckKey"] = "storagekey1"; @@ -138,7 +138,7 @@ void API_Manage_Dir() return; } _xtprintf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); //删除 st_JsonRoot.clear(); st_JsonRoot["lpszBuckKey"] = "storagekey1"; @@ -150,7 +150,7 @@ void API_Manage_Dir() return; } _xtprintf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } //任务管理 void API_Manage_Task() @@ -165,7 +165,7 @@ void API_Manage_Task() return; } _xtprintf("API_Manage_Task:%d,%s\n", nCode, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } int main() @@ -174,10 +174,6 @@ int main() WSADATA st_WSAData; WSAStartup(MAKEWORD(2, 2), &st_WSAData); #endif - memset(tszBaseBuffer, '\0', MAX_PATH); - memset(tszHdrBuffer, '\0', MAX_PATH); - OPenSsl_Help_BasicEncoder("123123aa", "123123", tszBaseBuffer); - _xstprintf(tszHdrBuffer, _X("Authorization: %s\r\n"), tszBaseBuffer); API_Manage_Query(); API_Manage_Insert(); diff --git a/XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPFile.cpp b/XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPFile.cpp index a926366..bbed9e9 100644 --- a/XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPFile.cpp +++ b/XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPFile.cpp @@ -47,8 +47,8 @@ int main(int argc, char** argv) _xtprintf("FileParser_ReadVer_GetLocal error\n"); return 0; } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_LocalList, nLocalCount); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_RemoteList, nRemoteCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_LocalList, nLocalCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_RemoteList, nRemoteCount); if (stl_ListUPDate.empty()) { diff --git a/XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPInstall.h b/XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPInstall.h index 8ecb29e..184066e 100644 --- a/XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPInstall.h +++ b/XEngine_APPClient/APPClient_UPDate/APPClient_UPFile/APPClient_UPInstall.h @@ -69,7 +69,7 @@ bool FileParser_ReadVer_GetRemote(LPCXSTR lpszJsonMsg, int nMsgLen, FILEPARSER_V return FALSE; } *pInt_Count = st_JsonArray.size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_FileList, *pInt_Count, sizeof(FILEPARSER_VERSIONINFO)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_FileList, *pInt_Count, sizeof(FILEPARSER_VERSIONINFO)); for (unsigned int i = 0; i < st_JsonArray.size(); i++) { @@ -169,7 +169,7 @@ bool FileParser_ReadVer_GetLocal(LPCXSTR lpszFileList, FILEPARSER_VERSIONINFO*** return FALSE; } *pInt_Count = st_JsonArray.size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_FileList, *pInt_Count, sizeof(FILEPARSER_VERSIONINFO)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_FileList, *pInt_Count, sizeof(FILEPARSER_VERSIONINFO)); for (unsigned int i = 0; i < st_JsonArray.size(); i++) { (*pppSt_FileList)[i]->st_LocalVersion.nModuleVersion = st_JsonArray[i]["ModuleVersion"].asInt64(); diff --git a/XEngine_APPClient/APPClient_UPDate/APPClient_UPMaker/APPClient_UPMaker.cpp b/XEngine_APPClient/APPClient_UPDate/APPClient_UPMaker/APPClient_UPMaker.cpp index 10c7be3..61c4b36 100644 --- a/XEngine_APPClient/APPClient_UPDate/APPClient_UPMaker/APPClient_UPMaker.cpp +++ b/XEngine_APPClient/APPClient_UPDate/APPClient_UPMaker/APPClient_UPMaker.cpp @@ -84,13 +84,13 @@ bool HelpModule_Api_BuildVer(XCHAR* ptszLocalBuffer, XCHAR* ptszRemoteBuffer, in HELPMODULE_FILELIST st_FileList; memset(&st_FileList, '\0', sizeof(HELPMODULE_FILELIST)); - if (!BaseLib_OperatorString_GetFileAndPath(ppszListDir[i], st_FileList.tszFilePath, st_FileList.tszFileName)) + if (!BaseLib_String_GetFileAndPath(ppszListDir[i], st_FileList.tszFilePath, st_FileList.tszFileName)) { return FALSE; } stl_ListFile.push_back(st_FileList); } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppszListDir, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppszListDir, nListCount); Json::Value st_JsonLocalRoot; Json::Value st_JsonLocalArray; @@ -108,7 +108,7 @@ bool HelpModule_Api_BuildVer(XCHAR* ptszLocalBuffer, XCHAR* ptszRemoteBuffer, in memset(tszTimer, '\0', sizeof(tszTimer)); memset(&st_Timer, '\0', sizeof(XENGINE_LIBTIMER)); - BaseLib_OperatorTime_GetSysTime(&st_Timer); + BaseLib_Time_GetSysTime(&st_Timer); _xstprintf(tszTimer, _X("%04d%02d%02d%02d%02d%02d"), st_Timer.wYear, st_Timer.wMonth, st_Timer.wDay, st_Timer.wHour, st_Timer.wMinute, st_Timer.wSecond); __int64x m_nFileVer = _ttxoll(tszTimer); @@ -135,7 +135,7 @@ bool HelpModule_Api_BuildVer(XCHAR* ptszLocalBuffer, XCHAR* ptszRemoteBuffer, in memset(tszDlPath, '\0', sizeof(tszDlPath)); //删除指定字符串 int nPathType = 0; - BaseLib_OperatorString_GetPath(stl_ListIterator->tszFilePath, &nPathType); + BaseLib_String_GetPath(stl_ListIterator->tszFilePath, &nPathType); if (1 == nPathType) { XCHAR tszDelPath[MAX_PATH]; @@ -149,8 +149,8 @@ bool HelpModule_Api_BuildVer(XCHAR* ptszLocalBuffer, XCHAR* ptszRemoteBuffer, in tszDelPath[_tcsxlen(tszDelPath) - 1] = '\0'; - BaseLib_OperatorString_DelSub(tszSubPath, tszDelPath); - BaseLib_OperatorString_FixPath(tszSubPath, 2); + BaseLib_String_DelSub(tszSubPath, tszDelPath); + BaseLib_String_FixPath(tszSubPath, 2); _xstprintf(tszDlPath, _X("%s%s%s"), lpszDlUrl, tszSubPath, stl_ListIterator->tszFileName); } else diff --git a/XEngine_APPClient/APPClient_UPDownload/APPClient_UPDownload.cpp b/XEngine_APPClient/APPClient_UPDownload/APPClient_UPDownload.cpp index bc4d475..26a3d29 100644 --- a/XEngine_APPClient/APPClient_UPDownload/APPClient_UPDownload.cpp +++ b/XEngine_APPClient/APPClient_UPDownload/APPClient_UPDownload.cpp @@ -2,7 +2,7 @@ #include #include #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") -#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption") #pragma comment(lib,"XEngine_Client/XClient_APIHelp") #pragma comment(lib,"Ws2_32") #pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp") @@ -22,15 +22,15 @@ #include #include #include -#include -#include +#include +#include #include #include using namespace std; //需要优先配置XEngine //WINDOWS使用VS2022 x86 或者 x64 debug 编译 -//linux macos::g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Release -lXEngine_BaseLib -lXEngine_OPenSsl -lXClient_APIHelp -ljsoncpp -Wl,-rpath=../../XEngine_Release +//linux macos::g++ -std=c++17 -Wall -g APPClient_UPDownload.cpp -o APPClient_UPDownload.exe -I ../../XEngine_Source/XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Release -lXEngine_BaseLib -lXEngine_Cryption -lXClient_APIHelp -ljsoncpp -Wl,-rpath=../../XEngine_Release //上传文件 @@ -40,18 +40,15 @@ void File_UPLoad() int nLen = 0; int nCode = 0; XCHAR* ptszMsgBuffer = NULL; - XCHAR tszBaseBuffer[128]; XCHAR tszHdrBuffer[MAX_PATH]; XCHAR tszKeyBuffer[MAX_PATH]; LPCXSTR lpszMsgBuffer = _X("01234"); LPCXSTR lpszMsgBuffer2 = _X("56789"); - memset(tszBaseBuffer, '\0', sizeof(tszBaseBuffer)); memset(tszHdrBuffer, '\0', MAX_PATH); memset(tszKeyBuffer, '\0', MAX_PATH); - OPenSsl_Help_BasicEncoder("123123aa", "123123", tszBaseBuffer); - _xstprintf(tszHdrBuffer, _X("Range: bytes=0-5/10\r\nAuthorization: %s\r\n"), tszBaseBuffer); + _xstprintf(tszHdrBuffer, _X("Range: bytes=0-5/10\r\n")); if (!APIClient_Http_Request(_X("POST"), lpszUrl, lpszMsgBuffer, &nCode, &ptszMsgBuffer, &nLen, tszHdrBuffer)) { _xtprintf("upload failed:%lX\n", APIClient_GetLastError()); @@ -68,18 +65,18 @@ void File_UPLoad() _tcsxcpy(tszKeyBuffer, st_JsonRoot["lpszBuckKey"].asCString()); _xtprintf("upload:%d\n", nCode); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); //断点续传必须指定storagekey nLen = 0; memset(tszHdrBuffer, '\0', MAX_PATH); - _xstprintf(tszHdrBuffer, _X("Range: bytes=5-10/10\r\nAuthorization: %s\r\nStorageKey: %s\r\n"), tszBaseBuffer, tszKeyBuffer); + _xstprintf(tszHdrBuffer, _X("Range: bytes=5-10/10\r\nStorageKey: %s\r\n"), tszKeyBuffer); if (!APIClient_Http_Request(_X("POST"), lpszUrl, lpszMsgBuffer2, &nCode, &ptszMsgBuffer, &nLen, tszHdrBuffer)) { _xtprintf("upload failed:%lX\n", APIClient_GetLastError()); return; } _xtprintf("upload:%d\n%s\n", nCode, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } //下载文件 void File_Download() @@ -88,31 +85,28 @@ void File_Download() int nLen = 0; XCHAR* ptszMsgBuffer = NULL; - XCHAR tszBaseBuffer[128]; XCHAR tszHdrBuffer[MAX_PATH]; - memset(tszBaseBuffer, '\0', sizeof(tszBaseBuffer)); memset(tszHdrBuffer, '\0', MAX_PATH); - OPenSsl_Help_BasicEncoder("123123aa", "123123", tszBaseBuffer); - _xstprintf(tszHdrBuffer, _X("Range: bytes=0-5\r\nAuthorization: %s\r\n"), tszBaseBuffer); + _xstprintf(tszHdrBuffer, _X("Range: bytes=0-5\r\n")); if (!APIClient_Http_Request(_X("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen, tszHdrBuffer)) { _xtprintf("download failed:%lX\n", APIClient_GetLastError()); return; } _xtprintf("download:%d,%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); memset(tszHdrBuffer, '\0', MAX_PATH); - _xstprintf(tszHdrBuffer, _X("Range: bytes=5-10\r\nAuthorization: %s\r\n"), tszBaseBuffer); + _xstprintf(tszHdrBuffer, _X("Range: bytes=5-10\r\n")); if (!APIClient_Http_Request(_X("GET"), lpszUrl, NULL, NULL, &ptszMsgBuffer, &nLen, tszHdrBuffer)) { _xtprintf("download failed:%lX\n", APIClient_GetLastError()); return; } _xtprintf("download:%d,%s\n", nLen, ptszMsgBuffer); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } int main() diff --git a/XEngine_APPClient/VSCopy_x86.bat b/XEngine_APPClient/VSCopy_x86.bat index fbbc0b7..768ce0e 100644 --- a/XEngine_APPClient/VSCopy_x86.bat +++ b/XEngine_APPClient/VSCopy_x86.bat @@ -1,5 +1,5 @@ copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_BaseLib.dll" "./" copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_Algorithm.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_OPenSsl.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Cryption.dll" "./" copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Client\XClient_APIHelp.dll" "./" \ No newline at end of file diff --git a/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json b/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json index 7a931bc..bc27280 100644 --- a/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json +++ b/XEngine_Release/XEngine_Config/XEngine_VersionConfig.json @@ -1,5 +1,6 @@ { "XVer":[ + "3.18.0.1001 Build20250103", "3.17.0.1001 Build20241106", "3.16.0.1001 Build20240813", "3.15.0.1001 Build20240511", diff --git a/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.cpp b/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.cpp index bec41bd..cb03b41 100644 --- a/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.cpp +++ b/XEngine_Source/StorageModule_APIHelp/APIHelp_Api/APIHelp_Api.cpp @@ -135,7 +135,7 @@ bool CAPIHelp_Api::APIHelp_Api_RangeFile(int* pInt_SPos, int* pInt_EPos, __int64 { nBPos = 6; } - if (!BaseLib_OperatorString_GetKeyValue(tszFieldStr + nBPos, "-", tszKeyStr, tszValueStr)) + if (!BaseLib_String_GetKeyValue(tszFieldStr + nBPos, "-", tszKeyStr, tszValueStr)) { APIHelp_IsErrorOccur = true; APIHelp_dwErrorCode = ERROR_STORAGE_MODULE_APIHELP_PARSELEN; @@ -147,7 +147,7 @@ bool CAPIHelp_Api::APIHelp_Api_RangeFile(int* pInt_SPos, int* pInt_EPos, __int64 memset(tszRangeEnd, '\0', sizeof(tszRangeEnd)); memset(tszRangeCount, '\0', sizeof(tszRangeCount)); - if (BaseLib_OperatorString_GetKeyValue(tszValueStr, "/", tszRangeEnd, tszRangeCount)) + if (BaseLib_String_GetKeyValue(tszValueStr, "/", tszRangeEnd, tszRangeCount)) { *pInt_SPos = _ttxoi(tszKeyStr); *pInt_EPos = _ttxoi(tszRangeEnd); @@ -327,7 +327,7 @@ bool CAPIHelp_Api::APIHelp_Api_UrlParse(XCHAR*** ppptszList, int nListCount, XCH memset(tszKey, '\0', MAX_PATH); memset(tszValue, '\0', MAX_PATH); - BaseLib_OperatorString_GetKeyValue((*ppptszList)[i], _X("="), tszKey, tszValue); + BaseLib_String_GetKeyValue((*ppptszList)[i], _X("="), tszKey, tszValue); if (0 == _tcsxnicmp(lpszHDRFile, tszKey, _tcsxlen(lpszHDRFile))) { @@ -336,12 +336,12 @@ bool CAPIHelp_Api::APIHelp_Api_UrlParse(XCHAR*** ppptszList, int nListCount, XCH XCHAR tszFileName[MAX_PATH]; memset(tszFileName, '\0', MAX_PATH); - OPenSsl_Codec_UrlDeCodec(tszValue, _tcsxlen(tszValue), tszFileName); + Cryption_Codec_UrlDeCodec(tszValue, _tcsxlen(tszValue), tszFileName); int nLen = _tcsxlen(tszFileName); - BaseLib_OperatorCharset_UTFToAnsi(tszFileName, ptszFileName, &nLen); + BaseLib_Charset_UTFToAnsi(tszFileName, ptszFileName, &nLen); #else - OPenSsl_Codec_UrlDeCodec(tszValue, _tcsxlen(tszValue), ptszFileName); + Cryption_Codec_UrlDeCodec(tszValue, _tcsxlen(tszValue), ptszFileName); #endif } else if (0 == _tcsxnicmp(lpszHDRKey, tszKey, _tcsxlen(lpszHDRKey))) @@ -386,18 +386,18 @@ bool CAPIHelp_Api::APIHelp_Api_Boundary(XCHAR*** ppptszList, int nListCount, XCH XCHAR tszKeyStr[MAX_PATH] = {}; XCHAR tszVluStr[MAX_PATH] = {}; - BaseLib_OperatorString_GetKeyValue((*ppptszList)[i], _X(": "), tszKeyStr, tszVluStr); + BaseLib_String_GetKeyValue((*ppptszList)[i], _X(": "), tszKeyStr, tszVluStr); if (0 == _tcsxnicmp(lpszHDRContent, tszKeyStr, _tcsxlen(lpszHDRContent))) { XCHAR tszKeySub[MAX_PATH] = {}; XCHAR tszVluSub[MAX_PATH] = {}; //multipart/form-data; boundary=AaB03x - if (BaseLib_OperatorString_GetKeyValue(tszVluStr, _X(";"), tszKeySub, tszVluSub)) + if (BaseLib_String_GetKeyValue(tszVluStr, _X(";"), tszKeySub, tszVluSub)) { //boundary=AaB03x ptszBoundStr[0] = '-';//要少一个字节 - if (BaseLib_OperatorString_GetKeyValue(tszVluSub, _X("="), tszKeyStr, ptszBoundStr + 1)) + if (BaseLib_String_GetKeyValue(tszVluSub, _X("="), tszKeyStr, ptszBoundStr + 1)) { bRet = true; break; @@ -439,7 +439,7 @@ bool CAPIHelp_Api::APIHelp_Api_GetDIRSize(LPCXSTR lpszDIRStr, __int64u* pInt_DIR _xtstat(ppListFile[i], &st_FStat); nDirCount += st_FStat.st_size; } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppListFile, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppListFile, nListCount); *pInt_DIRSize = nDirCount; return true; } diff --git a/XEngine_Source/StorageModule_APIHelp/APIHelp_Cryption/APIHelp_Cryption.cpp b/XEngine_Source/StorageModule_APIHelp/APIHelp_Cryption/APIHelp_Cryption.cpp index 5701a17..52add75 100644 --- a/XEngine_Source/StorageModule_APIHelp/APIHelp_Cryption/APIHelp_Cryption.cpp +++ b/XEngine_Source/StorageModule_APIHelp/APIHelp_Cryption/APIHelp_Cryption.cpp @@ -65,7 +65,7 @@ bool CAPIHelp_Cryption::APIHelp_Cryption_BasicEncoder(LPCXSTR lpszUser, LPCXSTR memset(tszBaseBuffer, '\0', sizeof(tszBaseBuffer)); int nLen = _xstprintf(tszMsgBuffer, _X("%s:%s"), lpszUser, lpszPass); - if (!OPenSsl_Codec_Base64(tszMsgBuffer, tszBaseBuffer, &nLen)) + if (!Cryption_Codec_Base64(tszMsgBuffer, tszBaseBuffer, &nLen)) { return false; } @@ -119,7 +119,7 @@ bool CAPIHelp_Cryption::APIHelp_Cryption_BasicDecoder(LPCXSTR lpszMsgBuffer, XCH if (NULL == _tcsxstr(lpszMsgBuffer, _X("Basic"))) { int nMsgLen = _tcsxlen(lpszMsgBuffer); - if (!OPenSsl_Codec_Base64(lpszMsgBuffer, tszBaseBuffer, &nMsgLen, false)) + if (!Cryption_Codec_Base64(lpszMsgBuffer, tszBaseBuffer, &nMsgLen, false)) { return false; } @@ -127,7 +127,7 @@ bool CAPIHelp_Cryption::APIHelp_Cryption_BasicDecoder(LPCXSTR lpszMsgBuffer, XCH else { int nMsgLen = _tcsxlen(lpszMsgBuffer) - 6; - if (!OPenSsl_Codec_Base64(lpszMsgBuffer + 6, tszBaseBuffer, &nMsgLen, false)) + if (!Cryption_Codec_Base64(lpszMsgBuffer + 6, tszBaseBuffer, &nMsgLen, false)) { return false; } @@ -223,15 +223,15 @@ bool CAPIHelp_Cryption::APIHelp_Cryption_Digest(XCHAR* ptszResponseStr, LPCXSTR //计算HA1 的MD5字符串 MD5(USER:PASS:REAL) int nRet = _xstprintf(tszUserStr, _X("%s:%s:%s"), lpszUser, lpszRealm, lpszPass); - OPenSsl_Api_Digest(tszUserStr, tszUserMD5, &nRet); - BaseLib_OperatorString_StrToHex((XCHAR*)tszUserMD5, nRet, tszUserHex); + Cryption_Api_Digest(tszUserStr, tszUserMD5, &nRet); + BaseLib_String_StrToHex((XCHAR*)tszUserMD5, nRet, tszUserHex); //计算HA2 的MD5字符串,根据验证模式来计算 nRet = _xstprintf(tszUrlStr, _X("%s:%s"), lpszMethod, lpszUrl); - OPenSsl_Api_Digest(tszUrlStr, tszUrlMD5, &nRet); - BaseLib_OperatorString_StrToHex((XCHAR*)tszUrlMD5, nRet, tszUrlHex); + Cryption_Api_Digest(tszUrlStr, tszUrlMD5, &nRet); + BaseLib_String_StrToHex((XCHAR*)tszUrlMD5, nRet, tszUrlHex); //计算RESPONSE值 nRet = _xstprintf(tszResponseStr, _X("%s:%s:%s:%s:auth:%s"), tszUserHex, lpszNonce, lpszNC, lpszCNonce, tszUrlHex); - OPenSsl_Api_Digest(tszResponseStr, tszResponseMD5, &nRet); - BaseLib_OperatorString_StrToHex((XCHAR*)tszResponseMD5, nRet, ptszResponseStr); + Cryption_Api_Digest(tszResponseStr, tszResponseMD5, &nRet); + BaseLib_String_StrToHex((XCHAR*)tszResponseMD5, nRet, ptszResponseStr); return true; } \ No newline at end of file diff --git a/XEngine_Source/StorageModule_APIHelp/APIHelp_Distributed/APIHelp_Distributed.cpp b/XEngine_Source/StorageModule_APIHelp/APIHelp_Distributed/APIHelp_Distributed.cpp index 60c3dde..3583b7a 100644 --- a/XEngine_Source/StorageModule_APIHelp/APIHelp_Distributed/APIHelp_Distributed.cpp +++ b/XEngine_Source/StorageModule_APIHelp/APIHelp_Distributed/APIHelp_Distributed.cpp @@ -59,7 +59,7 @@ bool CAPIHelp_Distributed::APIHelp_Distributed_RandomAddr(list* pStl_Lis if (1 == nMode) { XNETHANDLE xhToken = 0; - BaseLib_OperatorHandle_Create(&xhToken, 0, pStl_ListAddr->size(), false); + BaseLib_Handle_Create(&xhToken, 0, pStl_ListAddr->size(), false); if (xhToken == pStl_ListAddr->size()) { xhToken--; @@ -128,7 +128,7 @@ bool CAPIHelp_Distributed::APIHelp_Distributed_FileList(list return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_ListPacket, pStl_ListParse->size(), sizeof(XSTORAGECORE_DBFILE)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_ListPacket, pStl_ListParse->size(), sizeof(XSTORAGECORE_DBFILE)); list::const_iterator stl_ListIterator = pStl_ListParse->begin(); for (int i = 0; stl_ListIterator != pStl_ListParse->end(); stl_ListIterator++, i++) { @@ -392,7 +392,7 @@ bool CAPIHelp_Distributed::APIHelp_Distributed_UPStorage(list #include #include -#include -#include +#include +#include #include #include #include @@ -61,7 +61,7 @@ extern XLONG APIHelp_dwErrorCode; #ifdef _MSC_BUILD #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib") -#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption") #pragma comment(lib,"XEngine_RfcComponents/RfcComponents_HttpProtocol") #pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi") #ifdef _DEBUG diff --git a/XEngine_Source/StorageModule_BTorrent/BTorrent_Creator/BTorrent_Creator.cpp b/XEngine_Source/StorageModule_BTorrent/BTorrent_Creator/BTorrent_Creator.cpp index aa694db..995d9d0 100644 --- a/XEngine_Source/StorageModule_BTorrent/BTorrent_Creator/BTorrent_Creator.cpp +++ b/XEngine_Source/StorageModule_BTorrent/BTorrent_Creator/BTorrent_Creator.cpp @@ -72,7 +72,7 @@ bool CBTorrent_Creator::BTorrent_Creator_Init(XNETHANDLE* pxhToken, LPCXSTR lpsz st_BTCreator.m_nPieceSize = nPieceSize; _tcsxcpy(st_BTCreator.tszBTPath, lpszBTPath); - BaseLib_OperatorHandle_Create(pxhToken); + BaseLib_Handle_Create(pxhToken); st_Locker.lock(); stl_MapBTCreator.insert(make_pair(*pxhToken, st_BTCreator)); st_Locker.unlock(); diff --git a/XEngine_Source/StorageModule_BTorrent/BTorrent_DLoader/BTorrent_DLoader.cpp b/XEngine_Source/StorageModule_BTorrent/BTorrent_DLoader/BTorrent_DLoader.cpp index 86f380e..29bbf33 100644 --- a/XEngine_Source/StorageModule_BTorrent/BTorrent_DLoader/BTorrent_DLoader.cpp +++ b/XEngine_Source/StorageModule_BTorrent/BTorrent_DLoader/BTorrent_DLoader.cpp @@ -107,7 +107,7 @@ bool CBTorrent_DLoader::BTorrent_DLoader_Create(XNETHANDLE* pxhToken, LPCXSTR lp _tcsxcpy(pSt_BTDLoader->tszAddr, lpszAddr); _tcsxcpy(pSt_BTDLoader->tszFile, lpszSavePath); //生成句柄 - BaseLib_OperatorHandle_Create(pxhToken); + BaseLib_Handle_Create(pxhToken); st_Locker.lock(); stl_MapDLoader.insert(make_pair(*pxhToken, pSt_BTDLoader)); @@ -171,7 +171,7 @@ bool CBTorrent_DLoader::BTorrent_DLoader_Query(XNETHANDLE xhToken, ENUM_BTORRENT return false; } *pInt_ListCount = stl_VectorAlerts.size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppenEventList, stl_VectorAlerts.size(), sizeof(ENUM_BTORRENT_EVENT_TYPE)); + BaseLib_Memory_Malloc((XPPPMEM)pppenEventList, stl_VectorAlerts.size(), sizeof(ENUM_BTORRENT_EVENT_TYPE)); //轮训元素 int i = 0; for (lt::alert const* stl_ListElement : stl_VectorAlerts) @@ -225,7 +225,7 @@ bool CBTorrent_DLoader::BTorrent_DLoader_Query(XNETHANDLE xhToken, ENUM_BTORRENT { #if _MSC_BUILD int nUTFLen = stl_VectorIterator->name.length(); - BaseLib_OperatorCharset_UTFToAnsi(stl_VectorIterator->name.c_str(), stl_MapIterator->second->st_DLStatus.tszFileName, &nUTFLen); + BaseLib_Charset_UTFToAnsi(stl_VectorIterator->name.c_str(), stl_MapIterator->second->st_DLStatus.tszFileName, &nUTFLen); stl_MapIterator->second->st_DLStatus.nDLoadTotal = stl_VectorIterator->total; #else _tcsxcpy(stl_MapIterator->second->st_DLStatus.tszFileName, stl_VectorIterator->name.c_str()); diff --git a/XEngine_Source/StorageModule_BTorrent/BTorrent_Define.h b/XEngine_Source/StorageModule_BTorrent/BTorrent_Define.h index 8a128bb..33ca1ac 100644 --- a/XEngine_Source/StorageModule_BTorrent/BTorrent_Define.h +++ b/XEngine_Source/StorageModule_BTorrent/BTorrent_Define.h @@ -246,7 +246,7 @@ extern "C" bool BTorrent_Parse_Init(XNETHANDLE* pxhToken, LPCXSTR lpszAddr); In/Out:Out 类型:三级指针 可空:N - 意思:输出解析到的节点列表,此参数需要BaseLib_OperatorMemory_Free释放内存 + 意思:输出解析到的节点列表,此参数需要BaseLib_Memory_Free释放内存 参数.三:pInt_ListCount In/Out:Out 类型:整数型指针 @@ -270,7 +270,7 @@ extern "C" bool BTorrent_Parse_GetNode(XNETHANDLE xhToken, BTORRENT_PARSEMAP*** In/Out:Out 类型:三级指针 可空:N - 意思:输出解析到的列表,此参数需要BaseLib_OperatorMemory_Free释放内存 + 意思:输出解析到的列表,此参数需要BaseLib_Memory_Free释放内存 参数.三:pInt_ListCount In/Out:Out 类型:整数型指针 @@ -294,7 +294,7 @@ extern "C" bool BTorrent_Parse_GetTracker(XNETHANDLE xhToken, BTORRENT_PARSEMAP* In/Out:Out 类型:三级指针 可空:N - 意思:输出解析到的列表,此参数需要BaseLib_OperatorMemory_Free释放内存 + 意思:输出解析到的列表,此参数需要BaseLib_Memory_Free释放内存 参数.三:pInt_ListCount In/Out:Out 类型:整数型指针 diff --git a/XEngine_Source/StorageModule_BTorrent/BTorrent_Parse/BTorrent_Parse.cpp b/XEngine_Source/StorageModule_BTorrent/BTorrent_Parse/BTorrent_Parse.cpp index bda5cc9..5d70a2f 100644 --- a/XEngine_Source/StorageModule_BTorrent/BTorrent_Parse/BTorrent_Parse.cpp +++ b/XEngine_Source/StorageModule_BTorrent/BTorrent_Parse/BTorrent_Parse.cpp @@ -90,7 +90,7 @@ bool CBTorrent_Parse::BTorrent_Parse_Init(XNETHANDLE* pxhToken, LPCXSTR lpszAddr //如果是磁力 } - BaseLib_OperatorHandle_Create(pxhToken); + BaseLib_Handle_Create(pxhToken); st_Locker.lock(); stl_MapBTParse.insert(make_pair(*pxhToken, pSt_BTParse)); st_Locker.unlock(); @@ -109,7 +109,7 @@ bool CBTorrent_Parse::BTorrent_Parse_Init(XNETHANDLE* pxhToken, LPCXSTR lpszAddr In/Out:Out 类型:三级指针 可空:N - 意思:输出解析到的节点列表,此参数需要BaseLib_OperatorMemory_Free释放内存 + 意思:输出解析到的节点列表,此参数需要BaseLib_Memory_Free释放内存 参数.三:pInt_ListCount In/Out:Out 类型:整数型指针 @@ -141,7 +141,7 @@ bool CBTorrent_Parse::BTorrent_Parse_GetNode(XNETHANDLE xhToken, BTORRENT_PARSEM } #if 1 == _XENGIEN_STORAGE_BUILDSWITCH_BTORRENT *pInt_ListCount = stl_MapIterator->second->m_BTInfo->nodes().size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_Parse, stl_MapIterator->second->m_BTInfo->nodes().size(), sizeof(BTORRENT_PARSEMAP)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_Parse, stl_MapIterator->second->m_BTInfo->nodes().size(), sizeof(BTORRENT_PARSEMAP)); std::vector>::const_iterator stl_ListIterator = stl_MapIterator->second->m_BTInfo->nodes().begin(); for (int i = 0; stl_ListIterator != stl_MapIterator->second->m_BTInfo->nodes().end(); stl_ListIterator++, i++) { @@ -164,7 +164,7 @@ bool CBTorrent_Parse::BTorrent_Parse_GetNode(XNETHANDLE xhToken, BTORRENT_PARSEM In/Out:Out 类型:三级指针 可空:N - 意思:输出解析到的列表,此参数需要BaseLib_OperatorMemory_Free释放内存 + 意思:输出解析到的列表,此参数需要BaseLib_Memory_Free释放内存 参数.三:pInt_ListCount In/Out:Out 类型:整数型指针 @@ -197,7 +197,7 @@ bool CBTorrent_Parse::BTorrent_Parse_GetTracker(XNETHANDLE xhToken, BTORRENT_PAR #if 1 == _XENGIEN_STORAGE_BUILDSWITCH_BTORRENT int i = 0; *pInt_ListCount = stl_MapIterator->second->m_BTInfo->trackers().size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_Parse, stl_MapIterator->second->m_BTInfo->trackers().size(), sizeof(BTORRENT_PARSEMAP)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_Parse, stl_MapIterator->second->m_BTInfo->trackers().size(), sizeof(BTORRENT_PARSEMAP)); for (auto const& stl_ListIterator : stl_MapIterator->second->m_BTInfo->trackers()) { @@ -221,7 +221,7 @@ bool CBTorrent_Parse::BTorrent_Parse_GetTracker(XNETHANDLE xhToken, BTORRENT_PAR In/Out:Out 类型:三级指针 可空:N - 意思:输出解析到的列表,此参数需要BaseLib_OperatorMemory_Free释放内存 + 意思:输出解析到的列表,此参数需要BaseLib_Memory_Free释放内存 参数.三:pInt_ListCount In/Out:Out 类型:整数型指针 @@ -254,7 +254,7 @@ bool CBTorrent_Parse::BTorrent_Parse_GetSeeds(XNETHANDLE xhToken, BTORRENT_PARSE #if 1 == _XENGIEN_STORAGE_BUILDSWITCH_BTORRENT int i = 0; *pInt_ListCount = stl_MapIterator->second->m_BTInfo->web_seeds().size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_Parse, stl_MapIterator->second->m_BTInfo->web_seeds().size(), sizeof(BTORRENT_PARSEMAP)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_Parse, stl_MapIterator->second->m_BTInfo->web_seeds().size(), sizeof(BTORRENT_PARSEMAP)); for (auto const& stl_ListIterator : stl_MapIterator->second->m_BTInfo->web_seeds()) { @@ -451,10 +451,10 @@ bool CBTorrent_Parse::BTorrent_Parse_GetFile(XNETHANDLE xhToken, XCHAR* ptszFile } #if 1 == _XENGIEN_STORAGE_BUILDSWITCH_BTORRENT int nUTFLen = stl_MapIterator->second->m_BTInfo->name().length(); - BaseLib_OperatorCharset_UTFToAnsi(stl_MapIterator->second->m_BTInfo->name().c_str(), ptszFilePath, &nUTFLen); + BaseLib_Charset_UTFToAnsi(stl_MapIterator->second->m_BTInfo->name().c_str(), ptszFilePath, &nUTFLen); *pInt_ListCount = stl_MapIterator->second->m_BTInfo->num_files(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_FileList, stl_MapIterator->second->m_BTInfo->num_files(), sizeof(BTORRENT_FILEINFO)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_FileList, stl_MapIterator->second->m_BTInfo->num_files(), sizeof(BTORRENT_FILEINFO)); lt::file_storage const& m_FileStorage = stl_MapIterator->second->m_BTInfo->files(); int i = 0; @@ -470,9 +470,9 @@ bool CBTorrent_Parse::BTorrent_Parse_GetFile(XNETHANDLE xhToken, XCHAR* ptszFile } #ifdef _MSC_BUILD nUTFLen = m_FileStorage.file_path(stl_ListIterator).length(); - BaseLib_OperatorCharset_UTFToAnsi(m_FileStorage.file_path(stl_ListIterator).c_str(), (*pppSt_FileList)[i]->tszFilePath, &nUTFLen); + BaseLib_Charset_UTFToAnsi(m_FileStorage.file_path(stl_ListIterator).c_str(), (*pppSt_FileList)[i]->tszFilePath, &nUTFLen); nUTFLen = m_FileStorage.file_name(stl_ListIterator).size(); - BaseLib_OperatorCharset_UTFToAnsi(m_FileStorage.file_name(stl_ListIterator).data(), (*pppSt_FileList)[i]->tszFileName, &nUTFLen); + BaseLib_Charset_UTFToAnsi(m_FileStorage.file_name(stl_ListIterator).data(), (*pppSt_FileList)[i]->tszFileName, &nUTFLen); #else _tcsxcpy((*pppSt_FileList)[i]->tszFilePath, m_FileStorage.file_path(stl_ListIterator).c_str()); _tcsxcpy((*pppSt_FileList)[i]->tszFileName, m_FileStorage.file_name(stl_ListIterator).data()); diff --git a/XEngine_Source/StorageModule_Database/Database_Define.h b/XEngine_Source/StorageModule_Database/Database_Define.h index 54d3276..38dc2e3 100644 --- a/XEngine_Source/StorageModule_Database/Database_Define.h +++ b/XEngine_Source/StorageModule_Database/Database_Define.h @@ -17,7 +17,7 @@ typedef struct { XENGINE_PROTOCOL_FILE st_ProtocolFile; XCHAR tszBuckKey[MAX_PATH]; //路径的关键字 - XCHAR tszTableName[64]; //日期表名称,插入:表示自定义插入日期表,获取:表示导出这个文件所属日期表 + XCHAR tszTableName[MAX_PATH]; //日期表名称,插入:表示自定义插入日期表,获取:表示导出这个文件所属日期表 }XSTORAGECORE_DBFILE, *LPXSTORAGECORE_DBFILE; typedef struct { diff --git a/XEngine_Source/StorageModule_Database/Database_File/Database_File.cpp b/XEngine_Source/StorageModule_Database/Database_File/Database_File.cpp index 11a05d4..2968e79 100644 --- a/XEngine_Source/StorageModule_Database/Database_File/Database_File.cpp +++ b/XEngine_Source/StorageModule_Database/Database_File/Database_File.cpp @@ -132,7 +132,7 @@ bool CDatabase_File::Database_File_FileInsert(XSTORAGECORE_DBFILE *pSt_DBManage, XSTORAGECORE_DBFILE **ppSt_ListFile; if (Database_File_FileQuery(&ppSt_ListFile, &nListCount, NULL, NULL, NULL, NULL, NULL, pSt_DBManage->st_ProtocolFile.tszFileHash)) { - BaseLib_OperatorMemory_Free((void***)&ppSt_ListFile, nListCount); + BaseLib_Memory_Free((void***)&ppSt_ListFile, nListCount); return true; } XCHAR tszSQLQuery[2048]; @@ -146,7 +146,7 @@ bool CDatabase_File::Database_File_FileInsert(XSTORAGECORE_DBFILE *pSt_DBManage, int nType = 0; std::string m_StrSQL = tszSQLQuery; - BaseLib_OperatorString_GetPath(pSt_DBManage->st_ProtocolFile.tszFilePath, &nType); + BaseLib_String_GetPath(pSt_DBManage->st_ProtocolFile.tszFilePath, &nType); if (1 == nType) { std::string m_StrSource = "\\"; @@ -443,7 +443,7 @@ bool CDatabase_File::Database_File_FileQuery(XSTORAGECORE_DBFILE*** pppSt_ListFi Database_dwErrorCode = ERROR_XENGINE_XSTROGE_CORE_DB_QUERYFILE_EMPTY; return false; } - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_ListFile, stl_ListFile.size(), sizeof(XSTORAGECORE_DBFILE)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_ListFile, stl_ListFile.size(), sizeof(XSTORAGECORE_DBFILE)); list::const_iterator stl_ListIterator = stl_ListFile.begin(); for (int i = 0; stl_ListIterator != stl_ListFile.end(); stl_ListIterator++, i++) @@ -477,10 +477,10 @@ bool CDatabase_File::Database_File_CreateTable() memset(tszTableName, '\0', sizeof(tszTableName)); memset(tszSQLQuery, '\0', sizeof(tszSQLQuery)); - XENGINE_LIBTIMER st_DBTime; - memset(&st_DBTime, 0, sizeof(XENGINE_LIBTIMER)); + XENGINE_LIBTIME st_DBTime; + memset(&st_DBTime, 0, sizeof(XENGINE_LIBTIME)); - BaseLib_OperatorTime_GetSysTime(&st_DBTime); + BaseLib_Time_GetSysTime(&st_DBTime); if (12 == st_DBTime.wMonth) { @@ -507,7 +507,7 @@ bool CDatabase_File::Database_File_CreateTable() int nUTFLen = 0; XCHAR tszUTFBuffer[2048]; memset(tszUTFBuffer, '\0', sizeof(tszUTFBuffer)); - BaseLib_OperatorCharset_AnsiToUTF(tszSQLQuery, tszUTFBuffer, &nUTFLen); + BaseLib_Charset_AnsiToUTF(tszSQLQuery, tszUTFBuffer, &nUTFLen); if (!DataBase_MySQL_Execute(xhDBSQL, tszUTFBuffer)) #else if (!DataBase_MySQL_Execute(xhDBSQL, tszSQLQuery)) @@ -542,10 +542,10 @@ bool CDatabase_File::Database_File_TimeMonth(LPCXSTR lpszStartTime, int* pInt_Mo { Database_IsErrorOccur = false; - XENGINE_LIBTIMER st_EndTime; - memset(&st_EndTime, '\0', sizeof(XENGINE_LIBTIMER)); + XENGINE_LIBTIME st_EndTime; + memset(&st_EndTime, '\0', sizeof(XENGINE_LIBTIME)); - BaseLib_OperatorTime_GetSysTime(&st_EndTime); + BaseLib_Time_GetSysTime(&st_EndTime); XCHAR tszTimeStr[64]; memset(tszTimeStr, '\0', sizeof(tszTimeStr)); @@ -611,7 +611,7 @@ bool CDatabase_File::Database_File_TimeDel() memset(tszSQLQuery, '\0', sizeof(tszSQLQuery)); _xstprintf(tszSQLQuery, _X("DROP TABLE `%s`"), pptszResult[0]); DataBase_MySQL_Execute(xhDBSQL, tszSQLQuery); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListFile, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListFile, nListCount); } } } diff --git a/XEngine_Source/StorageModule_Database/Database_Help/Database_Help.cpp b/XEngine_Source/StorageModule_Database/Database_Help/Database_Help.cpp index 7bcaef0..00370b9 100644 --- a/XEngine_Source/StorageModule_Database/Database_Help/Database_Help.cpp +++ b/XEngine_Source/StorageModule_Database/Database_Help/Database_Help.cpp @@ -43,12 +43,12 @@ bool CDatabase_Help::Database_Help_Insert(XCHAR* ptszSQLBuffer, XSTORAGECORE_DBF Database_IsErrorOccur = false; XCHAR tszTableName[64]; - XENGINE_LIBTIMER st_LibTimer; + XENGINE_LIBTIME st_LibTimer; memset(tszTableName, '\0', sizeof(tszTableName)); - memset(&st_LibTimer, '\0', sizeof(XENGINE_LIBTIMER)); + memset(&st_LibTimer, '\0', sizeof(XENGINE_LIBTIME)); //获得插入日期表 - BaseLib_OperatorTime_GetSysTime(&st_LibTimer); + BaseLib_Time_GetSysTime(&st_LibTimer); if (_tcsxlen(pSt_DBFile->tszTableName) > 0) { diff --git a/XEngine_Source/StorageModule_Database/Database_Memory/Database_Memory.cpp b/XEngine_Source/StorageModule_Database/Database_Memory/Database_Memory.cpp index d33d522..ad429b8 100644 --- a/XEngine_Source/StorageModule_Database/Database_Memory/Database_Memory.cpp +++ b/XEngine_Source/StorageModule_Database/Database_Memory/Database_Memory.cpp @@ -255,7 +255,7 @@ bool CDatabase_Memory::Database_Memory_FileQuery(XSTORAGECORE_DBFILE*** pppSt_Li if (bFound) { *pInt_ListCount = 1; - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_ListFile, 1, sizeof(XSTORAGECORE_DBFILE)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_ListFile, 1, sizeof(XSTORAGECORE_DBFILE)); *(*pppSt_ListFile)[0] = *stl_ListIterator; } @@ -298,15 +298,15 @@ bool CDatabase_Memory::Database_Memory_Flush() if (st_FileStatus.st_size > 0) { st_DBFile.st_ProtocolFile.nFileSize = st_FileStatus.st_size; - OPenSsl_Api_Digest(pptszListFile[i], tszHashStr, &nHashLen, true, m_nHashMode); - BaseLib_OperatorString_StrToHex((char*)tszHashStr, nHashLen, st_DBFile.st_ProtocolFile.tszFileHash); - BaseLib_OperatorString_GetFileAndPath(pptszListFile[i], st_DBFile.st_ProtocolFile.tszFilePath, st_DBFile.st_ProtocolFile.tszFileName); + Cryption_Api_Digest(pptszListFile[i], tszHashStr, &nHashLen, true, m_nHashMode); + BaseLib_String_StrToHex((char*)tszHashStr, nHashLen, st_DBFile.st_ProtocolFile.tszFileHash); + BaseLib_String_GetFileAndPath(pptszListFile[i], st_DBFile.st_ProtocolFile.tszFilePath, st_DBFile.st_ProtocolFile.tszFileName); _tcsxcpy(st_DBFile.tszBuckKey, stl_ListIterator->tszBuckKey); stl_ListFile.push_back(st_DBFile); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszListFile, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pptszListFile, nListCount); } st_Locker->unlock(); return true; diff --git a/XEngine_Source/StorageModule_Database/Makefile b/XEngine_Source/StorageModule_Database/Makefile index be77f67..6d8371d 100644 --- a/XEngine_Source/StorageModule_Database/Makefile +++ b/XEngine_Source/StorageModule_Database/Makefile @@ -8,7 +8,7 @@ RELEASE = 0 UNICODE = 0 LOADHDR = -I ./ -I ../XEngine_ThirdPart/jsoncpp LOADSO = -LIB = -lXEngine_BaseLib -lXEngine_OPenSsl -lHelpComponents_DataBase -lXEngine_SystemApi +LIB = -lXEngine_BaseLib -lXEngine_Cryption -lHelpComponents_DataBase -lXEngine_SystemApi LIBEX = OBJECTS = Database_File.o Database_Memory.o Database_Help.o pch.o diff --git a/XEngine_Source/StorageModule_Database/pch.h b/XEngine_Source/StorageModule_Database/pch.h index f5a05ef..d0a850e 100644 --- a/XEngine_Source/StorageModule_Database/pch.h +++ b/XEngine_Source/StorageModule_Database/pch.h @@ -39,13 +39,14 @@ using namespace std; #include #include #include -#include -#include +#include +#include #include #include #include #include #include +#include "../XStorage_BuildSwitch.h" #include "../XStorage_Protocol.h" #include "../StorageModule_Config/Config_Define.h" #include "../StorageModule_Config/Config_Error.h" @@ -67,7 +68,7 @@ extern XLONG Database_dwErrorCode; #ifdef _MSC_BUILD #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib") -#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl.lib") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption.lib") #pragma comment(lib,"XEngine_HelpComponents/HelpComponents_DataBase.lib") #pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi.lib") #endif diff --git a/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_StoragePacket.cpp b/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_StoragePacket.cpp index d5c1e6d..a7f31da 100644 --- a/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_StoragePacket.cpp +++ b/XEngine_Source/StorageModule_Protocol/Protocol_Packet/Protocol_StoragePacket.cpp @@ -583,11 +583,11 @@ bool CProtocol_StoragePacket::Protocol_StoragePacket_WDPropfind(XCHAR* ptszMsgBu { XCHAR tszFileName[MAX_PATH] = {}; SYSTEMAPI_FILE_ATTR st_FileAttr = {}; - BaseLib_OperatorString_GetFileAndPath((*ppptszListFile)[i], NULL, tszFileName); + BaseLib_String_GetFileAndPath((*ppptszListFile)[i], NULL, tszFileName); SystemApi_File_GetFileAttr((*ppptszListFile)[i], &st_FileAttr); XCHAR tszGMTTime[64] = {}; - BaseLib_OperatorTime_GMTTime(tszGMTTime, st_FileAttr.nModifyTime); + BaseLib_Time_GMTTime(tszGMTTime, st_FileAttr.nModifyTime); // 子元素 XMLElement* pSt_XMLResponse = m_XMLDocument.NewElement("d:response"); @@ -602,7 +602,7 @@ bool CProtocol_StoragePacket::Protocol_StoragePacket_WDPropfind(XCHAR* ptszMsgBu APIHelp_Api_UrlStr(tszDestStr, (*ppptszListFile)[i]); int nRLen = 0; - BaseLib_OperatorString_Replace(tszFileAlis, &nRLen, lpszBucketPath + 2, lpszBucketKey, true); + BaseLib_String_Replace(tszFileAlis, &nRLen, lpszBucketPath + 2, lpszBucketKey, true); XMLElement* pSt_XMLhref = m_XMLDocument.NewElement("d:href"); pSt_XMLhref->SetText(tszFileAlis); pSt_XMLResponse->InsertEndChild(pSt_XMLhref); diff --git a/XEngine_Source/StorageModule_Protocol/Protocol_Parse/Protocol_StorageParse.cpp b/XEngine_Source/StorageModule_Protocol/Protocol_Parse/Protocol_StorageParse.cpp index a93ef1b..59d0a38 100644 --- a/XEngine_Source/StorageModule_Protocol/Protocol_Parse/Protocol_StorageParse.cpp +++ b/XEngine_Source/StorageModule_Protocol/Protocol_Parse/Protocol_StorageParse.cpp @@ -196,7 +196,7 @@ bool CProtocol_StorageParse::Protocol_StorageParse_ReportFile(LPCXSTR lpszMsgBuf int nCount = st_JsonRoot["Count"].asInt(); Json::Value st_JsonArray = st_JsonRoot["List"]; - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_DBFile, nCount, sizeof(XSTORAGECORE_DBFILE)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_DBFile, nCount, sizeof(XSTORAGECORE_DBFILE)); for (int i = 0; i < nCount; i++) { if (st_JsonArray[i]["nFileSize"].isNull()) diff --git a/XEngine_Source/StorageModule_Session/Makefile b/XEngine_Source/StorageModule_Session/Makefile index dbd3e63..a2a0fcf 100644 --- a/XEngine_Source/StorageModule_Session/Makefile +++ b/XEngine_Source/StorageModule_Session/Makefile @@ -8,7 +8,7 @@ RELEASE = 0 UNICODE = 0 LOADHDR = -I ./ LOADSO = -LIB = -lXEngine_BaseLib +LIB = -lXEngine_BaseLib -lNetHelp_APIAddr LIBEX = OBJECTS = Session_DLStroage.o Session_UPStroage.o Session_Action.o Session_Webdav.o pch.o diff --git a/XEngine_Source/StorageModule_Session/Session_Action/Session_Action.cpp b/XEngine_Source/StorageModule_Session/Session_Action/Session_Action.cpp index 31dcacc..130ec46 100644 --- a/XEngine_Source/StorageModule_Session/Session_Action/Session_Action.cpp +++ b/XEngine_Source/StorageModule_Session/Session_Action/Session_Action.cpp @@ -158,7 +158,7 @@ bool CSession_Action::Session_Action_GetAll(XNETHANDLE*** pppxhToken, int* pInt_ st_Locker.lock_shared(); *pInt_ListCount = stl_MapAction.size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppxhToken, *pInt_ListCount, sizeof(XNETHANDLE)); + BaseLib_Memory_Malloc((XPPPMEM)pppxhToken, *pInt_ListCount, sizeof(XNETHANDLE)); unordered_map::iterator stl_MapIterator = stl_MapAction.begin(); for (int i = 0; stl_MapIterator != stl_MapAction.end(); stl_MapIterator++, i++) diff --git a/XEngine_Source/StorageModule_Session/Session_Stroage/Session_DLStroage.cpp b/XEngine_Source/StorageModule_Session/Session_Stroage/Session_DLStroage.cpp index a5ccea5..957c9c5 100644 --- a/XEngine_Source/StorageModule_Session/Session_Stroage/Session_DLStroage.cpp +++ b/XEngine_Source/StorageModule_Session/Session_Stroage/Session_DLStroage.cpp @@ -400,7 +400,7 @@ bool CSession_DLStroage::Session_DLStorage_GetAll(SESSION_STORAGEINFO*** pppSt_S st_Locker.lock_shared(); *pInt_ListCount = stl_MapStroage.size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_StorageInfo, *pInt_ListCount, sizeof(SESSION_STORAGEINFO)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_StorageInfo, *pInt_ListCount, sizeof(SESSION_STORAGEINFO)); unordered_map::iterator stl_MapIterator = stl_MapStroage.begin(); for (int i = 0; stl_MapIterator != stl_MapStroage.end(); stl_MapIterator++, i++) @@ -475,8 +475,8 @@ bool CSession_DLStroage::Session_DLStroage_MaxConnect(LPCXSTR lpszClientAddr) _tcsxcpy(tszIPSource, stl_MapIterator->first.c_str()); _tcsxcpy(tszIPDest, lpszClientAddr); - BaseLib_OperatorIPAddr_SegAddr(tszIPSource); - BaseLib_OperatorIPAddr_SegAddr(tszIPDest); + APIAddr_IPAddr_SegAddr(tszIPSource); + APIAddr_IPAddr_SegAddr(tszIPDest); if (0 == _tcsxcmp(tszIPSource, tszIPDest)) { diff --git a/XEngine_Source/StorageModule_Session/Session_Stroage/Session_UPStroage.cpp b/XEngine_Source/StorageModule_Session/Session_Stroage/Session_UPStroage.cpp index b96e984..595601a 100644 --- a/XEngine_Source/StorageModule_Session/Session_Stroage/Session_UPStroage.cpp +++ b/XEngine_Source/StorageModule_Session/Session_Stroage/Session_UPStroage.cpp @@ -409,7 +409,7 @@ bool CSession_UPStroage::Session_UPStorage_GetAll(SESSION_STORAGEINFO*** pppSt_S st_Locker.lock_shared(); *pInt_ListCount = stl_MapStroage.size(); - BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_StorageInfo, *pInt_ListCount, sizeof(SESSION_STORAGEINFO)); + BaseLib_Memory_Malloc((XPPPMEM)pppSt_StorageInfo, *pInt_ListCount, sizeof(SESSION_STORAGEINFO)); unordered_map::iterator stl_MapIterator = stl_MapStroage.begin(); for (int i = 0; stl_MapIterator != stl_MapStroage.end(); stl_MapIterator++, i++) { @@ -524,8 +524,8 @@ bool CSession_UPStroage::Session_UPStroage_MaxConnect(LPCXSTR lpszClientAddr) _tcsxcpy(tszIPSource, stl_MapIterator->first.c_str()); _tcsxcpy(tszIPDest, lpszClientAddr); - BaseLib_OperatorIPAddr_SegAddr(tszIPSource); - BaseLib_OperatorIPAddr_SegAddr(tszIPDest); + APIAddr_IPAddr_SegAddr(tszIPSource); + APIAddr_IPAddr_SegAddr(tszIPDest); if (0 == _tcsxcmp(tszIPSource, tszIPDest)) { diff --git a/XEngine_Source/StorageModule_Session/Session_Webdav/Session_Webdav.cpp b/XEngine_Source/StorageModule_Session/Session_Webdav/Session_Webdav.cpp index 120b49b..c2ed22a 100644 --- a/XEngine_Source/StorageModule_Session/Session_Webdav/Session_Webdav.cpp +++ b/XEngine_Source/StorageModule_Session/Session_Webdav/Session_Webdav.cpp @@ -51,7 +51,7 @@ bool CSession_Webdav::Session_Webdav_Insert(LPCXSTR lpszFileName, XENGINE_WEBDAV _xstprintf(pSt_WDLocker->tszTimeout, _X("Second-%d"), nTimeout); int nRet = _xstprintf(pSt_WDLocker->tszToken, _X("opaquelocktoken:")); - BaseLib_OperatorHandle_CreateGuid(pSt_WDLocker->tszToken + nRet); + BaseLib_Handle_CreateGuid(pSt_WDLocker->tszToken + nRet); st_WDSession.nTimeStart = time(NULL); st_WDSession.st_WDLocker = *pSt_WDLocker; diff --git a/XEngine_Source/StorageModule_Session/pch.h b/XEngine_Source/StorageModule_Session/pch.h index dc4e820..4f672e1 100644 --- a/XEngine_Source/StorageModule_Session/pch.h +++ b/XEngine_Source/StorageModule_Session/pch.h @@ -34,6 +34,8 @@ using namespace std; #include #include #include +#include +#include #include "../XStorage_Protocol.h" #include "Session_Define.h" #include "Session_Error.h" @@ -53,4 +55,5 @@ extern XLONG Session_dwErrorCode; #ifdef _MSC_BUILD #pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib.lib") +#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIAddr.lib") #endif \ No newline at end of file diff --git a/XEngine_Source/VSCopy_Debug.bat b/XEngine_Source/VSCopy_Debug.bat index 27281f5..ea088ad 100644 --- a/XEngine_Source/VSCopy_Debug.bat +++ b/XEngine_Source/VSCopy_Debug.bat @@ -3,10 +3,11 @@ copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_BaseSafe.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Algorithm.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Core.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_ManagePool.dll" "./" -copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_OPenSsl.dll" "./" +copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Cryption.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_SystemApi.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_APIHelp.dll" "./" +copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIAddr.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\HelpComponents_DataBase.dll" "./" copy /y "D:\XEngine\XEngine_SourceCode\Debug\HelpComponents_XLog.dll" "./" diff --git a/XEngine_Source/VSCopy_x64.bat b/XEngine_Source/VSCopy_x64.bat index b2c156c..f8b22f9 100644 --- a/XEngine_Source/VSCopy_x64.bat +++ b/XEngine_Source/VSCopy_x64.bat @@ -3,10 +3,11 @@ copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_BaseSafe.dll" "./" copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_Algorithm.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_Core.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_ManagePool.dll" "./" -copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_OPenSsl.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_Cryption.dll" "./" copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" copy /y "%XEngine_Lib64%\XEngine_Client\XClient_APIHelp.dll" "./" +copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIAddr.dll" "./" copy /y "%XEngine_Lib64%\XEngine_HelpComponents\HelpComponents_DataBase.dll" "./" copy /y "%XEngine_Lib64%\XEngine_HelpComponents\HelpComponents_XLog.dll" "./" diff --git a/XEngine_Source/VSCopy_x86.bat b/XEngine_Source/VSCopy_x86.bat index e808b70..19f2580 100644 --- a/XEngine_Source/VSCopy_x86.bat +++ b/XEngine_Source/VSCopy_x86.bat @@ -3,10 +3,11 @@ copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_BaseSafe.dll" "./" copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_Algorithm.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Core.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_ManagePool.dll" "./" -copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_OPenSsl.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Cryption.dll" "./" copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./" copy /y "%XEngine_Lib32%\XEngine_Client\XClient_APIHelp.dll" "./" +copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIAddr.dll" "./" copy /y "%XEngine_Lib32%\XEngine_HelpComponents\HelpComponents_DataBase.dll" "./" copy /y "%XEngine_Lib32%\XEngine_HelpComponents\HelpComponents_XLog.dll" "./" diff --git a/XEngine_Source/XEngine_Depend b/XEngine_Source/XEngine_Depend index d1d1ee7..75fd03e 160000 --- a/XEngine_Source/XEngine_Depend +++ b/XEngine_Source/XEngine_Depend @@ -1 +1 @@ -Subproject commit d1d1ee7952a0a93a1beb183a8dee281d9231ff3d +Subproject commit 75fd03e24e5e3af433fec1ba7f40dcbcd64ff721 diff --git a/XEngine_Source/XEngine_StorageApp/Makefile b/XEngine_Source/XEngine_StorageApp/Makefile index 14c29cb..b1cdc46 100644 --- a/XEngine_Source/XEngine_StorageApp/Makefile +++ b/XEngine_Source/XEngine_StorageApp/Makefile @@ -7,7 +7,7 @@ UNICODE = 0 LOADHDR = -I ./ LOADSO = -L ../XEngine_Depend/XEngine_Module/jsoncpp -L ../XEngine_Depend/XEngine_Module/tinyxml2 -L ../XEngine_Depend/XEngine_Module/XEngine_InfoReport \ -L ../StorageModule_Database -L ../StorageModule_Config -L ../StorageModule_Session -L ../StorageModule_APIHelp -L ../StorageModule_Protocol -L ../StorageModule_BTorrent -LIB = -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -lXEngine_OPenSsl -lXClient_APIHelp -lXEngine_ProcFile -lXEngine_SystemApi -lHelpComponents_XLog -lHelpComponents_Packets -lRfcComponents_HttpProtocol \ +LIB = -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -lXEngine_Cryption -lXClient_APIHelp -lXEngine_ProcFile -lXEngine_SystemApi -lHelpComponents_XLog -lHelpComponents_Packets -lRfcComponents_HttpProtocol \ -lStorageModule_Database -lStorageModule_Config -lStorageModule_Session -lStorageModule_APIHelp -lStorageModule_Protocol -lStorageModule_BTorrent \ -ljsoncpp -ltinyxml2 -lXEngine_InfoReport LIBEX = diff --git a/XEngine_Source/XEngine_StorageApp/StorageApp_Center.cpp b/XEngine_Source/XEngine_StorageApp/StorageApp_Center.cpp index ef86845..db6d0a9 100644 --- a/XEngine_Source/XEngine_StorageApp/StorageApp_Center.cpp +++ b/XEngine_Source/XEngine_StorageApp/StorageApp_Center.cpp @@ -30,11 +30,11 @@ XHTHREAD CALLBACK XEngine_Center_HTTPThread(XPVOID lParam) { XEngine_Task_HttpCenter(ppSt_PKTClient[i]->tszClientAddr, ptszMsgBuffer, nMsgLen, &st_HTTPParam, ppszListHdr, nHdrCount); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppszListHdr, nHdrCount); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_Free((XPPPMEM)&ppszListHdr, nHdrCount); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_PKTClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_PKTClient, nListCount); } } return 0; @@ -91,7 +91,7 @@ bool XEngine_Task_HttpCenter(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPCENTER); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("业务客户端:%s,用户验证失败,用户名:%s,密码:%s,错误码:%d,错误内容:%s"), tszUserName, tszUserPass, tszUserPass, nResponseCode, ptszBody); } - BaseLib_OperatorMemory_FreeCStyle((VOID**)&ptszBody); + BaseLib_Memory_FreeCStyle((VOID**)&ptszBody); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("业务客户端:%s,代理服务:%s 验证通过,用户名:%s,密码:%s"), lpszClientAddr, st_ServiceCfg.st_XProxy.tszAuthPass, tszUserName, tszUserPass); st_HDRParam.bAuth = true; } diff --git a/XEngine_Source/XEngine_StorageApp/StorageApp_Download.cpp b/XEngine_Source/XEngine_StorageApp/StorageApp_Download.cpp index c902410..c8f4d3d 100644 --- a/XEngine_Source/XEngine_StorageApp/StorageApp_Download.cpp +++ b/XEngine_Source/XEngine_StorageApp/StorageApp_Download.cpp @@ -30,11 +30,11 @@ XHTHREAD CALLBACK XEngine_Download_HTTPThread(XPVOID lParam) { XEngine_Task_HttpDownload(ppSt_PKTClient[i]->tszClientAddr, ptszMsgBuffer, nMsgLen, &st_HTTPParam, ppszListHdr, nHdrCount); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppszListHdr, nHdrCount); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_Free((XPPPMEM)&ppszListHdr, nHdrCount); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_PKTClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_PKTClient, nListCount); } } return 0; @@ -191,7 +191,7 @@ bool XEngine_Task_HttpDownload(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("下载客户端:%s,用户验证失败,用户名:%s,密码:%s,错误码:%d,错误内容:%s"), tszUserName, tszUserPass, tszUserPass, nResponseCode, ptszBody); } Protocol_StorageParse_SpeedLimit(ptszBody, nSDLen, &nCode, &nLimit); - BaseLib_OperatorMemory_FreeCStyle((VOID**)&ptszBody); + BaseLib_Memory_FreeCStyle((VOID**)&ptszBody); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("下载客户端:%s,代理服务:%s 验证通过,用户名:%s,密码:%s,值:%d"), lpszClientAddr, st_ServiceCfg.st_XProxy.tszAuthPass, tszUserName, tszUserPass, nCode); st_HDRParam.bAuth = true; } @@ -260,8 +260,8 @@ bool XEngine_Task_HttpDownload(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in } int nPathType = 0; _xstprintf(tszFileDir, _X("%s%s"), st_StorageBucket.tszFilePath, st_StorageBucket.tszFileName); - BaseLib_OperatorString_GetPath(tszFileDir, &nPathType); - BaseLib_OperatorString_FixPath(tszFileDir, nPathType); + BaseLib_String_GetPath(tszFileDir, &nPathType); + BaseLib_String_FixPath(tszFileDir, nPathType); int nHashLen = 0; XBYTE tszHashKey[MAX_PATH]; @@ -271,9 +271,9 @@ bool XEngine_Task_HttpDownload(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in memset(tszFieldStr, '\0', MAX_PATH); memset(tszHashStr, '\0', sizeof(tszHashStr)); //得到文件HASH - OPenSsl_Api_Digest(tszFileDir, tszHashKey, &nHashLen, true, st_ServiceCfg.st_XStorage.nHashMode); - BaseLib_OperatorString_StrToHex((char*)tszHashKey, nHashLen, tszHashStr); - BaseLib_OperatorString_GetFileAndPath(tszFileDir, NULL, NULL, NULL, st_HDRParam.tszMimeType); + Cryption_Api_Digest(tszFileDir, tszHashKey, &nHashLen, true, st_ServiceCfg.st_XStorage.nHashMode); + BaseLib_String_StrToHex((char*)tszHashKey, nHashLen, tszHashStr); + BaseLib_String_GetFileAndPath(tszFileDir, NULL, NULL, NULL, st_HDRParam.tszMimeType); if (nLimit > 0) { xhLimit = Algorithm_Calculation_Create(); diff --git a/XEngine_Source/XEngine_StorageApp/StorageApp_Hdr.h b/XEngine_Source/XEngine_StorageApp/StorageApp_Hdr.h index 4c8d5ad..48142a1 100644 --- a/XEngine_Source/XEngine_StorageApp/StorageApp_Hdr.h +++ b/XEngine_Source/XEngine_StorageApp/StorageApp_Hdr.h @@ -34,8 +34,8 @@ using namespace std; #include #include #include -#include -#include +#include +#include #include #include #include @@ -129,7 +129,7 @@ extern XENGINE_LBCONFIG st_LoadbalanceCfg; #pragma comment(lib,"XEngine_BaseLib/XEngine_Algorithm.lib") #pragma comment(lib,"XEngine_Core/XEngine_Core.lib") #pragma comment(lib,"XEngine_Core/XEngine_ManagePool.lib") -#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl.lib") +#pragma comment(lib,"XEngine_Core/XEngine_Cryption.lib") #pragma comment(lib,"XEngine_Client/XClient_APIHelp.lib") #pragma comment(lib,"XEngine_HelpComponents/HelpComponents_XLog.lib") #pragma comment(lib,"XEngine_HelpComponents/HelpComponents_Packets.lib") diff --git a/XEngine_Source/XEngine_StorageApp/StorageApp_Network.cpp b/XEngine_Source/XEngine_StorageApp/StorageApp_Network.cpp index 4e383b4..2f9237e 100644 --- a/XEngine_Source/XEngine_StorageApp/StorageApp_Network.cpp +++ b/XEngine_Source/XEngine_StorageApp/StorageApp_Network.cpp @@ -4,7 +4,7 @@ bool CALLBACK XEngine_Callback_DownloadLogin(LPCXSTR lpszClientAddr, XSOCKET hSo { if (st_ServiceCfg.st_XCert.bDLEnable) { - OPenSsl_Server_AcceptEx(xhDLSsl, hSocket, lpszClientAddr); + Cryption_Server_AcceptEx(xhDLSsl, hSocket, lpszClientAddr); } HttpProtocol_Server_CreateClientEx(xhDLHttp, lpszClientAddr, 0); SocketOpt_HeartBeat_InsertAddrEx(xhHBDownload, lpszClientAddr); @@ -17,13 +17,13 @@ void CALLBACK XEngine_Callback_DownloadRecv(LPCXSTR lpszClientAddr, XSOCKET hSoc { int nSLen = 0; XCHAR* ptszMsgBuffer = NULL; - OPenSsl_Server_RecvMemoryEx(xhDLSsl, lpszClientAddr, &ptszMsgBuffer, &nSLen, lpszRecvMsg, nMsgLen); + Cryption_Server_RecvMemoryEx(xhDLSsl, lpszClientAddr, &ptszMsgBuffer, &nSLen, lpszRecvMsg, nMsgLen); if (!HttpProtocol_Server_InserQueueEx(xhDLHttp, lpszClientAddr, ptszMsgBuffer, nSLen)) { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("下载客户端:%s,投递数据失败,大小:%d,错误;%lX"), lpszClientAddr, nMsgLen, HttpProtocol_GetLastError()); return; } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { @@ -45,7 +45,7 @@ bool CALLBACK XEngine_Callback_UPLoaderLogin(LPCXSTR lpszClientAddr, XSOCKET hSo { if (st_ServiceCfg.st_XCert.bUPEnable) { - OPenSsl_Server_AcceptEx(xhUPSsl, hSocket, lpszClientAddr); + Cryption_Server_AcceptEx(xhUPSsl, hSocket, lpszClientAddr); } HttpProtocol_Server_CreateClientEx(xhUPHttp, lpszClientAddr, 0); HttpProtocol_Server_SetRecvModeEx(xhUPHttp, lpszClientAddr, 1); //设置为文件接受模式 @@ -59,13 +59,13 @@ void CALLBACK XEngine_Callback_UPLoaderRecv(LPCXSTR lpszClientAddr, XSOCKET hSoc { int nSLen = 0; XCHAR* ptszMsgBuffer = NULL; - OPenSsl_Server_RecvMemoryEx(xhUPSsl, lpszClientAddr, &ptszMsgBuffer, &nSLen, lpszRecvMsg, nMsgLen); + Cryption_Server_RecvMemoryEx(xhUPSsl, lpszClientAddr, &ptszMsgBuffer, &nSLen, lpszRecvMsg, nMsgLen); if (!HttpProtocol_Server_InserQueueEx(xhUPHttp, lpszClientAddr, ptszMsgBuffer, nSLen)) { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("上传客户端:%s,投递数据失败,大小:%d,错误;%lX"), lpszClientAddr, nMsgLen, HttpProtocol_GetLastError()); return; } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { @@ -87,7 +87,7 @@ bool CALLBACK XEngine_Callback_CenterLogin(LPCXSTR lpszClientAddr, XSOCKET hSock { if (st_ServiceCfg.st_XCert.bCHEnable) { - OPenSsl_Server_AcceptEx(xhCHSsl, hSocket, lpszClientAddr); + Cryption_Server_AcceptEx(xhCHSsl, hSocket, lpszClientAddr); } HttpProtocol_Server_CreateClientEx(xhCenterHttp, lpszClientAddr, 0); SocketOpt_HeartBeat_InsertAddrEx(xhHBCenter, lpszClientAddr); @@ -100,13 +100,13 @@ void CALLBACK XEngine_Callback_CenterRecv(LPCXSTR lpszClientAddr, XSOCKET hSocke { int nSLen = 0; XCHAR* ptszMsgBuffer = NULL; - OPenSsl_Server_RecvMemoryEx(xhCHSsl, lpszClientAddr, &ptszMsgBuffer, &nSLen, lpszRecvMsg, nMsgLen); + Cryption_Server_RecvMemoryEx(xhCHSsl, lpszClientAddr, &ptszMsgBuffer, &nSLen, lpszRecvMsg, nMsgLen); if (!HttpProtocol_Server_InserQueueEx(xhCenterHttp, lpszClientAddr, ptszMsgBuffer, nSLen)) { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("业务客户端:%s,投递数据失败,大小:%d,错误;%lX"), lpszClientAddr, nMsgLen, HttpProtocol_GetLastError()); return; } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { @@ -128,7 +128,7 @@ bool CALLBACK XEngine_Callback_WebdavLogin(LPCXSTR lpszClientAddr, XSOCKET hSock { if (st_ServiceCfg.st_XCert.bWDEnable) { - OPenSsl_Server_AcceptEx(xhWDSsl, hSocket, lpszClientAddr); + Cryption_Server_AcceptEx(xhWDSsl, hSocket, lpszClientAddr); } HttpProtocol_Server_CreateClientEx(xhWebdavHttp, lpszClientAddr, 0); SocketOpt_HeartBeat_InsertAddrEx(xhHBWebdav, lpszClientAddr); @@ -141,13 +141,13 @@ void CALLBACK XEngine_Callback_WebdavRecv(LPCXSTR lpszClientAddr, XSOCKET hSocke { int nSLen = 0; XCHAR* ptszMsgBuffer = NULL; - OPenSsl_Server_RecvMemoryEx(xhWDSsl, lpszClientAddr, &ptszMsgBuffer, &nSLen, lpszRecvMsg, nMsgLen); + Cryption_Server_RecvMemoryEx(xhWDSsl, lpszClientAddr, &ptszMsgBuffer, &nSLen, lpszRecvMsg, nMsgLen); if (!HttpProtocol_Server_InserQueueEx(xhWebdavHttp, lpszClientAddr, ptszMsgBuffer, nSLen)) { XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("WEBDAV客户端:%s,投递数据失败,大小:%d,错误;%lX"), lpszClientAddr, nMsgLen, HttpProtocol_GetLastError()); return; } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { @@ -210,7 +210,7 @@ bool XEngine_Net_CloseClient(LPCXSTR lpszClientAddr, int nLeaveType, int nClient Algorithm_Calculation_Close(Session_UPStroage_GetSpeed(lpszClientAddr)); Session_UPStroage_Delete(lpszClientAddr); HttpProtocol_Server_CloseClinetEx(xhUPHttp, lpszClientAddr); - OPenSsl_Server_CloseClientEx(xhUPSsl, lpszClientAddr); + Cryption_Server_CloseClientEx(xhUPSsl, lpszClientAddr); } else if (STORAGE_NETTYPE_HTTPDOWNLOAD == nClientType) { @@ -241,7 +241,7 @@ bool XEngine_Net_CloseClient(LPCXSTR lpszClientAddr, int nLeaveType, int nClient } HttpProtocol_Server_CloseClinetEx(xhDLHttp, lpszClientAddr); - OPenSsl_Server_CloseClientEx(xhDLSsl, lpszClientAddr); + Cryption_Server_CloseClientEx(xhDLSsl, lpszClientAddr); } else if (STORAGE_NETTYPE_HTTPCENTER == nClientType) { @@ -264,7 +264,7 @@ bool XEngine_Net_CloseClient(LPCXSTR lpszClientAddr, int nLeaveType, int nClient SocketOpt_HeartBeat_DeleteAddrEx(xhHBCenter, lpszClientAddr); } HttpProtocol_Server_CloseClinetEx(xhCenterHttp, lpszClientAddr); - OPenSsl_Server_CloseClientEx(xhCHSsl, lpszClientAddr); + Cryption_Server_CloseClientEx(xhCHSsl, lpszClientAddr); } else if (STORAGE_NETTYPE_HTTPWEBDAV == nClientType) { @@ -287,7 +287,7 @@ bool XEngine_Net_CloseClient(LPCXSTR lpszClientAddr, int nLeaveType, int nClient SocketOpt_HeartBeat_DeleteAddrEx(xhHBWebdav, lpszClientAddr); } HttpProtocol_Server_CloseClinetEx(xhWebdavHttp, lpszClientAddr); - OPenSsl_Server_CloseClientEx(xhWDSsl, lpszClientAddr); + Cryption_Server_CloseClientEx(xhWDSsl, lpszClientAddr); } XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("%s:%s,与服务器断开,原因:%s"), m_StrClient.c_str(), lpszClientAddr, m_StrLeaveMsg.c_str()); return true; @@ -304,9 +304,9 @@ bool XEngine_Net_SendMsg(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsg int nSLen = 0; XCHAR *ptszMsgBuffer = NULL; - OPenSsl_Server_SendMemoryEx(xhDLSsl, lpszClientAddr, lpszMsgBuffer, nMsgLen, &ptszMsgBuffer, &nSLen); + Cryption_Server_SendMemoryEx(xhDLSsl, lpszClientAddr, lpszMsgBuffer, nMsgLen, &ptszMsgBuffer, &nSLen); bRet = NetCore_TCPXCore_SendEx(xhNetDownload, lpszClientAddr, ptszMsgBuffer, nSLen); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { @@ -324,9 +324,9 @@ bool XEngine_Net_SendMsg(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsg int nSLen = 0; XCHAR* ptszMsgBuffer = NULL; - OPenSsl_Server_SendMemoryEx(xhUPSsl, lpszClientAddr, lpszMsgBuffer, nMsgLen, &ptszMsgBuffer, &nSLen); + Cryption_Server_SendMemoryEx(xhUPSsl, lpszClientAddr, lpszMsgBuffer, nMsgLen, &ptszMsgBuffer, &nSLen); bRet = NetCore_TCPXCore_SendEx(xhNetUPLoader, lpszClientAddr, ptszMsgBuffer, nSLen); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { @@ -344,9 +344,9 @@ bool XEngine_Net_SendMsg(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsg int nSLen = 0; XCHAR* ptszMsgBuffer = NULL; - OPenSsl_Server_SendMemoryEx(xhCHSsl, lpszClientAddr, lpszMsgBuffer, nMsgLen, &ptszMsgBuffer, &nSLen); + Cryption_Server_SendMemoryEx(xhCHSsl, lpszClientAddr, lpszMsgBuffer, nMsgLen, &ptszMsgBuffer, &nSLen); bRet = NetCore_TCPXCore_SendEx(xhNetCenter, lpszClientAddr, ptszMsgBuffer, nSLen); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { @@ -364,9 +364,9 @@ bool XEngine_Net_SendMsg(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsg int nSLen = 0; XCHAR* ptszMsgBuffer = NULL; - OPenSsl_Server_SendMemoryEx(xhWDSsl, lpszClientAddr, lpszMsgBuffer, nMsgLen, &ptszMsgBuffer, &nSLen); + Cryption_Server_SendMemoryEx(xhWDSsl, lpszClientAddr, lpszMsgBuffer, nMsgLen, &ptszMsgBuffer, &nSLen); bRet = NetCore_TCPXCore_SendEx(xhNetWebdav, lpszClientAddr, ptszMsgBuffer, nSLen); - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); } else { diff --git a/XEngine_Source/XEngine_StorageApp/StorageApp_UPLoader.cpp b/XEngine_Source/XEngine_StorageApp/StorageApp_UPLoader.cpp index daa5b4c..a53c9e9 100644 --- a/XEngine_Source/XEngine_StorageApp/StorageApp_UPLoader.cpp +++ b/XEngine_Source/XEngine_StorageApp/StorageApp_UPLoader.cpp @@ -30,11 +30,11 @@ XHTHREAD CALLBACK XEngine_UPLoader_HTTPThread(XPVOID lParam) { XEngine_Task_HttpUPLoader(ppSt_PKTClient[i]->tszClientAddr, ptszMsgBuffer, nMsgLen, &st_HTTPParam, ppszListHdr, nHdrCount); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppszListHdr, nHdrCount); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_Free((XPPPMEM)&ppszListHdr, nHdrCount); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_PKTClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_PKTClient, nListCount); } } return 0; @@ -128,7 +128,7 @@ bool XEngine_Task_HttpUPLoader(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("上传客户端:%s,用户验证失败,用户名:%s,密码:%s,错误码:%d,错误内容:%s"), tszUserName, tszUserPass, tszUserPass, nResponseCode, ptszBody); } Protocol_StorageParse_SpeedLimit(ptszBody, nSDLen, &nCode, &nLimit); - BaseLib_OperatorMemory_FreeCStyle((VOID**)&ptszBody); + BaseLib_Memory_FreeCStyle((VOID**)&ptszBody); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("上传客户端:%s,代理服务:%s 验证通过,用户名:%s,密码:%s"), lpszClientAddr, st_ServiceCfg.st_XProxy.tszAuthPass, tszUserName, tszUserPass); st_HDRParam.bAuth = true; } @@ -169,7 +169,7 @@ bool XEngine_Task_HttpUPLoader(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in st_HDRParam.nHttpCode = 413; HttpProtocol_Server_SendMsgEx(xhUPHttp, tszSDBuffer, &nSDLen, &st_HDRParam); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPUPLOADER); - BaseLib_OperatorMemory_Free((XPPPMEM)&pptszParamList, nParamCount); + BaseLib_Memory_Free((XPPPMEM)&pptszParamList, nParamCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("上传客户端:%s,请求上传文件失败,提供的参数:%s 不正确,错误:%lX"), lpszClientAddr, pSt_HTTPParam->tszHttpUri, HttpProtocol_GetLastError()); return false; } @@ -205,8 +205,8 @@ bool XEngine_Task_HttpUPLoader(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in //修正文件路径 int nPathType = 0; _xstprintf(tszFileDir, _X("%s/%s"), st_StorageBucket.tszFilePath, tszFileName); - BaseLib_OperatorString_GetPath(tszFileDir, &nPathType); - BaseLib_OperatorString_FixPath(tszFileDir, nPathType); + BaseLib_String_GetPath(tszFileDir, &nPathType); + BaseLib_String_FixPath(tszFileDir, nPathType); //得到上传大小 XCHAR tszVluStr[8] = {}; if (HttpProtocol_ServerHelp_GetField(&pptszListHdr, nHdrCount, _X("Content-Length"), tszVluStr)) @@ -290,7 +290,7 @@ bool XEngine_Task_HttpUPLoader(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in XCHAR tszTmpPath[MAX_PATH]; memset(tszTmpPath, '\0', MAX_PATH); - BaseLib_OperatorString_GetFileAndPath(tszFileDir, tszTmpPath); + BaseLib_String_GetFileAndPath(tszFileDir, tszTmpPath); if (0 != _xtaccess(tszTmpPath, 0)) { //不存在,是否允许创建? @@ -427,8 +427,8 @@ bool XEngine_Task_HttpUPLoader(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, in st_ProtocolFile.st_ProtocolFile.nFileSize = st_StorageInfo.ullRWLen; //上传完毕需要关闭,否则计算HASH会不正常 Session_UPStroage_Close(lpszClientAddr); - OPenSsl_Api_Digest(tszFileDir, tszHashStr, &nHashLen, true, st_ServiceCfg.st_XStorage.nHashMode); - BaseLib_OperatorString_StrToHex((char*)tszHashStr, nHashLen, st_ProtocolFile.st_ProtocolFile.tszFileHash); + Cryption_Api_Digest(tszFileDir, tszHashStr, &nHashLen, true, st_ServiceCfg.st_XStorage.nHashMode); + BaseLib_String_StrToHex((char*)tszHashStr, nHashLen, st_ProtocolFile.st_ProtocolFile.tszFileHash); //处理结果 if (st_ServiceCfg.st_XStorage.bUPHash) { diff --git a/XEngine_Source/XEngine_StorageApp/StorageApp_Webdav.cpp b/XEngine_Source/XEngine_StorageApp/StorageApp_Webdav.cpp index 8f99701..1aff403 100644 --- a/XEngine_Source/XEngine_StorageApp/StorageApp_Webdav.cpp +++ b/XEngine_Source/XEngine_StorageApp/StorageApp_Webdav.cpp @@ -30,11 +30,11 @@ XHTHREAD CALLBACK XEngine_Webdav_HTTPThread(XPVOID lParam) { XEngine_Task_HttpWebdav(ppSt_PKTClient[i]->tszClientAddr, ptszMsgBuffer, nMsgLen, &st_HTTPParam, ppszListHdr, nHdrCount); } - BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppszListHdr, nHdrCount); + BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer); + BaseLib_Memory_Free((XPPPMEM)&ppszListHdr, nHdrCount); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_PKTClient, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_PKTClient, nListCount); } } return 0; @@ -56,6 +56,7 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int LPCXSTR lpszMethodDel = _X("DELETE"); LPCXSTR lpszMethodLock = _X("LOCK"); LPCXSTR lpszMethodUNLock = _X("UNLOCK"); + LPCXSTR lpszMethodMKCol = _X("MKCOL"); st_HDRParam.bIsClose = false; st_HDRParam.nHttpCode = 200; @@ -65,7 +66,7 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int //用于心跳 st_HDRParam.bIsClose = true; st_HDRParam.nHttpCode = 200; - LPCXSTR lpszHdrBuffer = _X("Allow: OPTIONS POST GET PUT PROPFIND PROPPATCH DELETE LOCK UNLOCK\r\n"); + LPCXSTR lpszHdrBuffer = _X("Allow: OPTIONS POST GET PUT PROPFIND PROPPATCH DELETE LOCK UNLOCK MKCOL\r\n"); HttpProtocol_Server_SendMsgEx(xhWebdavHttp, tszSDBuffer, &nSDLen, &st_HDRParam, NULL, 0, lpszHdrBuffer); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPWEBDAV); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("WEBDAV客户端:%s,请求OPTIONS心跳方法成功"), lpszClientAddr); @@ -99,10 +100,10 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int { int nALen = 0; _tcsxcpy(tszFindStr, pSt_HTTPParam->tszHttpUri + 1); - BaseLib_OperatorString_Replace(tszFindStr, &nALen, st_StorageBucket.tszBuckKey, st_StorageBucket.tszFilePath, true); + BaseLib_String_Replace(tszFindStr, &nALen, st_StorageBucket.tszBuckKey, st_StorageBucket.tszFilePath, true); //如果是文件 nListCount = 1; - BaseLib_OperatorMemory_Malloc((XPPPMEM)&pptszListFile, nListCount, MAX_PATH); + BaseLib_Memory_Malloc((XPPPMEM)&pptszListFile, nListCount, MAX_PATH); _tcsxcpy(pptszListFile[0], tszFindStr); } else @@ -135,7 +136,6 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int HttpProtocol_Server_SendMsgEx(xhWebdavHttp, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPWEBDAV); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("WEBDAV客户端:%s,处理WEBDAV协议PROPFIND方法成功,文件名称:%s"), lpszClientAddr, tszFindStr); - return false; } else if (0 == _tcsxnicmp(lpszMethodGet, pSt_HTTPParam->tszHttpMethod, _tcsxlen(lpszMethodGet))) { @@ -143,7 +143,7 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int st_HDRParam.bIsClose = true; st_HDRParam.nHttpCode = 302; - XCHAR tszRequestAddr[MAX_PATH] = {}; + XCHAR tszRequestAddr[512] = {}; XCHAR tszHostStr[128] = {}; HttpProtocol_ServerHelp_GetField(&pptszListHdr, nHdrCount, _X("Host"), tszHostStr); @@ -153,13 +153,12 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int _xstprintf(tszPortDownload, _X("%d"), st_ServiceCfg.nStorageDLPort); //转换端口 int nReplaceLen = 0; - BaseLib_OperatorString_Replace(tszHostStr, &nReplaceLen, tszPortWebdav, tszPortDownload, true); + BaseLib_String_Replace(tszHostStr, &nReplaceLen, tszPortWebdav, tszPortDownload, true); _xstprintf(tszRequestAddr, _X("Location: http://%s%s\r\n"), tszHostStr, pSt_HTTPParam->tszHttpUri); HttpProtocol_Server_SendMsgEx(xhWebdavHttp, tszSDBuffer, &nSDLen, &st_HDRParam, NULL, 0, tszRequestAddr); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPWEBDAV); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("WEBDAV客户端:%s,请求文件下载被重定向到:%s"), lpszClientAddr, tszRequestAddr); - return true; } else if (0 == _tcsxnicmp(lpszMethodPut, pSt_HTTPParam->tszHttpMethod, _tcsxlen(lpszMethodPut))) { @@ -167,7 +166,7 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int st_HDRParam.bIsClose = false; st_HDRParam.nHttpCode = 302; - XCHAR tszRequestAddr[MAX_PATH] = {}; + XCHAR tszRequestAddr[1024] = {}; XCHAR tszHostStr[128] = {}; HttpProtocol_ServerHelp_GetField(&pptszListHdr, nHdrCount, _X("Host"), tszHostStr); @@ -177,7 +176,7 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int _xstprintf(tszPortDownload, _X("%d"), st_ServiceCfg.nStorageUPPort); //转换端口 int nRLen = 0; - BaseLib_OperatorString_Replace(tszHostStr, &nRLen, tszPortWebdav, tszPortDownload, true); + BaseLib_String_Replace(tszHostStr, &nRLen, tszPortWebdav, tszPortDownload, true); //转换地址 XCHAR tszStroageKey[MAX_PATH] = {}; XCHAR tszFileName[MAX_PATH] = {}; @@ -196,7 +195,6 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int HttpProtocol_Server_SendMsgEx(xhWebdavHttp, tszSDBuffer, &nSDLen, &st_HDRParam, NULL, 0, tszRequestAddr); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPWEBDAV); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("WEBDAV客户端:%s,请求文件上传被重定向到:%s"), lpszClientAddr, tszRequestAddr); - return true; } else if (0 == _tcsxnicmp(lpszMethodLock, pSt_HTTPParam->tszHttpMethod, _tcsxlen(lpszMethodLock))) { @@ -219,7 +217,6 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int HttpProtocol_Server_SendMsgEx(xhWebdavHttp, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPWEBDAV); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("WEBDAV客户端:%s,处理WEBDAV协议LOCK方法成功,锁用户:%s"), lpszClientAddr, st_WDLock.tszOwner); - return true; } else if (0 == _tcsxnicmp(lpszMethodUNLock, pSt_HTTPParam->tszHttpMethod, _tcsxlen(lpszMethodUNLock))) { @@ -231,8 +228,7 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int HttpProtocol_Server_SendMsgEx(xhWebdavHttp, tszSDBuffer, &nSDLen, &st_HDRParam); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPWEBDAV); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("WEBDAV客户端:%s,处理WEBDAV协议UNLOCK方法成功,锁文件:%s"), lpszClientAddr, pSt_HTTPParam->tszHttpUri); - return true; - } + } else if (0 == _tcsxnicmp(lpszMethodPropPatch, pSt_HTTPParam->tszHttpMethod, _tcsxlen(lpszMethodPropPatch))) { st_HDRParam.bIsClose = false; @@ -245,7 +241,6 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int HttpProtocol_Server_SendMsgEx(xhWebdavHttp, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPWEBDAV); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("WEBDAV客户端:%s,处理WEBDAV协议PROPPATCH方法成功,锁用户:%s"), lpszClientAddr, pSt_HTTPParam->tszHttpUri); - return true; } else if (0 == _tcsxnicmp(lpszMethodDel, pSt_HTTPParam->tszHttpMethod, _tcsxlen(lpszMethodDel))) { @@ -266,13 +261,59 @@ bool XEngine_Task_HttpWebdav(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int int nFLen = 0; XCHAR tszFileName[MAX_PATH] = {}; _tcsxcpy(tszFileName, pSt_HTTPParam->tszHttpUri + 1); - BaseLib_OperatorString_Replace(tszFileName, &nFLen, st_StorageBucket.tszBuckKey, st_StorageBucket.tszFilePath); + BaseLib_String_Replace(tszFileName, &nFLen, st_StorageBucket.tszBuckKey, st_StorageBucket.tszFilePath); - _xtremove(tszFileName); + SYSTEMAPI_FILE_ATTR st_FileAttr = {}; + if (SystemApi_File_GetFileAttr(tszFileName, &st_FileAttr)) + { + if (st_FileAttr.bFile) + { + _xtremove(tszFileName); + } + else + { + //如果是文件夹 + int nFileCount = 0; + XCHAR** pptszListFile; + SystemApi_File_EnumFile(tszFileName, &pptszListFile, &nFileCount); + BaseLib_Memory_Free((XPPPMEM)&pptszListFile, nFileCount); + if (nFileCount > 0) + { + st_HDRParam.bIsClose = true; + st_HDRParam.nHttpCode = 400; + HttpProtocol_Server_SendMsgEx(xhWebdavHttp, tszSDBuffer, &nSDLen, &st_HDRParam); + XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPWEBDAV); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("WEBDAV客户端:%s,处理WEBDAV协议DELETE方法失败,删除的文件夹不为空,URL:%s"), lpszClientAddr, tszFileName); + return false; + } + SystemApi_File_DeleteMutilFolder(tszFileName, true); + } + } HttpProtocol_Server_SendMsgEx(xhWebdavHttp, tszSDBuffer, &nSDLen, &st_HDRParam); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPWEBDAV); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("WEBDAV客户端:%s,处理WEBDAV协议DELETE方法成功,删除的文件:%s"), lpszClientAddr, tszFileName); - return true; + } + else if (0 == _tcsxnicmp(lpszMethodMKCol, pSt_HTTPParam->tszHttpMethod, _tcsxlen(lpszMethodMKCol))) + { + XENGINE_STORAGEBUCKET st_StorageBucket = {}; + if (!APIHelp_Distributed_DLStorage(pSt_HTTPParam->tszHttpUri, st_LoadbalanceCfg.st_LoadBalance.pStl_ListBucket, &st_StorageBucket)) + { + st_HDRParam.bIsClose = true; + st_HDRParam.nHttpCode = 400; + HttpProtocol_Server_SendMsgEx(xhWebdavHttp, tszSDBuffer, &nSDLen, &st_HDRParam); + XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPWEBDAV); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("WEBDAV客户端:%s,处理WEBDAV协议PROPFIND方法失败,URL:%s"), lpszClientAddr, pSt_HTTPParam->tszHttpUri); + return false; + } + int nALen = 0; + XCHAR tszCreateDir[MAX_PATH] = {}; + _tcsxcpy(tszCreateDir, pSt_HTTPParam->tszHttpUri + 1); + BaseLib_String_Replace(tszCreateDir, &nALen, st_StorageBucket.tszBuckKey, st_StorageBucket.tszFilePath, true); + + st_HDRParam.nHttpCode = 201; + HttpProtocol_Server_SendMsgEx(xhWebdavHttp, tszSDBuffer, &nSDLen, &st_HDRParam); + XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPWEBDAV); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("WEBDAV客户端:%s,处理WEBDAV协议MLCOL方法成功,创建的路径:%s"), lpszClientAddr, tszCreateDir); } else { diff --git a/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskAction.cpp b/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskAction.cpp index d6fd165..d192d8e 100644 --- a/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskAction.cpp +++ b/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskAction.cpp @@ -37,7 +37,7 @@ XHTHREAD Session_Action_Thread() XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("转录动作线程:文件转录失败,句柄:%lld,URL:%s,Bucket:%s,FileName:%s,错误:%lX"), (*ppxhToken)[i], st_ActionInfo.tszFileUrl, st_ActionInfo.tszBucketStr, st_ActionInfo.tszFileName, Session_GetLastError()); } } - BaseLib_OperatorMemory_Free((XPPPMEM)&ppxhToken, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppxhToken, nListCount); std::this_thread::sleep_for(std::chrono::seconds(1)); } return 0; @@ -64,7 +64,7 @@ bool Storage_TaskAction(LPCXSTR lpszAPIName, LPCXSTR lpszClientAddr, LPCXSTR lps XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("业务客户端:%s,处理用户转录动作失败,协议解析失败,负载内容:%s"), lpszClientAddr, lpszMsgBuffer); return false; } - XCHAR tszFileName[MAX_PATH] = {}; + XCHAR tszFileName[1024] = {}; XENGINE_STORAGEBUCKET st_StorageBucket = {}; if (!APIHelp_Distributed_CTStorage(st_ActionInfo.tszBucketStr, st_LoadbalanceCfg.st_LoadBalance.pStl_ListBucket, &st_StorageBucket)) { @@ -78,7 +78,7 @@ bool Storage_TaskAction(LPCXSTR lpszAPIName, LPCXSTR lpszClientAddr, LPCXSTR lps if (0 == _tcsxnicmp(lpszAPIDownload, lpszAPIName, _tcsxlen(lpszAPIDownload))) { XNETHANDLE xhToken = 0; - BaseLib_OperatorHandle_Create(&xhToken); + BaseLib_Handle_Create(&xhToken); XHANDLE xhAction = APIClient_File_Create(st_ActionInfo.tszFileUrl, tszFileName, true); if (NULL == xhAction) @@ -100,7 +100,7 @@ bool Storage_TaskAction(LPCXSTR lpszAPIName, LPCXSTR lpszClientAddr, LPCXSTR lps else if (0 == _tcsxnicmp(lpszAPIUPload, lpszAPIName, _tcsxlen(lpszAPIUPload))) { XNETHANDLE xhToken = 0; - BaseLib_OperatorHandle_Create(&xhToken); + BaseLib_Handle_Create(&xhToken); XHANDLE xhAction = APIClient_File_Create(st_ActionInfo.tszFileUrl, tszFileName, false); if (NULL == xhAction) diff --git a/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskManage.cpp b/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskManage.cpp index a5b521c..97664b6 100644 --- a/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskManage.cpp +++ b/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskManage.cpp @@ -75,7 +75,7 @@ bool XEngine_Task_Manage(LPCXSTR lpszAPIName, LPCXSTR lpszClientAddr, LPCXSTR lp Protocol_StoragePacket_QueryFile(tszMsgBuffer, &nMsgLen, &ppSt_ListFile, nListCount, tszTimeStart, tszTimeEnd); HttpProtocol_Server_SendMsgEx(xhCenterHttp, tszSDBuffer, &nSDLen, &st_HDRParam, tszMsgBuffer, nMsgLen); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPCENTER); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListFile, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListFile, nListCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("业务客户端:%s,请求查询文件列表成功,列表个数:%d"), lpszClientAddr, nListCount); return true; } @@ -97,7 +97,7 @@ bool XEngine_Task_Manage(LPCXSTR lpszAPIName, LPCXSTR lpszClientAddr, LPCXSTR lp XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("业务客户端:%s,发送广播请求失败,因为查询文件HASH为空"), lpszClientAddr); return false; } - BaseLib_OperatorHandle_Create(&xhToken); + BaseLib_Handle_Create(&xhToken); Protocol_StoragePacket_REQFile(tszSDBuffer, &nSDLen, NULL, tszFileHash, xhToken); NetCore_BroadCast_Create(&hSDSocket, st_ServiceCfg.st_P2xp.nRVPort, st_ServiceCfg.tszIPAddr); @@ -159,7 +159,7 @@ bool XEngine_Task_Manage(LPCXSTR lpszAPIName, LPCXSTR lpszClientAddr, LPCXSTR lp APIHelp_Distributed_FileList(&stl_ListFile, &ppSt_ListPacket, &nListCount); Protocol_StoragePacket_QueryFile(tszRVBuffer, &nRVLen, &ppSt_ListPacket, nListCount); HttpProtocol_Server_SendMsgEx(xhCenterHttp, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListPacket, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_ListPacket, nListCount); } XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("业务客户端:%s,请求局域网文件列表成功,文件分布服务器个数:%d"), lpszClientAddr, stl_ListFile.size()); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPCENTER); @@ -204,7 +204,7 @@ bool XEngine_Task_Manage(LPCXSTR lpszAPIName, LPCXSTR lpszClientAddr, LPCXSTR lp } HttpProtocol_Server_SendMsgEx(xhUPHttp, tszSDBuffer, &nSDLen, &st_HDRParam); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPCENTER); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_DBFile, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_DBFile, nListCount); } else if (0 == _tcsxnicmp(lpszAPIDelete, lpszAPIName, _tcsxlen(lpszAPIDelete))) { @@ -279,7 +279,7 @@ bool XEngine_Task_Manage(LPCXSTR lpszAPIName, LPCXSTR lpszClientAddr, LPCXSTR lp } HttpProtocol_Server_SendMsgEx(xhUPHttp, tszSDBuffer, &nSDLen, &st_HDRParam); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPCENTER); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_DBFile, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_DBFile, nListCount); } else if (0 == _tcsxnicmp(lpszAPIDir, lpszAPIName, _tcsxlen(lpszAPIDir))) { @@ -322,7 +322,7 @@ bool XEngine_Task_Manage(LPCXSTR lpszAPIName, LPCXSTR lpszClientAddr, LPCXSTR lp return false; } Protocol_StoragePacket_DirOperator(tszRVBuffer, &nRVLen, &ppszListDir, nListCount); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppszListDir, nListCount); + BaseLib_Memory_Free((XPPPMEM)&ppszListDir, nListCount); HttpProtocol_Server_SendMsgEx(xhCenterHttp, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPCENTER); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("业务客户端:%s,请求查询文件夹:%s,成功,文件夹个数:%d"), lpszClientAddr, tszRealDir, nListCount); @@ -373,8 +373,8 @@ bool XEngine_Task_Manage(LPCXSTR lpszAPIName, LPCXSTR lpszClientAddr, LPCXSTR lp Protocol_StoragePacket_Info(tszRVBuffer, &nRVLen, &ppSt_DLInfo, &ppSt_UPInfo, nDLCount, nUPCount); HttpProtocol_Server_SendMsgEx(xhCenterHttp, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen); XEngine_Net_SendMsg(lpszClientAddr, tszSDBuffer, nSDLen, STORAGE_NETTYPE_HTTPCENTER); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_DLInfo, nDLCount); - BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_UPInfo, nUPCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_DLInfo, nDLCount); + BaseLib_Memory_Free((XPPPMEM)&ppSt_UPInfo, nUPCount); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("业务客户端:%s,请求获取上传下载信息成功,下载个数:%d,上传个数:%d"), lpszClientAddr, nDLCount, nUPCount); } return true; diff --git a/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskP2p.cpp b/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskP2p.cpp index 54eb517..35e1412 100644 --- a/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskP2p.cpp +++ b/XEngine_Source/XEngine_StorageApp/Storage_APPTask/Storage_TaskP2p.cpp @@ -35,7 +35,7 @@ XHTHREAD XEngine_Task_P2PThread() { _xstprintf(pppSt_ListFile[0]->tszTableName, _X("%s:%d"), st_ServiceCfg.tszIPAddr, st_ServiceCfg.nStorageDLPort); Protocol_StoragePacket_QueryFile(tszMsgBuffer, &nMsgLen, &pppSt_ListFile, nListCount, tszTimeStart, tszTimeEnd, xhToken); - BaseLib_OperatorMemory_Free((XPPPMEM)&pppSt_ListFile, nListCount); + BaseLib_Memory_Free((XPPPMEM)&pppSt_ListFile, nListCount); XSOCKET hSocket; NetCore_BroadCast_Create(&hSocket, st_ServiceCfg.st_P2xp.nSDPort, st_ServiceCfg.tszIPAddr); diff --git a/XEngine_Source/XEngine_StorageApp/XEngine_StorageApp.cpp b/XEngine_Source/XEngine_StorageApp/XEngine_StorageApp.cpp index 9f600ed..bcbf8b6 100644 --- a/XEngine_Source/XEngine_StorageApp/XEngine_StorageApp.cpp +++ b/XEngine_Source/XEngine_StorageApp/XEngine_StorageApp.cpp @@ -49,10 +49,10 @@ void ServiceApp_Stop(int signo) HttpProtocol_Server_DestroyEx(xhCenterHttp); HttpProtocol_Server_DestroyEx(xhWebdavHttp); - OPenSsl_Server_StopEx(xhDLSsl); - OPenSsl_Server_StopEx(xhUPSsl); - OPenSsl_Server_StopEx(xhCHSsl); - OPenSsl_Server_StopEx(xhWDSsl); + Cryption_Server_StopEx(xhDLSsl); + Cryption_Server_StopEx(xhUPSsl); + Cryption_Server_StopEx(xhCHSsl); + Cryption_Server_StopEx(xhWDSsl); NetCore_TCPXCore_DestroyEx(xhNetDownload); NetCore_TCPXCore_DestroyEx(xhNetUPLoader); @@ -125,7 +125,7 @@ LONG WINAPI Coredump_ExceptionFilter(EXCEPTION_POINTERS* pExceptionPointers) static int i = 0; XCHAR tszFileStr[MAX_PATH] = {}; XCHAR tszTimeStr[128] = {}; - BaseLib_OperatorTime_TimeToStr(tszTimeStr); + BaseLib_Time_TimeToStr(tszTimeStr); _xstprintf(tszFileStr, _X("./XEngine_Coredump/dumpfile_%s_%d.dmp"), tszTimeStr, i++); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_FATAL, _X("主程序:软件崩溃,写入dump:%s"), tszFileStr); @@ -290,11 +290,11 @@ int main(int argc, char** argv) { if (_tcsxlen(st_ServiceCfg.st_XCert.tszCertServer) > 0) { - xhDLSsl = OPenSsl_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, st_ServiceCfg.st_XCert.tszCertServer, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_OPENSSL_PROTOCOL_TLS_SERVER); + xhDLSsl = Cryption_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, st_ServiceCfg.st_XCert.tszCertServer, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_CRYPTION_PROTOCOL_TLS); } else { - xhDLSsl = OPenSsl_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, NULL, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_OPENSSL_PROTOCOL_TLS_SERVER); + xhDLSsl = Cryption_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, NULL, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_CRYPTION_PROTOCOL_TLS); } if (NULL == xhDLSsl) { @@ -318,7 +318,7 @@ int main(int argc, char** argv) NetCore_TCPXCore_RegisterCallBackEx(xhNetDownload, XEngine_Callback_DownloadLogin, XEngine_Callback_DownloadRecv, XEngine_Callback_DownloadLeave); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,注册下载存储网络服务事件成功!")); - BaseLib_OperatorMemory_Malloc((XPPPMEM)&ppSt_ListDLThread, st_ServiceCfg.st_XMax.nStorageDLThread, sizeof(THREADPOOL_PARAMENT)); + BaseLib_Memory_Malloc((XPPPMEM)&ppSt_ListDLThread, st_ServiceCfg.st_XMax.nStorageDLThread, sizeof(THREADPOOL_PARAMENT)); for (int i = 0; i < st_ServiceCfg.st_XMax.nStorageDLThread; i++) { int* pInt_Pos = new int; @@ -357,11 +357,11 @@ int main(int argc, char** argv) { if (_tcsxlen(st_ServiceCfg.st_XCert.tszCertServer) > 0) { - xhUPSsl = OPenSsl_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, st_ServiceCfg.st_XCert.tszCertServer, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_OPENSSL_PROTOCOL_TLS_SERVER); + xhUPSsl = Cryption_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, st_ServiceCfg.st_XCert.tszCertServer, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_CRYPTION_PROTOCOL_TLS); } else { - xhUPSsl = OPenSsl_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, NULL, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_OPENSSL_PROTOCOL_TLS_SERVER); + xhUPSsl = Cryption_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, NULL, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_CRYPTION_PROTOCOL_TLS); } if (NULL == xhUPSsl) { @@ -385,7 +385,7 @@ int main(int argc, char** argv) NetCore_TCPXCore_RegisterCallBackEx(xhNetUPLoader, XEngine_Callback_UPLoaderLogin, XEngine_Callback_UPLoaderRecv, XEngine_Callback_UPLoaderLeave); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,注册上传存储网络服务事件成功!")); - BaseLib_OperatorMemory_Malloc((XPPPMEM)&ppSt_ListUPThread, st_ServiceCfg.st_XMax.nStorageUPThread, sizeof(THREADPOOL_PARAMENT)); + BaseLib_Memory_Malloc((XPPPMEM)&ppSt_ListUPThread, st_ServiceCfg.st_XMax.nStorageUPThread, sizeof(THREADPOOL_PARAMENT)); for (int i = 0; i < st_ServiceCfg.st_XMax.nStorageUPThread; i++) { int* pInt_Pos = new int; @@ -417,11 +417,11 @@ int main(int argc, char** argv) { if (_tcsxlen(st_ServiceCfg.st_XCert.tszCertServer) > 0) { - xhCHSsl = OPenSsl_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, st_ServiceCfg.st_XCert.tszCertServer, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_OPENSSL_PROTOCOL_TLS_SERVER); + xhCHSsl = Cryption_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, st_ServiceCfg.st_XCert.tszCertServer, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_CRYPTION_PROTOCOL_TLS); } else { - xhCHSsl = OPenSsl_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, NULL, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_OPENSSL_PROTOCOL_TLS_SERVER); + xhCHSsl = Cryption_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, NULL, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_CRYPTION_PROTOCOL_TLS); } if (NULL == xhCHSsl) { @@ -445,7 +445,7 @@ int main(int argc, char** argv) NetCore_TCPXCore_RegisterCallBackEx(xhNetCenter, XEngine_Callback_CenterLogin, XEngine_Callback_CenterRecv, XEngine_Callback_CenterLeave); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,注册业务控制存储存储网络服务事件成功!")); - BaseLib_OperatorMemory_Malloc((XPPPMEM)&ppSt_ListCTThread, st_ServiceCfg.st_XMax.nCenterThread, sizeof(THREADPOOL_PARAMENT)); + BaseLib_Memory_Malloc((XPPPMEM)&ppSt_ListCTThread, st_ServiceCfg.st_XMax.nCenterThread, sizeof(THREADPOOL_PARAMENT)); for (int i = 0; i < st_ServiceCfg.st_XMax.nCenterThread; i++) { int* pInt_Pos = new int; @@ -477,11 +477,11 @@ int main(int argc, char** argv) { if (_tcsxlen(st_ServiceCfg.st_XCert.tszCertServer) > 0) { - xhWDSsl = OPenSsl_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, st_ServiceCfg.st_XCert.tszCertServer, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_OPENSSL_PROTOCOL_TLS_SERVER); + xhWDSsl = Cryption_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, st_ServiceCfg.st_XCert.tszCertServer, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_CRYPTION_PROTOCOL_TLS); } else { - xhWDSsl = OPenSsl_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, NULL, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_OPENSSL_PROTOCOL_TLS_SERVER); + xhWDSsl = Cryption_Server_InitEx(st_ServiceCfg.st_XCert.tszCertChain, NULL, st_ServiceCfg.st_XCert.tszCertKey, false, false, XENGINE_CRYPTION_PROTOCOL_TLS); } if (NULL == xhWDSsl) { @@ -505,7 +505,7 @@ int main(int argc, char** argv) NetCore_TCPXCore_RegisterCallBackEx(xhNetWebdav, XEngine_Callback_WebdavLogin, XEngine_Callback_WebdavRecv, XEngine_Callback_WebdavLeave); XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,注册WEBDAV网络服务事件成功!")); - BaseLib_OperatorMemory_Malloc((XPPPMEM)&ppSt_ListWDThread, st_ServiceCfg.st_XMax.nWebdavThread, sizeof(THREADPOOL_PARAMENT)); + BaseLib_Memory_Malloc((XPPPMEM)&ppSt_ListWDThread, st_ServiceCfg.st_XMax.nWebdavThread, sizeof(THREADPOOL_PARAMENT)); for (int i = 0; i < st_ServiceCfg.st_XMax.nWebdavThread; i++) { int* pInt_Pos = new int; @@ -584,7 +584,7 @@ int main(int argc, char** argv) XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_WARN, _X("启动服务中,信息报告给API服务器没有启用")); } - XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("所有服务成功启动,存储中心服务运行中,发行版本次数:%d,XEngine版本:%s%s 当前运行版本:%s。。。"), st_ServiceCfg.st_XVer.pStl_ListStorage->size(), BaseLib_OperatorVer_XNumberStr(), BaseLib_OperatorVer_XTypeStr(), st_ServiceCfg.st_XVer.pStl_ListStorage->front().c_str()); + XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("所有服务成功启动,存储中心服务运行中,发行版本次数:%d,XEngine版本:%s%s 当前运行版本:%s。。。"), st_ServiceCfg.st_XVer.pStl_ListStorage->size(), BaseLib_Version_XNumberStr(), BaseLib_Version_XTypeStr(), st_ServiceCfg.st_XVer.pStl_ListStorage->front().c_str()); while (true) { @@ -614,10 +614,10 @@ int main(int argc, char** argv) HttpProtocol_Server_DestroyEx(xhCenterHttp); HttpProtocol_Server_DestroyEx(xhWebdavHttp); - OPenSsl_Server_StopEx(xhDLSsl); - OPenSsl_Server_StopEx(xhUPSsl); - OPenSsl_Server_StopEx(xhCHSsl); - OPenSsl_Server_StopEx(xhWDSsl); + Cryption_Server_StopEx(xhDLSsl); + Cryption_Server_StopEx(xhUPSsl); + Cryption_Server_StopEx(xhCHSsl); + Cryption_Server_StopEx(xhWDSsl); NetCore_TCPXCore_DestroyEx(xhNetDownload); NetCore_TCPXCore_DestroyEx(xhNetUPLoader); diff --git a/XEngine_Source/XStorage_BuildSwitch.h b/XEngine_Source/XStorage_BuildSwitch.h index fecb0d4..d859315 100644 --- a/XEngine_Source/XStorage_BuildSwitch.h +++ b/XEngine_Source/XStorage_BuildSwitch.h @@ -10,4 +10,8 @@ // Purpose: 存储服务开关编译选项 // History: *********************************************************************/ -#define _XENGIEN_STORAGE_BUILDSWITCH_BTORRENT 0 //BT支持 \ No newline at end of file +#define _XENGIEN_STORAGE_BUILDSWITCH_BTORRENT 0 //BT支持 + +#if (XENGINE_VERSION_KERNEL <= 9) && (XENGINE_VERSION_MAIN < 10) + typedef XENGINE_LIBTIMER XENGINE_LIBTIME; +#endif \ No newline at end of file