azurelunatic: Vivid pink Alaskan wild rose. (Default)
Azure Jane Lunatic (Azz) 🌺 ([personal profile] azurelunatic) wrote in [site community profile] dw_dev 2016-07-20 07:26 am (UTC)

Re: XML-RPC API Error

That suggests it's hitting some duplicate entry prevention thing, like something with the same exact content being posted within some timeout window that I'm a little vague on.


*dives*

dw-free/cgi-bin/LJ/Protocol.pm

https://github.com/dreamwidth/dw-free/blob/346829d666d389c9e12eae7d1fa45134e0d42875/cgi-bin/LJ/Protocol.pm#L2320

        my $now = time();
        # broken client loop prevention
        if ($req->{'lastsync'}) {
            my $pname = "rl_syncitems_getevents_loop";
            # format is:  time/date/time/date/time/date/... so split
            # it into a hash, then delete pairs that are older than an hour
            my %reqs = split( m!/!, $u->prop( $pname ) );
            foreach (grep { $_ < $now - 60*60 } keys %reqs) { delete $reqs{$_}; }
            my $count = grep { $_ eq $date } values %reqs;
            $reqs{$now} = $date;
            if ($count >= 2) {
                # 2 prior, plus this one = 3 repeated requests for same synctime.
                # their client is busted.  (doesn't understand syncitems semantics)
                return fail($err,406);
            }


I hope this is helpful? I don't understand it fully, but that's where it's defined.

Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org