ucb: webdav-curl: don't read from XInputStream during upload
commitd9c891b5b84a2a0b7ab7cce3aa176e2e362c69ce
authorMichael Stahl <michael.stahl@allotropia.de>
Fri, 26 Nov 2021 18:20:37 +0000 (26 19:20 +0100)
committerMichael Stahl <michael.stahl@allotropia.de>
Mon, 29 Nov 2021 18:02:43 +0000 (29 19:02 +0100)
tree6d26e5dea7678970a1c456ea267fce70c5eb742c
parent5ac3106bf80c91ef71446b51a90fdc0025e10f7b
ucb: webdav-curl: don't read from XInputStream during upload

Nextcloud will reply to a PROPFIND request with "100 Continue" and then
after the data is uploaded it will send a "401 Unauthorized" if the
auth header is missing in the headers to which it replied with "100
Continue".

In the next call to ProcessRequestImpl(), reading from the stream
returns no data because it's at EOF, and because of the Content-Length
header the server will hang forever waiting for data.

So copy the stream to a temporary buffer and use that for multiple
calls to ProcessRequestImpl().

Change-Id: If5943a32c4cf50259fe1f84013141765cb5bd891
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125923
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit 2fae5ab2a8cefa758c631d6ae23847089b68800d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126003
ucb/source/ucp/webdav-curl/CurlSession.cxx