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

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:02:19

Jeff King [off-list ref] 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)".
Either way:

  Acked-by: Jeff King [off-list ref]

-Peff
Yeah, either way, the patch as-posted is good.  Thanks.

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

From: Jeff King <hidden>
Date: 2016-06-15 23:02:19

On Fri, Aug 22, 2014 at 08:56:12AM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
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

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

From: Edward Thomson <hidden>
Date: 2016-06-15 23:02:19

On Fri, Aug 22, 2014 at 12:03:34PM -0400, Jeff King wrote:
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.
Thanks, both.  Apologies for the dumb question: is there anything
additional that I need to do (repost with your Acked-by, for example)
or is this adequate as-is?

Thanks-
-ed
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help