Closed vokac closed 4 years ago
Thanks for reporting this issue.
I've been thinking about this and (from my understanding) HTTP should guarantee the integrity of the content length in HTTP PUT requests; that is, a conforming server will return a successful status code to a PUT request if and only if it has received the number of bytes the client sent. This is because a PUT request must include the Content-Length
header or use chunked encoding, both of which will detect an incomplete transfer. (As it happens, dCache always specifies Content-Length
when making a PUT request.)
Therefore, checking the file size (Content-Length) after successfully uploading a file does not make sense. This is especially true since (as you say) the Content-Length
header is optional within a HEAD response.
When I try to use dCache as a source for HTTP-TPC in push mode and destination doesn't return Content-Lenght than transfer fails with error message "verification failed: remote server failed to provide length after x.yy min"
Apache by default strip
Content-Lenth
header fromHEAD
response in case it is set to zero. This is valid behaviour, because HTTP specification for Content-Length only says that server MAY return Content-Lenght as a response toHEAD
request.This means it is currently not possible to transfer zero size files with HTTP-TPC push from DPM (Dynafed?), because this storage implementation rely on Apache for HTTP protocol. For future DPM releases workaround was implemented (LCGDM-2947) and for zero size files DPM Apache module returns
Content-Length: 00
, because this header is not filtered out by Apache core.