From d9fc08c71937388cc193362f48849cb8860b2b5a Mon Sep 17 00:00:00 2001 From: Mate Barany Date: Fri, 21 Jun 2024 16:10:22 +0200 Subject: [PATCH] Add a note to QFormDataPartBuilder::setBodyDevice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the body is sequential, QNAM::post should be called after body has emitted finished. As this is already mentioned in the documentation of QHttpPart::setBodyDevice it probably won't hurt to mention it here as well. Task-number: QTBUG-125985 Change-Id: Iaa29c45b8da41a9af893523ff140afa9a0945f95 Reviewed-by: Paul Wicking Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit 704362f3dd06798c8c33ce48aa6c71fa3ac4624f) Reviewed-by: Qt Cherry-pick Bot --- src/network/access/qformdatabuilder.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/network/access/qformdatabuilder.cpp b/src/network/access/qformdatabuilder.cpp index 1d2054c9564..0428f09a813 100644 --- a/src/network/access/qformdatabuilder.cpp +++ b/src/network/access/qformdatabuilder.cpp @@ -167,6 +167,10 @@ QFormDataPartBuilder &QFormDataPartBuilder::setBody(QByteArrayView data, ownership of \a body, i.e. the device must be closed and destroyed if necessary. + \note If \a body is sequential (e.g. sockets, but not files), + QNetworkAccessManager::post() should be called after \a body has emitted + finished(). + \sa setBody(), QHttpPart::setBodyDevice() */