Skip to content
Permalink
Browse files

guard against recursive error pages

  • Loading branch information
kevinushey committed Oct 16, 2019
1 parent b2e6d0f commit 0a525b2198cd7cb460b83abd2d1e953d27220236
@@ -19,6 +19,14 @@
#include <iostream>
#include <iomanip>

#define RS_CALL_ONCE() \
do \
{ \
static bool s_once = false; \
if (s_once) return; \
s_once = true; \
} while (0)

/* Work around Xcode indentation rules */
#define RS_BEGIN_NAMESPACE(__X__) namespace __X__ {
#define RS_END_NAMESPACE(__X__) }
@@ -21,6 +21,7 @@
#include <boost/bind.hpp>
#include <boost/format.hpp>

#include <core/Macros.hpp>
#include <core/text/TemplateFilter.hpp>

#include "DesktopOptions.hpp"
@@ -522,13 +523,15 @@ void MainWindow::onLoadFinished(bool ok)
if (ok)
return;

RS_CALL_ONCE();

std::map<std::string,std::string> vars;
vars["url"] = webView()->url().url().toStdString();
std::ostringstream oss;
Error error = text::renderTemplate(options().resourcesPath().complete("html/connect.html"),
vars, oss);
if (error)
LOG_ERROR(error);
LOG_ERROR(error);
else
loadHtml(QString::fromStdString(oss.str()));
}
@@ -19,6 +19,7 @@

#include <boost/bind.hpp>

#include <core/Macros.hpp>
#include <core/http/Request.hpp>
#include <core/http/Response.hpp>
#include <core/http/TcpIpBlockingClient.hpp>
@@ -267,6 +268,8 @@ Error getRecentSessionLogs(std::string* pLogFile, std::string *pLogContents)

void SessionLauncher::showLaunchErrorPage()
{
RS_CALL_ONCE();

// String mapping of template codes to diagnostic information
std::map<std::string,std::string> vars;

0 comments on commit 0a525b2

Please sign in to comment.
You can’t perform that action at this time.