зеркало из https://github.com/microsoft/msquic.git
Add soversion to msquic (#2095)
* Add soversion to msquic * Fix darwin packages * One more mac fix * Create symlink * Update scripts/make-packages.sh Co-authored-by: Tomas Weinfurt <tweinfurt@yahoo.com> * Update scripts/make-packages.sh Co-authored-by: Tomas Weinfurt <tweinfurt@yahoo.com> * Fix version update script * Update to 2.0 Co-authored-by: Tomas Weinfurt <tweinfurt@yahoo.com>
This commit is contained in:
Родитель
0128f2a437
Коммит
886c8788c6
|
@ -60,7 +60,7 @@ jobs:
|
||||||
${{ if eq(variables['Build.Reason'], 'BatchedCI') }}:
|
${{ if eq(variables['Build.Reason'], 'BatchedCI') }}:
|
||||||
tags: |
|
tags: |
|
||||||
latest
|
latest
|
||||||
v1.10.0.$(Build.BuildId)
|
v2.0.0.$(Build.BuildId)
|
||||||
${{ if ne(variables['Build.Reason'], 'BatchedCI') }}:
|
${{ if ne(variables['Build.Reason'], 'BatchedCI') }}:
|
||||||
tags: custom-$(Build.BuildId)
|
tags: custom-$(Build.BuildId)
|
||||||
- template: .\templates\run-qns.yml
|
- template: .\templates\run-qns.yml
|
||||||
|
|
|
@ -27,8 +27,8 @@ jobs:
|
||||||
pushPkgName: msquic.${{ parameters.platform }}
|
pushPkgName: msquic.${{ parameters.platform }}
|
||||||
owner: quicdev@microsoft.com
|
owner: quicdev@microsoft.com
|
||||||
vpackToken: $(VPACK_PAT)
|
vpackToken: $(VPACK_PAT)
|
||||||
majorVer: 1
|
majorVer: 2
|
||||||
minorVer: 10
|
minorVer: 0
|
||||||
patchVer: 0
|
patchVer: 0
|
||||||
prereleaseVer: $(Build.BuildId)
|
prereleaseVer: $(Build.BuildId)
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,9 @@ message(STATUS "System version: ${CMAKE_SYSTEM_VERSION}")
|
||||||
message(STATUS "Platform version: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
message(STATUS "Platform version: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
|
||||||
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
||||||
|
|
||||||
|
set(QUIC_MAJOR_VERSION 2)
|
||||||
|
set(QUIC_FULL_VERSION 2.0.0)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(CX_PLATFORM "windows")
|
set(CX_PLATFORM "windows")
|
||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
|
|
|
@ -82,8 +82,8 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ARTIFACTS="artifacts/bin/${OS}/${ARCH}_${CONFIG}_openssl"
|
ARTIFACTS="artifacts/bin/${OS}/${ARCH}_${CONFIG}_openssl"
|
||||||
if [ ! -e "$ARTIFACTS/libmsquic.${LIBEXT}" ]; then
|
if [ ! -e "$ARTIFACTS/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" ]; then
|
||||||
echo "$ARTIFACTS/libmsquic.${LIBEXT}" does not exist. Run build first.
|
echo "$ARTIFACTS/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" does not exist. Run build first.
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -94,15 +94,19 @@ fi
|
||||||
mkdir -p ${OUTPUT}
|
mkdir -p ${OUTPUT}
|
||||||
|
|
||||||
if [ "$OS" == "linux" ]; then
|
if [ "$OS" == "linux" ]; then
|
||||||
|
# Create symlink
|
||||||
|
ln -s "${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" "${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}"
|
||||||
|
|
||||||
# RedHat/CentOS
|
# RedHat/CentOS
|
||||||
FILES="${ARTIFACTS}/libmsquic.${LIBEXT}=/usr/${LIBDIR}/libmsquic.${LIBEXT}"
|
FILES="${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}=/usr/${LIBDIR}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}"
|
||||||
if [ -e "$ARTIFACTS/libmsquic.lttng.${LIBEXT}" ]; then
|
FILES="${FILES} ${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}=/usr/${LIBDIR}/libmsquic.${LIBEXT}.${VER_MAJOR}"
|
||||||
FILES="${FILES} ${ARTIFACTS}/libmsquic.lttng.${LIBEXT}=/usr/${LIBDIR}/libmsquic.lttng.${LIBEXT}"
|
if [ -e "$ARTIFACTS/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" ]; then
|
||||||
|
FILES="${FILES} ${ARTIFACTS}/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}=/usr/${LIBDIR}/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}"
|
||||||
fi
|
fi
|
||||||
fpm -f -s dir -t rpm -n ${NAME} -v ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} --license MIT --url https://github.com/microsoft/msquic \
|
fpm -f -s dir -t rpm -n ${NAME} -v ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} --license MIT --url https://github.com/microsoft/msquic \
|
||||||
--package "$OUTPUT" --log error \
|
--package "$OUTPUT" --log error \
|
||||||
--description "${DESCRIPTION}" \
|
--description "${DESCRIPTION}" \
|
||||||
--provides libmsquic.so \
|
--provides libmsquic.so.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} \
|
||||||
${CONFLICTS} \
|
${CONFLICTS} \
|
||||||
${FILES}
|
${FILES}
|
||||||
|
|
||||||
|
@ -110,14 +114,15 @@ if [ "$OS" == "linux" ]; then
|
||||||
if [ "$LIBDIR" == 'lib64' ]; then
|
if [ "$LIBDIR" == 'lib64' ]; then
|
||||||
LIBDIR="lib/x86_64-linux-gnu"
|
LIBDIR="lib/x86_64-linux-gnu"
|
||||||
fi
|
fi
|
||||||
FILES="${ARTIFACTS}/libmsquic.${LIBEXT}=/usr/${LIBDIR}/libmsquic.${LIBEXT}"
|
FILES="${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}=/usr/${LIBDIR}/libmsquic.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}"
|
||||||
if [ -e "$ARTIFACTS/libmsquic.lttng.${LIBEXT}" ]; then
|
FILES="${FILES} ${ARTIFACTS}/libmsquic.${LIBEXT}.${VER_MAJOR}=/usr/${LIBDIR}/libmsquic.${LIBEXT}.${VER_MAJOR}"
|
||||||
FILES="${FILES} ${ARTIFACTS}/libmsquic.lttng.${LIBEXT}=/usr/${LIBDIR}/libmsquic.lttng.${LIBEXT}"
|
if [ -e "$ARTIFACTS/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}" ]; then
|
||||||
|
FILES="${FILES} ${ARTIFACTS}/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}=/usr/${LIBDIR}/libmsquic.lttng.${LIBEXT}.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}"
|
||||||
fi
|
fi
|
||||||
fpm -f -s dir -t deb -n ${NAME} -v ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} --license MIT --url https://github.com/microsoft/msquic \
|
fpm -f -s dir -t deb -n ${NAME} -v ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} --license MIT --url https://github.com/microsoft/msquic \
|
||||||
--package "$OUTPUT" --log error \
|
--package "$OUTPUT" --log error \
|
||||||
--description "${DESCRIPTION}" \
|
--description "${DESCRIPTION}" \
|
||||||
--provides libmsquic.so \
|
--provides libmsquic.so.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} \
|
||||||
${CONFLICTS} \
|
${CONFLICTS} \
|
||||||
${FILES}
|
${FILES}
|
||||||
fi
|
fi
|
||||||
|
@ -125,6 +130,6 @@ if [ "$OS" == "macos" ]; then
|
||||||
fpm -f -s dir -t osxpkg -n ${NAME} -v ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} --license MIT --url https://github.com/microsoft/msquic \
|
fpm -f -s dir -t osxpkg -n ${NAME} -v ${VER_MAJOR}.${VER_MINOR}.${VER_PATCH} --license MIT --url https://github.com/microsoft/msquic \
|
||||||
--package "$OUTPUT" --log error \
|
--package "$OUTPUT" --log error \
|
||||||
--description "${DESCRIPTION}" \
|
--description "${DESCRIPTION}" \
|
||||||
--provides libmsquic.dylib \
|
--provides libmsquic.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}.dylib \
|
||||||
"$ARTIFACTS/libmsquic.dylib"=/usr/local/lib/libmsquic.dylib
|
"$ARTIFACTS/libmsquic.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}.dylib"=/usr/local/lib/libmsquic.${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}.dylib
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -19,6 +19,8 @@ $ArtifactsBinDir = Join-Path $BaseArtifactsDir "bin"
|
||||||
# All direct subfolders are OS's
|
# All direct subfolders are OS's
|
||||||
$Platforms = Get-ChildItem -Path $ArtifactsBinDir
|
$Platforms = Get-ChildItem -Path $ArtifactsBinDir
|
||||||
|
|
||||||
|
$Version = "2.0.0"
|
||||||
|
|
||||||
$WindowsBuilds = @()
|
$WindowsBuilds = @()
|
||||||
$AllBuilds = @()
|
$AllBuilds = @()
|
||||||
|
|
||||||
|
@ -81,19 +83,24 @@ foreach ($Build in $AllBuilds) {
|
||||||
# Find Binaries
|
# Find Binaries
|
||||||
|
|
||||||
$Binaries = @()
|
$Binaries = @()
|
||||||
|
$DebugFolders = @()
|
||||||
|
|
||||||
if ($Platform -eq "windows" -or $Platform -eq "uwp" -or $Platform -eq "gamecore_console") {
|
if ($Platform -eq "windows" -or $Platform -eq "uwp" -or $Platform -eq "gamecore_console") {
|
||||||
$Binaries += Join-Path $ArtifactsDir "msquic.dll"
|
$Binaries += Join-Path $ArtifactsDir "msquic.dll"
|
||||||
$Binaries += Join-Path $ArtifactsDir "msquic.pdb"
|
$Binaries += Join-Path $ArtifactsDir "msquic.pdb"
|
||||||
} elseif ($Platform -eq "linux") {
|
} elseif ($Platform -eq "linux") {
|
||||||
$Binaries += Join-Path $ArtifactsDir "libmsquic.so"
|
$Binaries += Join-Path $ArtifactsDir "libmsquic.so.$Version"
|
||||||
$LttngBin = Join-Path $ArtifactsDir "libmsquic.lttng.so"
|
$LttngBin = Join-Path $ArtifactsDir "libmsquic.lttng.so.$Version"
|
||||||
if (Test-Path $LttngBin) {
|
if (Test-Path $LttngBin) {
|
||||||
$Binaries += $LttngBin
|
$Binaries += $LttngBin
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
# macos
|
# macos
|
||||||
$Binaries += Join-Path $ArtifactsDir "libmsquic.dylib"
|
$Binaries += Join-Path $ArtifactsDir "libmsquic.$Version.dylib"
|
||||||
|
$DebugFolder = Join-Path $ArtifactsDir "libmsquic.$Version.dylib.dSYM"
|
||||||
|
if (Test-Path $DebugFolder) {
|
||||||
|
$DebugFolders += $DebugFolder
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$Libraries = @()
|
$Libraries = @()
|
||||||
|
@ -125,6 +132,10 @@ foreach ($Build in $AllBuilds) {
|
||||||
Copy-Item -LiteralPath $Binary -Destination $CopyToFolder -Force
|
Copy-Item -LiteralPath $Binary -Destination $CopyToFolder -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($DebugFolder in $DebugFolders) {
|
||||||
|
Copy-Item -Path $DebugFolder -Destination $BinFolder -Recurse
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($Library in $Libraries) {
|
foreach ($Library in $Libraries) {
|
||||||
$FileName = Split-Path -Path $Library -Leaf
|
$FileName = Split-Path -Path $Library -Leaf
|
||||||
$CopyToFolder = (Join-Path $LibFolder $FileName)
|
$CopyToFolder = (Join-Path $LibFolder $FileName)
|
||||||
|
|
|
@ -141,7 +141,7 @@ $DistDir = Join-Path $BaseArtifactsDir "dist"
|
||||||
$CurrentCommitHash = Get-GitHash -RepoDir $RootDir
|
$CurrentCommitHash = Get-GitHash -RepoDir $RootDir
|
||||||
$RepoRemote = Get-GitRemote -RepoDir $RootDir
|
$RepoRemote = Get-GitRemote -RepoDir $RootDir
|
||||||
|
|
||||||
$Version = "1.10.0"
|
$Version = "2.0.0"
|
||||||
|
|
||||||
$BuildId = $env:BUILD_BUILDID
|
$BuildId = $env:BUILD_BUILDID
|
||||||
if ($null -ne $BuildId) {
|
if ($null -ne $BuildId) {
|
||||||
|
|
|
@ -28,7 +28,9 @@ $MsQuicVerFilePath = Join-Path $RootDir "src" "inc" "msquic.ver"
|
||||||
$CreateVPackFilePath = Join-Path $RootDir ".azure" "obtemplates" "push-vpack.yml"
|
$CreateVPackFilePath = Join-Path $RootDir ".azure" "obtemplates" "push-vpack.yml"
|
||||||
$QnsFilePath = Join-Path $RootDir ".azure" "azure-pipelines.qns.yml"
|
$QnsFilePath = Join-Path $RootDir ".azure" "azure-pipelines.qns.yml"
|
||||||
$NugetPackageFile = Join-Path $RootDir "scripts" "package-nuget.ps1"
|
$NugetPackageFile = Join-Path $RootDir "scripts" "package-nuget.ps1"
|
||||||
|
$DistributionFile = Join-Path $RootDir "scripts" "package-distribution.ps1"
|
||||||
$FrameworkInfoFile = Join-Path $RootDir "src" "distribution" "Info.plist"
|
$FrameworkInfoFile = Join-Path $RootDir "src" "distribution" "Info.plist"
|
||||||
|
$CMakeFile = Join-Path $RootDir "CMakeLists.txt"
|
||||||
$VersionsWriteFile = Join-Path $RootDir "scripts" "write-versions.ps1"
|
$VersionsWriteFile = Join-Path $RootDir "scripts" "write-versions.ps1"
|
||||||
|
|
||||||
# Get the current version number from the msquic.ver file.
|
# Get the current version number from the msquic.ver file.
|
||||||
|
@ -55,11 +57,6 @@ Write-Host " New version: $NewVerMajor.$NewVerMinor.$NewVerPatch"
|
||||||
-replace "#define VER_MINOR (.*)", "#define VER_MINOR $NewVerMinor" `
|
-replace "#define VER_MINOR (.*)", "#define VER_MINOR $NewVerMinor" `
|
||||||
-replace "#define VER_PATCH (.*)", "#define VER_PATCH $NewVerPatch" |`
|
-replace "#define VER_PATCH (.*)", "#define VER_PATCH $NewVerPatch" |`
|
||||||
Out-File $MsQuicVerFilePath
|
Out-File $MsQuicVerFilePath
|
||||||
(Get-Content $CreatePackageFilePath) `
|
|
||||||
-replace "majorVer: (.*)", "majorVer: $NewVerMajor" `
|
|
||||||
-replace "minorVer: (.*)", "minorVer: $NewVerMinor" `
|
|
||||||
-replace "patchVer: (.*)", "patchVer: $NewVerPatch" |`
|
|
||||||
Out-File $CreatePackageFilePath
|
|
||||||
(Get-Content $CreateVPackFilePath) `
|
(Get-Content $CreateVPackFilePath) `
|
||||||
-replace "majorVer: (.*)", "majorVer: $NewVerMajor" `
|
-replace "majorVer: (.*)", "majorVer: $NewVerMajor" `
|
||||||
-replace "minorVer: (.*)", "minorVer: $NewVerMinor" `
|
-replace "minorVer: (.*)", "minorVer: $NewVerMinor" `
|
||||||
|
@ -74,6 +71,15 @@ Write-Host " New version: $NewVerMajor.$NewVerMinor.$NewVerPatch"
|
||||||
(Get-Content $FrameworkInfoFile) `
|
(Get-Content $FrameworkInfoFile) `
|
||||||
-replace "$VerMajor.$VerMinor.$VerPatch", "$NewVerMajor.$NewVerMinor.$NewVerPatch" |`
|
-replace "$VerMajor.$VerMinor.$VerPatch", "$NewVerMajor.$NewVerMinor.$NewVerPatch" |`
|
||||||
Out-File $FrameworkInfoFile
|
Out-File $FrameworkInfoFile
|
||||||
|
(Get-Content $DistributionFile) `
|
||||||
|
-replace "$VerMajor.$VerMinor.$VerPatch", "$NewVerMajor.$NewVerMinor.$NewVerPatch" |`
|
||||||
|
Out-File $DistributionFile
|
||||||
|
(Get-Content $CMakeFile) `
|
||||||
|
-replace "`set\(QUIC_MAJOR_VERSION $VerMajor\)", "set(QUIC_MAJOR_VERSION $NewVerMajor)" |`
|
||||||
|
Out-File $CMakeFile
|
||||||
|
(Get-Content $CMakeFile) `
|
||||||
|
-replace "set\(QUIC_FULL_VERSION $VerMajor.$VerMinor.$VerPatch\)", "set(QUIC_FULL_VERSION $NewVerMajor.$NewVerMinor.$NewVerPatch)" |`
|
||||||
|
Out-File $CMakeFile
|
||||||
(Get-Content $VersionsWriteFile) `
|
(Get-Content $VersionsWriteFile) `
|
||||||
-replace "$VerMajor.$VerMinor.$VerPatch", "$NewVerMajor.$NewVerMinor.$NewVerPatch" |`
|
-replace "$VerMajor.$VerMinor.$VerPatch", "$NewVerMajor.$NewVerMinor.$NewVerPatch" |`
|
||||||
Out-File $VersionsWriteFile
|
Out-File $VersionsWriteFile
|
||||||
|
|
|
@ -26,7 +26,7 @@ $ArtifactsDir = $BuildConfig.ArtifactsDir
|
||||||
$SourceVersion = $env:BUILD_SOURCEVERSION;
|
$SourceVersion = $env:BUILD_SOURCEVERSION;
|
||||||
$SourceBranch = $env:BUILD_SOURCEBRANCH;
|
$SourceBranch = $env:BUILD_SOURCEBRANCH;
|
||||||
$BuildId = $env:BUILD_BUILDID;
|
$BuildId = $env:BUILD_BUILDID;
|
||||||
$VersionNumber = "1.10.0";
|
$VersionNumber = "2.0.0";
|
||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
[string]$SourceVersion;
|
[string]$SourceVersion;
|
||||||
|
|
|
@ -13,6 +13,9 @@ if(BUILD_SHARED_LIBS)
|
||||||
add_library(msquic SHARED ${SOURCES})
|
add_library(msquic SHARED ${SOURCES})
|
||||||
target_link_libraries(msquic PRIVATE core platform inc warnings logging base_link main_binary_link_args)
|
target_link_libraries(msquic PRIVATE core platform inc warnings logging base_link main_binary_link_args)
|
||||||
set_target_properties(msquic PROPERTIES OUTPUT_NAME ${QUIC_LIBRARY_NAME})
|
set_target_properties(msquic PROPERTIES OUTPUT_NAME ${QUIC_LIBRARY_NAME})
|
||||||
|
if (NOT WIN32)
|
||||||
|
set_target_properties(msquic PROPERTIES SOVERSION ${QUIC_MAJOR_VERSION} VERSION ${QUIC_FULL_VERSION})
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
add_library(msquic_static STATIC static/empty.c)
|
add_library(msquic_static STATIC static/empty.c)
|
||||||
target_link_libraries(msquic_static PRIVATE core platform inc logging main_binary_link_args)
|
target_link_libraries(msquic_static PRIVATE core platform inc logging main_binary_link_args)
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.10.0</string>
|
<string>2.0.0</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>MIT</string>
|
<string>MIT</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
|
|
|
@ -21,6 +21,7 @@ if(QUIC_ENABLE_LOGGING)
|
||||||
target_compile_definitions(msquic.lttng PRIVATE BUILDING_TRACEPOINT_PROVIDER)
|
target_compile_definitions(msquic.lttng PRIVATE BUILDING_TRACEPOINT_PROVIDER)
|
||||||
target_link_libraries(msquic.lttng PRIVATE logging_inc inc)
|
target_link_libraries(msquic.lttng PRIVATE logging_inc inc)
|
||||||
target_link_libraries(msquic.lttng PRIVATE ${LTTNGUST_LIBRARIES})
|
target_link_libraries(msquic.lttng PRIVATE ${LTTNGUST_LIBRARIES})
|
||||||
|
set_target_properties(msquic.lttng PROPERTIES SOVERSION ${QUIC_FULL_VERSION} VERSION ${QUIC_FULL_VERSION})
|
||||||
|
|
||||||
install(TARGETS msquic.lttng DESTINATION lib)
|
install(TARGETS msquic.lttng DESTINATION lib)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef VER_MAJOR
|
#ifndef VER_MAJOR
|
||||||
#define VER_MAJOR 1
|
#define VER_MAJOR 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef VER_MINOR
|
#ifndef VER_MINOR
|
||||||
#define VER_MINOR 10
|
#define VER_MINOR 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef VER_PATCH
|
#ifndef VER_PATCH
|
||||||
|
|
|
@ -21,6 +21,8 @@ Environment:
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
#define QUIC_VERSION_ONLY 1
|
||||||
|
#include "msquic.ver"
|
||||||
#ifdef QUIC_CLOG
|
#ifdef QUIC_CLOG
|
||||||
#include "platform_posix.c.clog.h"
|
#include "platform_posix.c.clog.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,7 +33,12 @@ CX_PLATFORM CxPlatform = { NULL };
|
||||||
int RandomFd; // Used for reading random numbers.
|
int RandomFd; // Used for reading random numbers.
|
||||||
QUIC_TRACE_RUNDOWN_CALLBACK* QuicTraceRundownCallback;
|
QUIC_TRACE_RUNDOWN_CALLBACK* QuicTraceRundownCallback;
|
||||||
|
|
||||||
static const char TpLibName[] = "libmsquic.lttng.so";
|
#define STR_HELPER(x) #x
|
||||||
|
#define STR(x) STR_HELPER(x)
|
||||||
|
|
||||||
|
#define LIBRARY_VERSION STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH)
|
||||||
|
|
||||||
|
static const char TpLibName[] = "libmsquic.lttng.so." LIBRARY_VERSION;
|
||||||
|
|
||||||
uint32_t CxPlatProcessorCount;
|
uint32_t CxPlatProcessorCount;
|
||||||
|
|
||||||
|
@ -112,7 +119,7 @@ CxPlatSystemLoad(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ShouldLoad) {
|
if (!ShouldLoad) {
|
||||||
return;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -121,7 +128,7 @@ CxPlatSystemLoad(
|
||||||
Dl_info Info;
|
Dl_info Info;
|
||||||
int Succeeded = dladdr((void *)CxPlatSystemLoad, &Info);
|
int Succeeded = dladdr((void *)CxPlatSystemLoad, &Info);
|
||||||
if (!Succeeded) {
|
if (!Succeeded) {
|
||||||
return;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t PathLen = strlen(Info.dli_fname);
|
size_t PathLen = strlen(Info.dli_fname);
|
||||||
|
@ -138,7 +145,7 @@ CxPlatSystemLoad(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LastTrailingSlashLen == -1) {
|
if (LastTrailingSlashLen == -1) {
|
||||||
return;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t TpLibNameLen = strlen(TpLibName);
|
size_t TpLibNameLen = strlen(TpLibName);
|
||||||
|
@ -146,7 +153,7 @@ CxPlatSystemLoad(
|
||||||
|
|
||||||
char* ProviderFullPath = CXPLAT_ALLOC_PAGED(ProviderFullPathLength, QUIC_POOL_PLATFORM_TMP_ALLOC);
|
char* ProviderFullPath = CXPLAT_ALLOC_PAGED(ProviderFullPathLength, QUIC_POOL_PLATFORM_TMP_ALLOC);
|
||||||
if (ProviderFullPath == NULL) {
|
if (ProviderFullPath == NULL) {
|
||||||
return;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
CxPlatCopyMemory(ProviderFullPath, Info.dli_fname, LastTrailingSlashLen);
|
CxPlatCopyMemory(ProviderFullPath, Info.dli_fname, LastTrailingSlashLen);
|
||||||
|
@ -161,6 +168,8 @@ CxPlatSystemLoad(
|
||||||
|
|
||||||
CXPLAT_FREE(ProviderFullPath, QUIC_POOL_PLATFORM_TMP_ALLOC);
|
CXPLAT_FREE(ProviderFullPath, QUIC_POOL_PLATFORM_TMP_ALLOC);
|
||||||
|
|
||||||
|
Exit:
|
||||||
|
|
||||||
QuicTraceLogInfo(
|
QuicTraceLogInfo(
|
||||||
PosixLoaded,
|
PosixLoaded,
|
||||||
"[ dso] Loaded");
|
"[ dso] Loaded");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче