aboutsummaryrefslogtreecommitdiff
path: root/git_hooks_client (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-02-18hooks: Fix the race condition that causes EPIPERunxi Yu1-0/+10
The hooks handler in the main daemon didn't wait for the hook client to write fully, and sometimes prematurely closes the connection, causing the hook client's splice to return EPIPE (or SIGPIPE if the signal handler wasn't installed). To remedy this, we call shutdown(sock, SHUT_WR) in the client, so that attempts to read on the server side return EOF. Then we can simply use io.Copy(&buf, conn) on the server side to fetch all of the data into a buffer.
2025-02-18git_hooks_client.c: Ignore SIGPIPERunxi Yu1-0/+6
2025-02-18git_hooks_client.c: Allow ECONNRESET when splicing sock -> stderrRunxi Yu1-1/+2
Not exactly sure what's happening, but it looks like conn.Close() in Go sometimes produces an ECONNRESET in here.
2025-02-17hooks, etc.: Authenticate hooks, and handle them in the spawning threadRunxi Yu1-1/+28
2025-02-17git_hooks_client: Send argc/argv over the UNIX domain socketRunxi Yu1-5/+34
2025-02-17git_hooks_client.c: Explain the code in more detailRunxi Yu1-7/+28
2025-02-17git_hooks_client.c: Splice socket to stderrRunxi Yu1-15/+42
This allows the daemon to send status messages to the hook handler.
2025-02-17git_hooks_client.c: Clarify error messagesRunxi Yu1-10/+10
2025-02-17git_hooks_client.c: Get return value from unix socketRunxi Yu1-1/+20
2025-02-17git_hooks_client: Restructure for clarityRunxi Yu1-23/+28
2025-02-17git_hooks_client: Produce useful error message on missing env varRunxi Yu1-0/+1
2025-02-17git_hooks_client: Ensure stdin is a pipeRunxi Yu1-1/+22
2025-02-17*: Restructure build systemRunxi Yu1-3/+0
2025-02-17git_hooks_client: Splice stdinRunxi Yu2-10/+15
Requires stdin to be a pipe. So `cat | ./git_hooks_client` works while `./git_hooks_client` in a terminal directly does not (character devices are not pipes).
2025-02-17git_hooks{.go,_client}: Add stub for git hook clientsRunxi Yu3-0/+45