Skip to content

Commit

Permalink
Merge pull request #188 from learningequality/server-pid-port-info-li…
Browse files Browse the repository at this point in the history
…ne-no-while-loops-necessary-hopefully-this-fixes-the-issue-cross-your-fingers

Only use second line of `server.pid` for port info
  • Loading branch information
rtibbles committed May 13, 2021
2 parents a55fb87 + bdc64db commit b49061c
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 b49061c

Please sign in to comment.