aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Littow <sami.littow@qt.io>2022-12-07 14:48:39 +0200
committerSami Littow <sami.littow@qt.io>2022-12-07 14:48:39 +0200
commite6e45c8d7668cfffacd774afb7b5205749a2a69a (patch)
tree1b0eaf19302b76243c8980f99679ede1776b8338
parent29e06d5d22fbda6d7294e2f9785cc4393628023e (diff)
[v2.0.4] "No licenses left" - response message changed
-rw-r--r--CHANGELOG12
-rw-r--r--include/licenser.h12
-rw-r--r--licenser.cpp6
3 files changed, 23 insertions, 7 deletions
diff --git a/CHANGELOG b/CHANGELOG
index e2d32d3..4fec1af 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -22,4 +22,14 @@ Changes in 2.0.1:
Changes in 2.0.2:
- Added this changelog
-- Implemented support for additional leeway time in case there's no server connnection
+- Implemented support for additional leeway time in case there's no server connection
+
+####################
+
+Changes in 2.0.3:
+- Mocwrapper made even less verbose
+
+####################
+
+Changes in 2.0.4:
+- Changed daemon response message in case there is no licenses left in the pool
diff --git a/include/licenser.h b/include/licenser.h
index 762839f..00ba815 100644
--- a/include/licenser.h
+++ b/include/licenser.h
@@ -27,11 +27,12 @@
#include "licdsetup.h"
enum RequestReply {
- e_bad_request = -1,
- e_license_granted = 0,
- e_license_rejected = 1,
- e_no_conn_leeway = 2,
- e_bad_connection = 3
+ e_bad_request = -1,
+ e_license_granted = 0,
+ e_license_rejected = 1,
+ e_no_conn_leeway = 2,
+ e_license_pool_full = 3,
+ e_bad_connection = 4
};
enum class RequestType {
@@ -92,6 +93,7 @@ private:
{e_license_granted, "License acquired."},
{e_license_rejected, "No valid license acquired"},
{e_no_conn_leeway, "License granted with warning: No server connection. Leeway time left: "},
+ {e_license_pool_full, "All licenses in use. No more license available on the server."},
{e_bad_connection, "No connection to server. Try again later."}
};
};
diff --git a/licenser.cpp b/licenser.cpp
index dd250cb..ca52e4b 100644
--- a/licenser.cpp
+++ b/licenser.cpp
@@ -243,7 +243,11 @@ int Licenser::parseAndSaveJsonReply(std::string &reply, const RequestInfo &reque
ss << " reservation_id=" << json.get("reservation_id");
reply = ss.str();
} else {
- reply = replyString[e_license_rejected];
+ if (json.get("message") == "License fully reserved") {
+ reply = replyString[e_license_pool_full];
+ } else {
+ reply = replyString[e_license_rejected];
+ }
// Do not save the response json, just return
return 1;
}