Skip to content

Commit

Permalink
Merge pull request #1412 from nonlinear-chaos-order-etc/openssl
Browse files Browse the repository at this point in the history
qt: disabled broken UPnP + small qt debugging tweaks
  • Loading branch information
orignal committed Aug 27, 2019
2 parents e42efec + d523f0c commit a2b8d46
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
4 changes: 3 additions & 1 deletion qt/i2pd_qt/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ i2pd_qt
Makefile*
*.stash
object_script.*
i2pd_qt_plugin_import.cpp
i2pd_qt_plugin_import.cpp
i2pd_qt.pro.autosave*

12 changes: 10 additions & 2 deletions qt/i2pd_qt/DaemonQT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <QMutexLocker>
#include <QThread>

//#define DEBUG_WITH_DEFAULT_LOGGING (1)

namespace i2p
{
namespace qt
Expand Down Expand Up @@ -151,10 +153,16 @@ namespace qt
int result;

{
std::shared_ptr<std::iostream> logstreamptr=std::make_shared<std::stringstream>();
std::shared_ptr<std::iostream> logstreamptr=
#ifdef DEBUG_WITH_DEFAULT_LOGGING
nullptr
#else
std::make_shared<std::stringstream>()
#endif
;
//TODO move daemon init deinit to a bg thread
DaemonQTImpl daemon;
(*logstreamptr) << "Initialising the daemon..." << std::endl;
if(logstreamptr) (*logstreamptr) << "Initialising the daemon..." << std::endl;
bool daemonInitSuccess = daemon.init(argc, argv, logstreamptr);
if(!daemonInitSuccess)
{
Expand Down
7 changes: 6 additions & 1 deletion qt/i2pd_qt/i2pd_qt.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = i2pd_qt
TEMPLATE = app
QMAKE_CXXFLAGS *= -std=c++11 -Wno-unused-parameter -Wno-maybe-uninitialized
DEFINES += USE_UPNP

# For now, disable UPnP which currently crashes on Stop() -- https://github.com/PurpleI2P/i2pd/issues/1387
#DEFINES += USE_UPNP
DEFINES -= USE_UPNP

debug: DEFINES += DEBUG_WITH_DEFAULT_LOGGING

SOURCES += DaemonQT.cpp mainwindow.cpp \
../../libi2pd/api.cpp \
Expand Down
2 changes: 1 addition & 1 deletion qt/i2pd_qt/logviewermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace logviewer {

QString Worker::pollAndShootATimerForInfiniteRetries() {
std::shared_ptr<std::iostream> logStream=logViewerManager.getLogStream();
assert(logStream!=nullptr);
if(!logStream)return "";
std::streamsize MAX_SZ=64*1024;
char*buf=(char*)malloc(MAX_SZ*sizeof(char));
if(buf==nullptr)return "";
Expand Down

0 comments on commit a2b8d46

Please sign in to comment.