1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QHTTPSERVERRESPONDER_P_H
6#define QHTTPSERVERRESPONDER_P_H
7
8#include <QtHttpServer/qthttpserverglobal.h>
9#include <QtHttpServer/qhttpserverrequest.h>
10#include <QtHttpServer/qhttpserverresponder.h>
11
12#include <private/qhttpserverstream_p.h>
13
14#include <QtCore/qcoreapplication.h>
15#include <QtCore/qpair.h>
16#include <QtCore/qpointer.h>
17#include <QtCore/qsysinfo.h>
18
19#include <type_traits>
20
21//
22// W A R N I N G
23// -------------
24//
25// This file is not part of the Qt API. It exists for the convenience
26// of QHttpServer. This header file may change from version to
27// version without notice, or even be removed.
28//
29// We mean it.
30
31QT_BEGIN_NAMESPACE
32
33class QHttpServerResponderPrivate
34{
35public:
36 QHttpServerResponderPrivate(QHttpServerStream *stream);
37 ~QHttpServerResponderPrivate();
38
39 void write(const QByteArray &body, const QHttpHeaders &headers,
40 QHttpServerResponder::StatusCode status);
41 void write(QHttpServerResponder::StatusCode status);
42 void write(QIODevice *data, const QHttpHeaders &headers,
43 QHttpServerResponder::StatusCode status);
44 void writeBeginChunked(const QHttpHeaders &headers, QHttpServerResponder::StatusCode status);
45 void writeChunk(const QByteArray &body);
46 void writeEndChunked(const QByteArray &data, const QHttpHeaders &trailers);
47
48#if defined(QT_DEBUG)
49 const QPointer<QHttpServerStream> stream;
50#else
51 QHttpServerStream *const stream;
52#endif
53 quint32 m_streamId = 0;
54};
55
56QT_END_NAMESPACE
57
58#endif // QHTTPSERVERRESPONDER_P_H
59

source code of qthttpserver/src/httpserver/qhttpserverresponder_p.h