Bug fixes for Windows
fixed a bug in windows that caused the application to fail detect that there is a host instance running when there is indeed a host instance running. also fixed a compile bug that cause QtCore to double import and in turn call out duplicate definition errors in windows when including applink.c.
This commit is contained in:
parent
8a06b5a186
commit
50cd138045
|
@ -7,9 +7,7 @@
|
||||||
* https://www.openssl.org/source/license.html
|
* https://www.openssl.org/source/license.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QtCore>
|
#ifdef NEED_APPLINK
|
||||||
|
|
||||||
#ifdef Q_OS_WINDOWS
|
|
||||||
|
|
||||||
#define APPLINK_STDIN 1
|
#define APPLINK_STDIN 1
|
||||||
#define APPLINK_STDOUT 2
|
#define APPLINK_STDOUT 2
|
||||||
|
|
|
@ -996,23 +996,21 @@ ShellIPC::ShellIPC(const QStringList &args, bool supressErr, QObject *parent) :
|
||||||
|
|
||||||
bool ShellIPC::connectToHost()
|
bool ShellIPC::connectToHost()
|
||||||
{
|
{
|
||||||
auto pipeInfo = QFileInfo(QDir::tempPath() + "/" + HOST_CONTROL_PIPE);
|
auto pipeInfo = QFileInfo(HOST_CONTROL_PIPE);
|
||||||
|
|
||||||
if (!pipeInfo.exists())
|
connectToServer(HOST_CONTROL_PIPE);
|
||||||
|
|
||||||
|
if (!waitForConnected() && !holdErrs)
|
||||||
{
|
{
|
||||||
if (!holdErrs)
|
QTextStream(stdout) << "" << Qt::endl << "err: Failed to connect to the host instance control pipe." << Qt::endl;
|
||||||
|
|
||||||
|
if (error() == QLocalSocket::ServerNotFoundError)
|
||||||
{
|
{
|
||||||
QTextStream(stdout) << "" << Qt::endl << "A host instance is not running." << Qt::endl << Qt::endl;
|
QTextStream(stdout) << "err: Reason - Host instance not running." << Qt::endl << Qt::endl;
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
|
||||||
{
|
|
||||||
connectToServer(HOST_CONTROL_PIPE);
|
|
||||||
|
|
||||||
if (!waitForConnected() && !holdErrs)
|
|
||||||
{
|
{
|
||||||
QTextStream(stdout) << "" << Qt::endl << "err: Failed to connect to the host instance control pipe." << Qt::endl;
|
QTextStream(stdout) << "err: Reason - " << errorString() << Qt::endl << Qt::endl;
|
||||||
QTextStream(stdout) << "err: Reason - " << errorString() << Qt::endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
src/db.h
2
src/db.h
|
@ -39,7 +39,7 @@
|
||||||
#include "shell.h"
|
#include "shell.h"
|
||||||
|
|
||||||
#define APP_NAME "MRCI"
|
#define APP_NAME "MRCI"
|
||||||
#define APP_VER "4.0.2.0"
|
#define APP_VER "4.1.2.0"
|
||||||
#define APP_TARGET "mrci"
|
#define APP_TARGET "mrci"
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
// <http://www.gnu.org/licenses/>.
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#ifdef Q_OS_WINDOWS
|
#ifdef Q_OS_WINDOWS
|
||||||
|
#define NEED_APPLINK
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
// applink.c was copied from the openssl lib and slightly modified so
|
// applink.c was copied from the openssl lib and slightly modified so
|
||||||
|
|
|
@ -66,10 +66,10 @@ bool TCPServer::createPipe()
|
||||||
{
|
{
|
||||||
auto ret = controlPipe->listen(HOST_CONTROL_PIPE);
|
auto ret = controlPipe->listen(HOST_CONTROL_PIPE);
|
||||||
|
|
||||||
controlPipePath = controlPipe->fullServerName();
|
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
|
auto controlPipePath = controlPipe->fullServerName();
|
||||||
|
|
||||||
if (QFile::exists(controlPipePath))
|
if (QFile::exists(controlPipePath))
|
||||||
{
|
{
|
||||||
QFile::remove(controlPipePath);
|
QFile::remove(controlPipePath);
|
||||||
|
|
|
@ -37,7 +37,6 @@ private:
|
||||||
char *hostLoad;
|
char *hostLoad;
|
||||||
QList<QSslCertificate> sslChain;
|
QList<QSslCertificate> sslChain;
|
||||||
QSslKey sslKey;
|
QSslKey sslKey;
|
||||||
QString controlPipePath;
|
|
||||||
QString hostKey;
|
QString hostKey;
|
||||||
QString wanIP;
|
QString wanIP;
|
||||||
quint32 maxSessions;
|
quint32 maxSessions;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user