git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] http-backend: Don't infinite loop during die()

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 24, 2010, 21:37 UTC
Message-ID
<7veij91jvb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100324200658.GA22505@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
> Just exit(0) if dead is true.
heh, very true.
-- >8 --
Subject: [PATCH] fixup! http-backend.c: Don't infinite loop

Now die_webcgi() actually can return during a recursive call into it, causing

    http-backend.c:554: error: 'noreturn' function does return

The only reason we would come back to the die handler is because we failed during it, so we cannot report anything anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 http-backend.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/http-backend.c b/http-backend.c
index f4d49b6..5e3f277 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -549,8 +549,8 @@ static NORETURN void die_webcgi(const char *err, va_list params)
 		http_status(500, "Internal Server Error");
 		hdr_nocache();
 		end_headers();
-		exit(0);
 	}
+	exit(0); /* keep apache happy */
 }
 
 static char* getdir(void)
Previous: Shawn Pearce
Message 9 of 9 in “git clone over smart-http hanging for just one repo.”
  1. Brady CathermanMar 22, 2010
  2. Shawn O. PearceMar 22, 2010
  3. http-backend: Don't infinite loop during die()Shawn O. Pearce, Mar 22, 2010
  4. Junio C HamanoMar 22, 2010
  5. Junio C HamanoMar 24, 2010
  6. Shawn O. PearceMar 24, 2010
  7. Nicolas PitreMar 24, 2010
  8. Shawn PearceMar 24, 2010
  9. Junio C HamanoMar 24, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.