From: Tay Ray Chuan <rctay89@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] http: add_fill_function checks if function has been added
Date: Sun, 8 Mar 2009 18:27:17 +0800 [thread overview]
Message-ID: <be6fef0d0903080327u551c0b4mcb86f2ba76473efc@mail.gmail.com> (raw)
In-Reply-To: <7vd4ctm29m.fsf@gitster.siamese.dyndns.org>
Hi,
On Sun, Mar 8, 2009 at 5:49 AM, Junio C Hamano <gitster@pobox.com> wrote:
> I didn't look at the callers of add_fill_function(), but "fill" takes a
> callback data and different invocation of add_fill_function() could be
> passing different callback data. In such a case, doesn't it feel wrong to
> omit the "duplicated" calls to register the fill callback? Your patch
> makes me suspect that it _might_ be better to fix the callers not to call
> the function repeatedly when they know they only want one-shot invocation.
Omitting duplicate calls in fill_active_slots does not mean that
repeated calls of the fill functions won't take place.
In the current use instances in http-push and http-walker,
run_active_slot and finish_all_active_slots (which calls
run_active_slot) will always be called, because they are the functions
that actually start the http requests[1], and that means the fill
functions will be called repeated, because
run_active_slot, in its while loop, repeatedly calls
step_active_slots calls
fill_active_slots calls
our fill functions.
fill_active_slots is the only direct caller of fill functions
(duplicate ones included).
So we can be sure that the fill functions are called repeatedly (at
least for the slot's active duration).
[1] Actually calling step_active_slots will start http requests,
without you having to call run_active_slot.
--
Cheers,
Ray Chuan
next prev parent reply other threads:[~2009-03-08 10:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-07 12:21 [PATCH] http: add_fill_function checks if function has been added Tay Ray Chuan
2009-03-07 20:18 ` Junio C Hamano
2009-03-07 20:49 ` Tay Ray Chuan
2009-03-07 21:49 ` Junio C Hamano
2009-03-08 10:27 ` Tay Ray Chuan [this message]
2009-03-08 19:38 ` Junio C Hamano
2009-03-09 12:01 ` Tay Ray Chuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=be6fef0d0903080327u551c0b4mcb86f2ba76473efc@mail.gmail.com \
--to=rctay89@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).