Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QNETWORKREPLYIMPL_P_H
5#define QNETWORKREPLYIMPL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of the Network Access API. This header file may change from
13// version to version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtNetwork/private/qtnetworkglobal_p.h>
19#include "qnetworkreply.h"
20#include "qnetworkreply_p.h"
22#include "qnetworkproxy.h"
23#include "QtCore/qmap.h"
24#include "QtCore/qqueue.h"
25#include "QtCore/qbuffer.h"
26#include "private/qringbuffer_p.h"
27#include "private/qbytedata_p.h"
28#include <QSharedPointer>
29
30#include <memory>
31
33
36
39{
41public:
44 virtual void abort() override;
45
46 // reimplemented from QNetworkReply / QIODevice
47 virtual void close() override;
48 virtual qint64 bytesAvailable() const override;
49 virtual void setReadBufferSize(qint64 size) override;
50
51 virtual qint64 readData(char *data, qint64 maxlen) override;
52 virtual bool event(QEvent *) override;
53
54 Q_DECLARE_PRIVATE(QNetworkReplyImpl)
55 Q_PRIVATE_SLOT(d_func(), void _q_startOperation())
59 Q_PRIVATE_SLOT(d_func(), void _q_bufferOutgoingDataFinished())
60
61#ifndef QT_NO_SSL
62protected:
63 void sslConfigurationImplementation(QSslConfiguration &configuration) const override;
64 void setSslConfigurationImplementation(const QSslConfiguration &configuration) override;
65 virtual void ignoreSslErrors() override;
66 virtual void ignoreSslErrorsImplementation(const QList<QSslError> &errors) override;
67#endif
68};
69
71{
72public:
76
78
79 void _q_startOperation();
80 void _q_copyReadyRead();
84
87
90 void backendNotify(InternalNotifications notification);
92 void createCache();
93 void completeCacheSave();
94
95 // callbacks from the backend (through the manager):
96 void setCachingEnabled(bool enable);
97 bool isCachingEnabled() const;
99 void emitUploadProgress(qint64 bytesSent, qint64 bytesTotal);
101
102 void initCacheSaveDevice();
106
107 void setDownloadBuffer(QSharedPointer<char> sp, qint64 size);
110
111 void finished();
113 void metaDataChanged();
114 void redirectionRequested(const QUrl &target);
115 void encrypted();
116 void sslErrors(const QList<QSslError> &errors);
117
118 void readFromBackend();
119
122 std::shared_ptr<QRingBuffer> outgoingDataBuffer;
125
128
129 std::vector<InternalNotifications> pendingNotifications;
131
133#ifndef QT_NO_NETWORKPROXY
135 QList<QNetworkProxy> proxyList;
136#endif
137
140
143
145
146 // Only used when the "zero copy" style is used.
147 // Please note that the whole "zero copy" download buffer API is private right now. Do not use it.
151 QSharedPointer<char> downloadBufferPointer;
153
154 Q_DECLARE_PUBLIC(QNetworkReplyImpl)
155};
157
159
160#endif
The QAbstractNetworkCache class provides the interface for cache implementations.
\inmodule QtCore
Definition qcoreevent.h:45
\inmodule QtCore \reentrant
Definition qiodevice.h:34
QNetworkAccessBackend is the base class for implementing support for schemes used by QNetworkAccessMa...
Operation
Indicates the operation this reply is processing.
The QNetworkProxy class provides a network layer proxy.
std::vector< InternalNotifications > pendingNotifications
void setDownloadBuffer(QSharedPointer< char > sp, qint64 size)
void appendDownstreamDataDownloadBuffer(qint64, qint64)
QSharedPointer< char > downloadBufferPointer
QNetworkAccessBackend * backend
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().
void void _q_copyReadChannelFinished()) Q_PRIVATE_SLOT(d_func()
QNetworkReplyImpl(QObject *parent=nullptr)
void _q_copyReadyRead()) Q_PRIVATE_SLOT(d_func()
virtual void ignoreSslErrorsImplementation(const QList< QSslError > &errors) override
void void void _q_bufferOutgoingData()) Q_PRIVATE_SLOT(d_func()
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 close down any network connections still open.
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,...
QNetworkRequest request
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager.
NetworkError
Indicates all possible error conditions found during the processing of the request.
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
The QSslConfiguration class holds the configuration and state of an SSL connection.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum target
GLboolean enable
struct _cl_event * event
#define sp
#define Q_OBJECT
#define Q_PRIVATE_SLOT(d, signature)
@ Q_PRIMITIVE_TYPE
Definition qtypeinfo.h:157
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
long long qint64
Definition qtypes.h:60
QByteArray readData()