Skip to content

Commit

Permalink
Only use second line of server.pid for port info
Browse files Browse the repository at this point in the history
No need for a `while` loop!

Addresses #187
  • Loading branch information
micahscopes committed May 13, 2021
1 parent a55fb87 commit bdc64db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gui-source/Kolibri/Kolibri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ char * getKolibriLinkAddress() {
std::ifstream file(pidFile);
if (file.is_open()) {
std::string line;
while (getline(file, line)) {
if (isServerOnline("Kolibri session", joinChr("http://127.0.0.1:", line.c_str()))) {
httpLink = joinChr("http://127.0.0.1:", line.c_str());
}
getline(file, line); // get the first line, do nothing
getline(file, line); // the second line should have the the port information
if (isServerOnline("Kolibri session", joinChr("http://127.0.0.1:", line.c_str()))) {
httpLink = joinChr("http://127.0.0.1:", line.c_str());
}
file.close();
return httpLink;
Expand Down

0 comments on commit bdc64db

Please sign in to comment.