From 8d405b265285c368df2e9cf1c14acee7532e0ee7 Mon Sep 17 00:00:00 2001 From: nancy.liao <huihui.liao@greentest.com.cn> Date: ćšć, 29 5æ 2025 18:14:38 +0800 Subject: [PATCH] Merge branch 'develop' of http://139.9.88.116:3000/r/module/open-license-manager into develop --- src/library/licensecc.cpp | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/library/licensecc.cpp b/src/library/licensecc.cpp index 2642811..948603a 100644 --- a/src/library/licensecc.cpp +++ b/src/library/licensecc.cpp @@ -24,7 +24,8 @@ #include "limits/license_verifier.hpp" #include "base/string_utils.h" #include "LicenseReader.hpp" - +#include "../test/functional/generate-license.h" +using namespace license; using namespace std; void print_error(char out_buffer[LCC_API_ERROR_BUFFER_SIZE], LicenseInfo* licenseInfo) {} @@ -40,7 +41,7 @@ } catch (const std::exception& ex) { LOG_ERROR("Error calculating hw_identifier: %s", ex.what()); #ifndef NDEBUG - cout << "Error occurred: " << ex.what() << std::endl; + cerr << "Error occurred in identify_pc: " << ex.what() << std::endl; #endif } } else { @@ -56,6 +57,7 @@ } static void mergeLicenses(const vector<LicenseInfo>& licenses, LicenseInfo* license_out) { + if (license_out != nullptr) { int days_left = INT_MIN; for (auto it = licenses.begin(); it != licenses.end(); it++) { @@ -70,7 +72,6 @@ } } } - LCC_EVENT_TYPE acquire_license(const CallerInformations* callerInformation, const LicenseLocation* licenseLocation, LicenseInfo* license_out) { const license::LicenseReader lr = license::LicenseReader(licenseLocation); @@ -124,15 +125,19 @@ } } #ifndef NDEBUG - cout << er << endl; + const string evlog = er.to_string(); + LOG_DEBUG("License status %s", evlog.c_str()); #endif if (license_out != nullptr) { er.exportLastEvents(license_out->status, LCC_API_AUDIT_EVENT_NUM); } + return result; } + + LCC_EVENT_TYPE confirm_license(char* product, LicenseLocation licenseLocation) { return LICENSE_OK; } LCC_EVENT_TYPE release_license(char* product, LicenseLocation licenseLocation) { return LICENSE_OK; } -- Gitblit v1.9.1