Skip to content

Delay PostUploadPack response until request is fully read

Sami Hiltunen requested to merge smh-fix-write-before-read into master

Git and Gitaly stream upload-pack response data as soon as it is available. Some HTTP clients do not support the response being streamed back while the server is still reading from the request body. To avoid this, the request was buffered in to a temporary file before passing it to Gitaly for handling. The buffer had a maximum size of 10MB, which is now reached by requests to large repositories. These requests were then truncated, causing Git to fail.

This commit fixes the problem by removing the request buffering and the maximum size. Instead, the response is buffered in to a temporary file until the request body is fully read, thus avoiding the problem of streaming the request and the response simultaneously.

Closes #258 (closed)

Merge request reports