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 QNETWORKREPLY_P_H
6#define QNETWORKREPLY_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/qtnetworkglobal_p.h>
20#include "qnetworkrequest.h"
21#include "qnetworkrequest_p.h"
22#include "qnetworkreply.h"
23#include "QtCore/qpointer.h"
24#include <QtCore/QElapsedTimer>
25#include "private/qiodevice_p.h"
26
27QT_BEGIN_NAMESPACE
28
29class QNetworkReplyPrivate: public QIODevicePrivate, public QNetworkHeadersPrivate
30{
31public:
32 enum State {
33 Idle, // The reply is idle.
34 Buffering, // The reply is buffering outgoing data.
35 Working, // The reply is uploading/downloading data.
36 Finished, // The reply has finished.
37 Aborted, // The reply has been aborted.
38 };
39
40 QNetworkReplyPrivate();
41 QNetworkRequest request;
42 QNetworkRequest originalRequest;
43 QUrl url;
44 QPointer<QNetworkAccessManager> manager;
45 qint64 readBufferMaxSize;
46 QElapsedTimer downloadProgressSignalChoke;
47 QElapsedTimer uploadProgressSignalChoke;
48 bool emitAllUploadProgressSignals;
49 const static int progressSignalInterval;
50 QNetworkAccessManager::Operation operation;
51 QNetworkReply::NetworkError errorCode;
52 bool isFinished;
53
54 static inline void setManager(QNetworkReply *reply, QNetworkAccessManager *manager)
55 { reply->d_func()->manager = manager; }
56
57 Q_DECLARE_PUBLIC(QNetworkReply)
58};
59
60QT_END_NAMESPACE
61
62#endif
63

source code of qtbase/src/network/access/qnetworkreply_p.h