blob: 85c4f76bf3124536f8e9286aa708cb4615a0ece1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#ifndef GEMINICLIENT_HPP
#define GEMINICLIENT_HPP
#include <QObject>
#include <QMimeType>
#include <QSslSocket>
#include <QUrl>
#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<QSslError> &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
|