On Fri, 2003-02-21 at 19:06, Mark Crispin wrote: > > OK, I looked through c-client and Pine code. It looks just as difficult > > as I expected. It uses multiple arrays for seq <-> message lookups. > > Bullshit. There is one cache. Don't get confused by the sortcache which is > not seq->message lookup.
But whenever sorting is done, there is the sort array that has to be updated and accessed slowly whenever you get fetch envelope reply (pine_imap_envelope -> mn_raw2m() -> msgno_in_sort()). > > It > > often has to go through the whole array just to find the message (for > > every message it has to fetch I think?). > > That's only if you look up by UIDs, which a well-written client rarely has to > do if you use sequence numbers effectively. Also if it's sorted in any way. I guess sequences work well enough for unsorted mailboxes. > > And of course it has to update > > the arrays every time messages are expunged. > > The only reason why it does that update is for a feature that is so advanced > that most clients don't use it; a multithread client (such as my MailManager > application) can "lock" a message cache entry and prevent it from being > expunged even if it is expunged on the server. That way it doesn't have to > maintain a separate copy, ever; but it does need a back pointer. > > I doubt very much that there's anything like that in your UID-only client. Sounds easy: cache_record->refcount++ > > Pine also doesn't seem to do any automatic reconnection to server. I'd > > think that would get annoying with bad internet connections. > > It's rare to need to do automatic reconnection, even with flakey network > connections, if you do networking the way you're supposed to. Such as not > killing a perfectly good TCP connection because of the slightest router flap. I need to kill internet connection quite often to access VPN in another computer (doesn't work through NAT, so I temporarily give that computer direct net access). With Evolution I currently have to click some OK-dialog every time I get back, and I find even that annoying. > CDPD is about as flakey as you can get, yet Pine works quite well with it. I don't know about CDPD, but GPRS connections here seem to be disconnecting TCP connections quite often (once in a hour or two). I want to see if I have new messages by just looking, not having to do something first to bring up the connection. > > If it did > > do reconnecting, would the current code require resyncing everything > > after connect > > Since we never fetch everything, we never need to resync everything. Just > toss out the local cache and do demand-fetching. Meaning that you toss out a completely usable cache just because you don't want to use UIDs? > Demand-fetching is good. Demand fetching means that you work on slow > connections. I've said the same, and I think it's possible just fine without client remembering sequences. > Pine works well over CDPD. Does your client? I haven't written it yet. I'll see if I can make it do demand-fetching, but it's not really important to me.
