Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## xx.xx.x
- Request queue processing now is limited to 100 requests at a time
- Added 'setEventsToRQThreshold' method that sets the number of events after which all events will be sent to the RQ. Default value is set to 100.
- Mitigated an issue where not providing a virtual port number (or providing a negative value) at the 'start' was causing SDK to assign a wrong port number.

## 22.09.1
- Mitigated a problem that caused invalid pointer error if the database path was set wrong
Expand Down
2 changes: 1 addition & 1 deletion include/countly.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Countly : public cly::CountlyDelegates {

void setDeviceID(const std::string &value, bool same_user = false);

void start(const std::string &app_key, const std::string &host, int port = -1, bool start_thread = false);
void start(const std::string &app_key, const std::string &host, int port = 0, bool start_thread = false);

void startOnCloud(const std::string &app_key);

Expand Down
5 changes: 5 additions & 0 deletions src/countly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ void Countly::start(const std::string &app_key, const std::string &host, int por
enable_automatic_session = start_thread;
start_thread = true;

if (port < 0 || port > 65535) {
log(LogLevel::WARNING, "[Countly][start] Port number is out of valid boundaries. Setting it to 0.");
port = 0;
}

configuration->port = port;
configuration->appKey = app_key;
configuration->serverUrl = host;
Expand Down
2 changes: 1 addition & 1 deletion tests/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ TEST_CASE("Validate setting configuration values") {
ct.setMaxRequestQueueSize(10);
ct.SetPath(TEST_DATABASE_NAME);
ct.setMaxRQProcessingBatchSize(10);
ct.start("YOUR_APP_KEY", "https://try.count.ly", 443, false);
ct.start("YOUR_APP_KEY", "https://try.count.ly", -1, false);

// Get configuration values using Countly getters
const CountlyConfiguration config = ct.getConfiguration();
Expand Down