public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: elfutils-devel@sourceware.org, simark@simark.ca
Subject: Re: PR25369 rfc: debuginfod client api extension for progressfn prettying etc.
Date: Tue, 25 Feb 2020 17:07:00 -0000	[thread overview]
Message-ID: <798d03de900d29cdcbd5fc5d72dea2dc74f5929c.camel@klomp.org> (raw)
In-Reply-To: <20200225153202.GB32726@redhat.com>

Hi Frank,

On Tue, 2020-02-25 at 10:32 -0500, Frank Ch. Eigler wrote:
> > > +/* Add an outgoing HTTP request  "Header: Value".  Copies string.  */
> > > +int debuginfod_add_http_header (debuginfod_client *client, const char* header);
> > 
> > This one seems different from the others and has a specific use case
> > just for the debuginfod server. Are you sure it is generic enough to be
> > added as a new public interface? If we add this can we do it separately
> > from other debuginfo-client progress improvements?
> 
> I think it has a chance to be useful to other clients too, for example
> for other proxy / authentication schemes.  And given that there is a
> shared library boundary, private APIs aren't in easy reach.
> "separately" as in separate commits? ... I suppose, if it really
> matters.

Yes, please as a separate commit. It makes it so much easier on the
reviewers if the patches are smaller.

The reason I am slightly hesitant is because this feels like a feature
with corner cases that might not be clear. What about other headers
than Agent string if they have been set/will be set for example.

Could you expand a little on the use case? I see you set an X-
Forwarded-For header, but that seems it can be easily forged. I see it
might be interesting for testing, but would you use it in production?

> > > +/* Return currently active URL, if known.  String owned by curl, do not free.  */
> > > +const char* debuginfod_get_url (debuginfod_client *client);
> > 
> > This does seem useful with the comment that was already made, that
> > lifetime of the returned string should be documented. I assume it is
> > valid to call this after debuginfod_find_* has returned, but before
> > debuginfod_end has been called?
> 
> Clarified this in a followup patch.  No, only valid during the progress
> callback function itself.

That is a pity, it seems useful without having to add a progress
function. Then we should probably make sure it doesn't return a value
in that case, because I suspect people will use it otherwise and will
complain if we break it later.

But if we can make it work when the target_handle is valid, that would
be nice.

> > > +/* Set the user parameter.  */
> > > +void debuginfod_set_user_data (debuginfod_client *client, void *value);
> > > +
> > > +/* Get the user parameter.  */
> > > +void* debuginfod_get_user_data (debuginfod_client *client);
> > 
> > In theory I like these additions. But I don't really see the point of
> > how they are used. Is the only use case to pass the string "Progress"?
> 
> That is for test coverage.

Better to have a "real" test imho. Or at least comment it, so someone
doesn't clean up the code.

> > If there are no real users for this then I think we should not add
> > these at this time. Or is some other client using them? I am not
> > really
> > against it, but would prefer if we add them separately to keep the
> > patches concise.
> 
> GDB would use them pretty much immediately, to be able to prepare a
> more informative progress notification (like the file name whose
> debuginfo is being sought, instead of its buildid).

OK. Yes, that seems like a good use case.
But can we add this as a separate feature in a separate commit?

Thanks,

Mark

  reply	other threads:[~2020-02-25 17:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25  3:35 Frank Ch. Eigler
2020-02-25  3:50 ` Simon Marchi
2020-02-25 15:25 ` Mark Wielaard
2020-02-25 15:32   ` Frank Ch. Eigler
2020-02-25 17:07     ` Mark Wielaard [this message]
2020-02-25 18:51       ` Frank Ch. Eigler
2020-03-20  0:31         ` PR25369 rfc slice 1: debuginfod_get/set_user_data Frank Ch. Eigler
2020-03-22 16:08           ` Mark Wielaard
2020-03-22 18:09             ` Frank Ch. Eigler

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=798d03de900d29cdcbd5fc5d72dea2dc74f5929c.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    --cc=simark@simark.ca \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).