From 75ec461eeaa851cb5c53f4cfffc434e3e529ed1d Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Mon, 22 Jun 2020 21:10:04 +0200 Subject: Restructures the project source and cleans up a bit --- src/protocols/geminiclient.hpp | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/protocols/geminiclient.hpp (limited to 'src/protocols/geminiclient.hpp') diff --git a/src/protocols/geminiclient.hpp b/src/protocols/geminiclient.hpp new file mode 100644 index 0000000..85c4f76 --- /dev/null +++ b/src/protocols/geminiclient.hpp @@ -0,0 +1,55 @@ +#ifndef GEMINICLIENT_HPP +#define GEMINICLIENT_HPP + +#include +#include +#include +#include + +#include "protocolhandler.hpp" + +class GeminiClient : public ProtocolHandler +{ +private: + Q_OBJECT +public: + explicit GeminiClient(); + + ~GeminiClient() override; + + bool supportsScheme(QString const & scheme) const override; + + bool startRequest(QUrl const & url, RequestOptions options) override; + + bool isInProgress() const override; + + bool cancelRequest() override; + + bool enableClientCertificate(CryptoIdentity const & ident) override; + void disableClientCertificate() override; + +private slots: + void socketEncrypted(); + + void socketReadyRead(); + + void socketDisconnected(); + + void sslErrors(const QList &errors); + + void socketError(QAbstractSocket::SocketError socketError); + +private: + bool is_receiving_body; + bool suppress_socket_tls_error; + bool is_error_state; + + QUrl target_url; + QSslSocket socket; + QByteArray buffer; + QByteArray body; + QString mime_type; + RequestOptions options; +}; + +#endif // GEMINICLIENT_HPP -- cgit v1.2.3