From 5ffad15367e2f5f4db5e36f8ded91e0701d71c40 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 12 Jan 2022 16:26:01 +0100 Subject: [PATCH] CPaster: Do not fail to paste after connection check dpaste allows one request per second, but we perform a connection check before sending the paste request. This happens too fast and lets the paste fail for the first time. Skip the configuration check as the user gets an error message if it fails. Fixes: QTCREATORBUG-26717 Change-Id: I5661055c0d3ed0894db170c0570a7501af34214e Reviewed-by: Christian Kandeler --- src/plugins/cpaster/dpastedotcomprotocol.cpp | 7 +++---- src/plugins/cpaster/dpastedotcomprotocol.h | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/plugins/cpaster/dpastedotcomprotocol.cpp b/src/plugins/cpaster/dpastedotcomprotocol.cpp index da9863bb4d6..847ce8cdb1a 100644 --- a/src/plugins/cpaster/dpastedotcomprotocol.cpp +++ b/src/plugins/cpaster/dpastedotcomprotocol.cpp @@ -140,11 +140,10 @@ void DPasteDotComProtocol::paste( }); } -bool DPasteDotComProtocol::checkConfiguration(QString *errorMessage) +bool DPasteDotComProtocol::checkConfiguration(QString * /*errorMessage*/) { - if (!m_hostKnownOk) - m_hostKnownOk = httpStatus(baseUrl(), errorMessage); - return m_hostKnownOk; + // we need a 1s gap between requests, so skip status check to avoid failing + return true; } void DPasteDotComProtocol::reportError(const QString &message) diff --git a/src/plugins/cpaster/dpastedotcomprotocol.h b/src/plugins/cpaster/dpastedotcomprotocol.h index 9b39052d8cb..363c42153bc 100644 --- a/src/plugins/cpaster/dpastedotcomprotocol.h +++ b/src/plugins/cpaster/dpastedotcomprotocol.h @@ -51,8 +51,6 @@ private: bool checkConfiguration(QString *errorMessage) override; static void reportError(const QString &message); - - bool m_hostKnownOk = false; }; } // namespace CodePaster