On Jan 17, 2008, at 6:36 AM, Matthew Toseland wrote: > On Wednesday 16 January 2008 21:59, robert at freenetproject.org wrote: >> Author: robert >> Date: 2008-01-16 21:59:55 +0000 (Wed, 16 Jan 2008) >> New Revision: 17081 >> >> Modified: >> trunk/freenet/src/freenet/io/comm/MessageCore.java >> trunk/freenet/src/freenet/io/comm/MessageFilter.java >> Log: >> correctness: don't rely on every message filter setting a source > > Both this and the original code are wrong with regards to > disconnections/reconnections. MessageCore gets a callback when a > connection > is disconnected or restarted. We check the filters list to see if this > affects any of our waiting filters, and if it does we trigger them. > In order > to prevent a race condition, we check for disconnection before > adding them to > the _filters list. We should check droppedConnection() at the end of > addAsyncFilter() but we don't. All of this assumes there is one > connection > per filter. There are places in the code where this assumption is > incorrect. > We should either make it work with multiple connections per filter, > or we > should document and enforce the fact that it only works with one > connection > per filter. > > Obviously I prefer the latter. I apologise for implementing it > myself but it > was rather convoluted - by the time I'd figured out what was going > on I'd > done it. :)
I don't mind at all. SVN provides mutual exclusion, and I like your fix better ;) -- Robert Hailey -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20080117/a8dd56d7/attachment.html>
