summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/grpc/doc/src/qtgrpc-shared.qdocinc9
-rw-r--r--src/grpc/qgrpccalloptions.cpp7
-rw-r--r--src/grpc/qgrpcchanneloptions.cpp4
-rw-r--r--src/grpc/qgrpcoperation.cpp3
4 files changed, 16 insertions, 7 deletions
diff --git a/src/grpc/doc/src/qtgrpc-shared.qdocinc b/src/grpc/doc/src/qtgrpc-shared.qdocinc
index cede8ec2..d8bd4506 100644
--- a/src/grpc/doc/src/qtgrpc-shared.qdocinc
+++ b/src/grpc/doc/src/qtgrpc-shared.qdocinc
@@ -26,3 +26,12 @@
\l{QGrpcOperation::} {finished} signal is emitted. After receiving this
signal, the handler can be safely reassigned or destroyed.
//! [rpc-lifetime-note]
+
+//! [http2-metadata-note]
+ \note QGrpcHttp2Channel transports metadata as HTTP/2 headers. \b{Keys} are
+ case-insensitive ASCII strings. You must avoid using the internal prefixes:
+ \c{:} (pseudo-header), \c{grpc-}, or \c{qtgrpc-}. \b{Values} may be either
+ ASCII strings or binary data. For more information, see
+ \l{https://www.rfc-editor.org/rfc/rfc7540.html#section-8.1.2}{RFC 7540,
+ Section 8.1.2}.
+//! [http2-metadata-note]
diff --git a/src/grpc/qgrpccalloptions.cpp b/src/grpc/qgrpccalloptions.cpp
index a75c83cc..4dc9d067 100644
--- a/src/grpc/qgrpccalloptions.cpp
+++ b/src/grpc/qgrpccalloptions.cpp
@@ -125,10 +125,7 @@ QGrpcCallOptions &QGrpcCallOptions::setDeadlineTimeout(std::chrono::milliseconds
Sets the client \a metadata for a specific RPC and returns a reference to the
updated object.
-//! [set-metadata-desc]
- QGrpcHttp2Channel converts the metadata into appropriate HTTP/2 headers
- which will be added to the HTTP/2 request.
-//! [set-metadata-desc]
+ \include qtgrpc-shared.qdocinc http2-metadata-note
\note Setting this field overrides the value set by
QGrpcChannelOptions::setMetadata() for a specific RPC.
@@ -171,6 +168,8 @@ std::optional<std::chrono::milliseconds> QGrpcCallOptions::deadlineTimeout() con
Returns the client metadata for a specific RPC.
If this field is unset, returns empty metadata.
+
+ \include qtgrpc-shared.qdocinc http2-metadata-note
*/
const QHash<QByteArray, QByteArray> &QGrpcCallOptions::metadata() const & noexcept
{
diff --git a/src/grpc/qgrpcchanneloptions.cpp b/src/grpc/qgrpcchanneloptions.cpp
index 37959b4b..c6200c74 100644
--- a/src/grpc/qgrpcchanneloptions.cpp
+++ b/src/grpc/qgrpcchanneloptions.cpp
@@ -127,7 +127,7 @@ QGrpcChannelOptions &QGrpcChannelOptions::setDeadlineTimeout(std::chrono::millis
Sets the client \a metadata for the channel and returns a reference to the
updated object.
- \include qgrpccalloptions.cpp set-metadata-desc
+ \include qtgrpc-shared.qdocinc http2-metadata-note
\note The metadata set via the channel options applies to all RPCs that
operate on the channel, except those overridden by
@@ -189,6 +189,8 @@ std::optional<std::chrono::milliseconds> QGrpcChannelOptions::deadlineTimeout()
Returns the client metadata for the channel.
If this field is unset, returns empty metadata.
+
+ \include qtgrpc-shared.qdocinc http2-metadata-note
*/
const QHash<QByteArray, QByteArray> &QGrpcChannelOptions::metadata() const & noexcept
{
diff --git a/src/grpc/qgrpcoperation.cpp b/src/grpc/qgrpcoperation.cpp
index 922c36f4..6d6e5705 100644
--- a/src/grpc/qgrpcoperation.cpp
+++ b/src/grpc/qgrpcoperation.cpp
@@ -158,8 +158,7 @@ void QGrpcOperation::cancel()
/*!
Returns the server metadata received from the channel.
- \note For \l {QGrpcHttp2Channel} {HTTP/2 channels} it usually includes the
- HTTP headers received from the server.
+ \include qtgrpc-shared.qdocinc http2-metadata-note
*/
const QHash<QByteArray, QByteArray> &QGrpcOperation::metadata() const & noexcept
{