Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qnetworkreplyimpl_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QNETWORKREPLYIMPL_P_H
6#define QNETWORKREPLYIMPL_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of the Network Access API. This header file may change from
14// version to version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtNetwork/private/qbytedatabuffer_p.h>
20#include "qnetworkreply.h"
23#include "qnetworkproxy.h"
24
25#include "QtCore/qmap.h"
26#include "QtCore/qqueue.h"
27#include "QtCore/qbuffer.h"
28#include "private/qringbuffer_p.h"
29#include <QSharedPointer>
30
31#include <memory>
32
33QT_BEGIN_NAMESPACE
34
35class QAbstractNetworkCache;
36class QNetworkAccessBackend;
37
40{
42public:
45 virtual void abort() override;
46
47 // reimplemented from QNetworkReply / QIODevice
48 virtual void close() override;
49 virtual qint64 bytesAvailable() const override;
50 virtual void setReadBufferSize(qint64 size) override;
51
52 virtual qint64 readData(char *data, qint64 maxlen) override;
53 virtual bool event(QEvent *) override;
54
61
62#ifndef QT_NO_SSL
63protected:
65 void setSslConfigurationImplementation(const QSslConfiguration &configuration) override;
66 virtual void ignoreSslErrors() override;
67 virtual void ignoreSslErrorsImplementation(const QList<QSslError> &errors) override;
68#endif
69};
70
71class QNetworkReplyImplPrivate: public QNetworkReplyPrivate
72{
73public:
77
79
80 void _q_startOperation();
81 void _q_copyReadyRead();
85
86 void setup(QNetworkAccessManager::Operation op, const QNetworkRequest &request,
87 QIODevice *outgoingData);
88
91 void backendNotify(InternalNotifications notification);
93 void createCache();
94 void completeCacheSave();
95
96 // callbacks from the backend (through the manager):
97 void setCachingEnabled(bool enable);
98 bool isCachingEnabled() const;
99 void consume(qint64 count);
100 void emitUploadProgress(qint64 bytesSent, qint64 bytesTotal);
102
103 void initCacheSaveDevice();
105 void appendDownstreamData(QByteDataBuffer &data);
106 void appendDownstreamData(QIODevice *data);
107
108 void setDownloadBuffer(QSharedPointer<char> sp, qint64 size);
109 char* getDownloadBuffer(qint64 size);
111
112 void finished();
113 void error(QNetworkReply::NetworkError code, const QString &errorString);
114 void metaDataChanged();
115 void redirectionRequested(const QUrl &target);
116 void encrypted();
117 void sslErrors(const QList<QSslError> &errors);
118
119 void readFromBackend();
120
121 QNetworkAccessBackend *backend;
125 QAbstractNetworkCache *networkCache() const;
126
129
132
134#ifndef QT_NO_NETWORKPROXY
137#endif
138
141
144
145 State state;
146
147 // Only used when the "zero copy" style is used.
148 // Please note that the whole "zero copy" download buffer API is private right now. Do not use it.
154
155 Q_DECLARE_PUBLIC(QNetworkReplyImpl)
156};
158
159QT_END_NAMESPACE
160
161#endif
QNetworkReplyImplPrivate * m_reply
QNetworkAccessBackend::SecurityFeatures m_securityFeatures
QNetworkAccessBackend::IOFeatures m_ioFeatures
QNetworkAccessManagerPrivate * m_manager
std::shared_ptr< QNonContiguousByteDevice > uploadByteDevice
QNetworkAccessBackend::TargetTypes m_targetTypes
QStringList backendSupportedSchemes() const
QNetworkAccessBackend * findBackend(QNetworkAccessManager::Operation op, const QNetworkRequest &request)
std::vector< InternalNotifications > pendingNotifications
void setDownloadBuffer(QSharedPointer< char > sp, qint64 size)
void error(QNetworkReply::NetworkError code, const QString &errorString)
void appendDownstreamDataDownloadBuffer(qint64, qint64)
QSharedPointer< char > downloadBufferPointer
QNetworkAccessBackend * backend
void appendDownstreamData(QIODevice *data)
void setup(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
void emitUploadProgress(qint64 bytesSent, qint64 bytesTotal)
void backendNotify(InternalNotifications notification)
std::shared_ptr< QRingBuffer > outgoingDataBuffer
QAbstractNetworkCache * networkCache() const
void appendDownstreamData(QByteDataBuffer &data)
char * getDownloadBuffer(qint64 size)
void consume(qint64 count)
void sslErrors(const QList< QSslError > &errors)
QList< QNetworkProxy > proxyList
void redirectionRequested(const QUrl &target)
void setCachingEnabled(bool enable)
virtual qint64 bytesAvailable() const override
Returns the number of bytes available for reading with QIODevice::read().
virtual qint64 readData(char *data, qint64 maxlen) override
virtual void ignoreSslErrorsImplementation(const QList< QSslError > &errors) override
virtual void setReadBufferSize(qint64 size) override
Sets the size of the read buffer to be size bytes.
virtual void close() override
Closes this device for reading.
virtual void abort() override
Aborts the operation immediately and closes any network connections still open.
virtual bool event(QEvent *) override
void void void void _q_bufferOutgoingDataFinished()) protected void setSslConfigurationImplementation(const QSslConfiguration &configuration) override
virtual void ignoreSslErrors() override
If this function is called, SSL errors related to network connection will be ignored,...
Q_DECLARE_TYPEINFO(QNetworkReplyImplPrivate::InternalNotifications, Q_PRIMITIVE_TYPE)