From: Stefan Sperling Subject: Re: make got_pack_create write to a file descriptor To: Omar Polo Cc: gameoftrees@openbsd.org Date: Sat, 15 Oct 2022 20:28:18 +0200 On Sat, Oct 15, 2022 at 07:47:05PM +0200, Omar Polo wrote: > > The old code required a seekable output file. This conflicts with requirements > > of future gotd(8), which will write pack file data to network sockets. > > should we need to worry about possible partial writes in hwrite then? This data will be written to an AF_UNIX socket, and we write it in blocking i/o mode. As explained on IRC, the process creating the pack file is not the main gotd parent process, but a repo_read helper process which can block without causing issues. Git-protocol pkt-line framing happens in gotsh(1), which will receive the pack-file data on its socket and either stream it to its stdout directly, or, if the client supports sidebands (most clients, including 'got fetch', do support this), gotsh(1) will chunk the pack-file data into pkt-lines on the packfile data sideband.