commit a6c98a81a9a97c9a6ad6a9e56f5e499f18749512 from: Stefan Sperling via: Thomas Adam date: Sun May 05 09:50:52 2024 UTC attempt to fix lingering gotd processes from reading clients When reading clients close the connection early do not ignore this condition in session_read. The code removed here intended to handle the case of a writing client uploading a pack file, and thus does not belong into session_read.c. I overlooked this when splitting session.c into two files. This might fix an issue observed on got.g.o where the anonymous user was no longer connected and left lingering session_read and repo_read processes hanging around until the request timeout was reached. commit - 9e03aee7bf92a67f29dd8caedbf048d8fe17970f commit + a6c98a81a9a97c9a6ad6a9e56f5e499f18749512 blob - 8084becb0cea7d4bd7f3c8c69a6c888746b40455 blob + 8877a277156d18f991352fb9368178b931ca27e8 --- gotd/session_read.c +++ gotd/session_read.c @@ -461,15 +461,7 @@ session_dispatch_client(int fd, short events, void *ar if (events & EV_WRITE) { while (ibuf->w.queued) { n = msgbuf_write(&ibuf->w); - if (n == -1 && errno == EPIPE) { - /* - * The client has closed its socket. - * This can happen when Git clients are - * done sending pack file data. - */ - msgbuf_clear(&ibuf->w); - continue; - } else if (n == -1 && errno != EAGAIN) { + if (n == -1 && errno != EAGAIN) { err = got_error_from_errno("imsg_flush"); disconnect_on_error(client, err); return;