All pastes #1470864 Raw Edit

Jemand

public diff v1 · immutable
#1470864 ·published 2009-06-23 08:37 UTC
rendered paste body
Index: qw_server/main.cpp===================================================================--- qw_server/main.cpp	(revision 257)+++ qw_server/main.cpp	(working copy)@@ -16,7 +16,6 @@ #include <QtDebug> #include <QSqlQuery> - const QString QWSERVER_VERSION("0.1.0");  int main(int argc, char *argv[])Index: qw_server/QwsServerController.cpp===================================================================--- qw_server/QwsServerController.cpp	(revision 257)+++ qw_server/QwsServerController.cpp	(working copy)@@ -265,16 +265,18 @@     QProcess createCommand;     QStringList commandArguments;     commandArguments << "req" << "-x509"-              << "-newkey" << "rsa:1024" << "-subj"-              << QString("/CN=%1").arg(QHostInfo::localHostName())+              << "-newkey" << "rsa:1024"+              << "-subj" << QString("/CN=%1").arg(QHostInfo::localHostName())               << "-days" << "365" << "-nodes"               << "-keyout" << tempFile.fileName() << "-out" << tempFile.fileName(); -    qDebug() << commandArguments;+    qDebug() << "Creating new SSL certificate at" << tempFile.fileName() << "|" << commandArguments;+     createCommand.start("openssl", commandArguments);+    createCommand.setStandardOutputFile("stdout.txt");     createCommand.waitForFinished();-    qDebug() << "Creating new SSL certificate at" << tempFile.fileName() << "|" << commandArguments; +     if (createCommand.exitCode() != 0 ) {         qDebug() << "OpenSSL failed:" << createCommand.errorString() << createCommand.readAllStandardError();         return false;@@ -305,7 +307,7 @@     clientSocket->user.userIpAddress = clientSocket->socket->peerAddress().toString();     clientSocket->resolveHostname(); -    qwLog(tr("[%1] Accepted new transfer connection from %2")+    qwLog(tr("[%1] Accepted new session connection from %2")           .arg(clientSocket->user.pUserID)           .arg(newSocket->peerAddress().toString())); Index: qw_server_gui/QwmMonitorController.cpp===================================================================--- qw_server_gui/QwmMonitorController.cpp	(revision 257)+++ qw_server_gui/QwmMonitorController.cpp	(working copy)@@ -31,6 +31,12 @@ }  +QwmMonitorController::~QwmMonitorController()+{+    daemonProcess.kill();+}++ /*! Initialize the monitor window and display it to the user. */ void QwmMonitorController::startMonitor()@@ -62,30 +68,38 @@ {     QStringList procArguments;     procArguments << "-remote"; // Enable remote-mode-    procArguments << "-root" << QDir(qApp->applicationDirPath()).cleanPath("../../../"); +     QString command;  #ifdef Q_OS_WIN32-    command = "./qwired_server.exe";+    command = "qwired_server.exe"; #elif defined(Q_OS_LINUX)     command = "./qwired_server"; #elif defined(Q_OS_MAC)     // On Mac OS X the server binary is within the bundle.     command = QDir(qApp->applicationDirPath()).absoluteFilePath("qwired_server");+    // Root is outside of the bundle by default.+    procArguments << "-root" << QDir(qApp->applicationDirPath()).cleanPath("../../../"); #endif +    qDebug() << command << procArguments;     daemonProcess.start(command, procArguments); }  +/*! Stop the daemon process by killing it.+*/ void QwmMonitorController::stopDaemonProcess() {     if (QMessageBox::question(monitorWindow, tr("Stop Server"),                               tr("Are you sure you want to shut down the server?"),                               QMessageBox::Yes | QMessageBox::No,                               QMessageBox::No) == QMessageBox::Yes) {-        daemonProcess.terminate();+        qDebug() << "Terminating daemon.";+        daemonProcess.kill();+        daemonProcess.waitForFinished();+        qDebug() << "Terminated";     } } @@ -107,9 +121,9 @@     handleLogMessage(tr("Server daemon terminated with a status of %1.").arg(exitCode));     monitorWindow->btnStartServer->setEnabled(true);     monitorWindow->btnStopServer->setEnabled(false);-     monitorWindow->btnRebuildIndex->setEnabled(false);     socket->resetSocket();+ }  Index: qw_server_gui/QwmMonitorController.h===================================================================--- qw_server_gui/QwmMonitorController.h	(revision 257)+++ qw_server_gui/QwmMonitorController.h	(working copy)@@ -37,6 +37,7 @@  public:     QwmMonitorController(QObject *parent=0);+    ~QwmMonitorController();  public slots:     void startMonitor();