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
|
||||
*/
|
||||
|
||||
#include <QtCore>
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
#ifdef NEED_APPLINK
|
||||
|
||||
#define APPLINK_STDIN 1
|
||||
#define APPLINK_STDOUT 2
|
||||
|
|
|
@ -996,23 +996,21 @@ ShellIPC::ShellIPC(const QStringList &args, bool supressErr, QObject *parent) :
|
|||
|
||||
bool ShellIPC::connectToHost()
|
||||
{
|
||||
auto pipeInfo = QFileInfo(QDir::tempPath() + "/" + HOST_CONTROL_PIPE);
|
||||
auto pipeInfo = QFileInfo(HOST_CONTROL_PIPE);
|
||||
|
||||
if (!pipeInfo.exists())
|
||||
{
|
||||
if (!holdErrs)
|
||||
{
|
||||
QTextStream(stdout) << "" << Qt::endl << "A host instance is not running." << Qt::endl << Qt::endl;
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
if (error() == QLocalSocket::ServerNotFoundError)
|
||||
{
|
||||
QTextStream(stdout) << "err: Reason - Host instance not running." << Qt::endl << Qt::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
QTextStream(stdout) << "err: Reason - " << errorString() << Qt::endl << Qt::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
src/db.h
2
src/db.h
|
@ -39,7 +39,7 @@
|
|||
#include "shell.h"
|
||||
|
||||
#define APP_NAME "MRCI"
|
||||
#define APP_VER "4.0.2.0"
|
||||
#define APP_VER "4.1.2.0"
|
||||
#define APP_TARGET "mrci"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
#define NEED_APPLINK
|
||||
extern "C"
|
||||
{
|
||||
// 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);
|
||||
|
||||
controlPipePath = controlPipe->fullServerName();
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
auto controlPipePath = controlPipe->fullServerName();
|
||||
|
||||
if (QFile::exists(controlPipePath))
|
||||
{
|
||||
QFile::remove(controlPipePath);
|
||||
|
|
|
@ -37,7 +37,6 @@ private:
|
|||
char *hostLoad;
|
||||
QList<QSslCertificate> sslChain;
|
||||
QSslKey sslKey;
|
||||
QString controlPipePath;
|
||||
QString hostKey;
|
||||
QString wanIP;
|
||||
quint32 maxSessions;
|
||||
|
|
Loading…
Reference in New Issue
Block a user