[aur-dev] [PATCH 4/4] rpc: allow multiple args on info query

Lukas Fleischer archlinux at cryptocrack.de
Sat Apr 16 19:52:54 EDT 2011


On Sat, Apr 16, 2011 at 06:30:46PM -0500, Dan McGee wrote:
> On Sat, Apr 16, 2011 at 11:07 AM, Lukas Fleischer
> <archlinux at cryptocrack.de> wrote:
> > On Tue, Apr 12, 2011 at 12:15:49AM -0500, Dan McGee wrote:
> >> The majority of "real world" info requests [1] come in hefty batches. We
> >> would be better served to handle these in one request rather than
> >> multiple by allowing AUR clients to send multiple arguments.
> >>
> >> This enables things like this to work:
> >>     http://aur.test/rpc.php?type=info&arg[]=cups-xerox&arg[]=cups-mc2430dl&arg[]=10673
> >>
> >> Note to RPC users: unfortunately due to the asinine design of PHP, you
> >> unfortunately have to use the 'arg[]' syntax if you want more than one
> >> query argument, or you will only get the package satisfying the last arg
> >> you pass.
> >>
> >> [1] Rough data from April 11, 2011, with a total hit count of 1,109,163:
> >>      12 /login.php
> >>      13 /rpc.php?type=sarch
> >>      15 /rpc.php?type=msearch
> >>      16 /pingserver.php
> >>      16 /rpc.php
> >>      22 /logout.php
> >>     163 /passreset.php
> >>     335 /account.php
> >>     530 /pkgsubmit.php
> >>     916 /rss2.php
> >>    3838 /index.php
> >>    6752 /rss.php
> >>    9699 /
> >>   42478 /rpc.php?type=search
> >>  184737 /packages.php
> >>  681725 /rpc.php?type=info
> >>
> >> That means a whopping 61.5% of our requests were for info over the RPC
> >> interface; package pages are a distant second at only 16.7%.
> >>
> >> Signed-off-by: Dan McGee <dan at archlinux.org>
> >> ---
> >>  web/lib/aurjson.class.php |   59 ++++++++++++++++++++++++++++++++++++--------
> >>  1 files changed, 48 insertions(+), 11 deletions(-)
> >>
> >
> > I pushed that to my working tree, with a few modifications, basically to
> > keep the "info" query API untouched and introduce "multiinfo" instead.
> >
> > After some more consideration (and talking to Dave on IRC), I'm pretty
> > sure that this is the way to go. I'll probably push that to the master
> > branch as soon as it went through some more testing.
> 
> Really, dude? Not that I'm mad you got something working, but you just
> caused me to waste an hour of my time today then. Usually one has the
> expectation of the original submitter reworking patches once feedback
> comes on the mailing list...thanks for that. :/

Ye, there was no reply for three days and as those were really simple
fixes (about 5 lines of code addition and some really simple conflict
resolutions altogether), I decided to just amend the patches myself. I'm
really sorry about wasting your time here. Really. I'll have a look at
your working tree and check if there's anything I'll apply to my working
tree.

> Since I never fully finished it or made it nice, my work is here in
> hacky not-for-primetime form, but I'm not going to work on it
> anymore... http://code.toofishes.net/cgit/dan/aur.git/log/?h=rpc

Thanks again, I'll have a look at it.


More information about the aur-dev mailing list