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

Re: [PATCH] upload-pack: keep poll(2)'s timeout to -1

From
Jeff King <peff@peff.net>
Date
Aug 22, 2014, 16:03 UTC
Message-ID
<20140822160334.GA20789@peff.net>
In-Reply-To
<xmqqr408plgj.fsf@gitster.dls.corp.google.com>
On Fri, Aug 22, 2014 at 08:56:12AM -0700, Junio C Hamano wrote:
Show 20 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > Since we're now translating the keepalive value, and since there's no
> > way to set it to "0" (nor would that really have any meaning), I guess
> > we could switch the internal "no keepalive" value to 0, and do:
> >
> >   ret = poll(pfd, pollsize, keepalive ? 1000 * keepalive : -1);
> >
> > which would let us avoid setting it to -1 in some other spots.  I dunno
> > if that actually makes a real difference to maintainability, though.
> 
> Where we parse and set the value of the variable, we do this:
> 
> 	else if (!strcmp("uploadpack.keepalive", var)) {
> 		keepalive = git_config_int(var, value);
> 		if (!keepalive)
> 			keepalive = -1;
> 	}
> 
> The condition may have to become "if (keepalive <= 0)".

Yeah, I wasn't thinking we would get negative values from the user (we don't document them at all), but we should probably do something sensible. Let's just leave it at Ed's patch.

-Peff
Previous: Junio C HamanoNext: Edward Thomson
Message 4 of 8 in “upload-pack: keep poll(2)'s timeout to -1”
  1. upload-pack: keep poll(2)'s timeout to -1Edward Thomson, Aug 22, 2014
  2. Jeff KingAug 22, 2014
  3. Junio C HamanoAug 22, 2014
  4. Jeff KingAug 22, 2014
  5. Edward ThomsonAug 22, 2014
  6. Junio C HamanoAug 22, 2014
  7. Junio C HamanoAug 22, 2014
  8. Junio C HamanoAug 22, 2014

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.