Log in

No account? Create an account
small annoyance: syncitems and repeated requests - LiveJournal Client Discussions — LiveJournal [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

small annoyance: syncitems and repeated requests [Jan. 29th, 2005|03:00 pm]
LiveJournal Client Discussions
The “broken client loop” prevention is well-known to be annoying when trying to develop an offline client. I notice that, even more annoyingly, if you’re currently in the “too many repeated requests” state and you try to sync again, your current request is stored as yet another attempt before you’re rejected. This means that if I check back too soon to see if my holding period has expired, I’m getting more black marks against me.

Proposed fix: in this code in ljprotocol.pl:
            LJ::set_userprop($dbs, $u, $pname, 
                             join(‘/’, map { $_, $reqs{$_} }
                                  sort { $b <=> $a } keys %reqs));
            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);

Swap the order of the “if” and the “set_userprop”.

[User Picture]From: marksmith
2005-02-01 07:59 pm (UTC)
Heh. That does make more sense. Committed:

(Reply) (Thread)
From: evan
2005-02-01 11:05 pm (UTC)
(Reply) (Parent) (Thread)