Commit 6b2b3d4a authored by Thomas Friedrichsmeier's avatar Thomas Friedrichsmeier
Browse files

Experimental: Another attempt at stabilizing handshake on Windows.

parent 2a37bbd7
Pipeline #174066 passed with stage
in 3 minutes and 49 seconds
......@@ -11,6 +11,8 @@ SPDX-License-Identifier: GPL-2.0-or-later
#include <QLocalSocket>
#include <iostream>
#include "../version.h"
#include "../debug.h"
......@@ -45,8 +47,13 @@ void RKRBackendTransmitter::run () {
QLocalSocket* con = new QLocalSocket (this);
con->connectToServer (servername);
setConnection (con);
if (!connection->waitForConnected ()) handleTransmissionError ("Could not connect: " + connection->errorString ());
int timeout = 0;
do {
std::cout << token.toLocal8Bit().data() << "\n";
std::cout.flush();
} while (!connection->waitForConnected(1000) && (++timeout < 20));
if (timeout >= 20) handleTransmissionError("Could not connect: " + connection->errorString());
// handshake
connection->write (token.toLocal8Bit ().data ());
connection->write ("\n");
......
......@@ -106,9 +106,6 @@ SPDX-License-Identifier: GPL-2.0-or-later
// a simple security token to send to the frontend to make sure that it is really talking to the backend process that it started in the local socket connection.
// this token is sent both via stdout and the local socket connection. The frontend simply compares both values.
QString token = QUuid::createUuid ().toString ();
std::cout << token.toLocal8Bit ().data () << "\n";
std::cout << token.toLocal8Bit ().data () << "\n";
std::cout.flush ();
RKRBackendTransmitter transmitter (servername, token);
RKRBackendProtocolBackend backend (data_dir, rkd_server_name);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment