Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In upload-pack, wait until the client receives all the data and disco…
…nnects This fixes the issue identified in git-for-windows#304 On Windows, closing a socket destroys its OS-allocated buffer even when the latter still contains the last chunk of the data to be sent. Hence, closing the socket immediately after sending the pack results in a race condition between sending that last chunk and destroying the OS socket object. When the OS socket object is destroyed first, git-daemon fails to actually send the last chunk of the pack to the client, and the latter fails with the `early EOF` / `index-pack failed`. That is, the above race condition results in intermittent failures to clone a repository hosted on a Windows machine by git-daemon. To eliminate the race condition, `upload-pack` now sends all data and then waits until the client closes connection from its side. Signed-off-by: Oleg Gubanov <[email protected]>
- Loading branch information