[FIXed] Re: [BUG] Hugely inefficient FTP code: coding opportunity

Henrik Gedenryd h.gedenryd at open.ac.uk
Mon Feb 11 20:39:45 UTC 2002


>> ServerDirectory already has a instance variable "socket". I briefly looked at
>> the code ... and I have to admit: I don't quite understand it.
>> In ServerDirectory>>openNoDataFTP the storing of the socket is commented out.
>> The last lines are:

Umm, now that I looked *much* closer, there indeed some kind of support for
it. 

But there isn't any protocol for it, no one is using it, and it's not
obvious from the code... There is *plenty* of room for refactoring code
there. I think the same "QUIT" code alone is in some 10 different places.

I got it working. Woohoo! V e r y much faster! Now if only our proxy
wouldn't return the wrong replies after an update...

I'll include some kind of rudimentary protocol for this with the imminent
change set. It will go something like this:

    openSessions _ repositories collect: [:rep |
        rep directory wakeUp; yourself].
    [
    <do your thing>
    ] ensure: [openSessions do: [:serverDir | serverDir sleep]].

I'm actually using the same session for multiple ServerDirectory instances
on the same server.

Thanks to Felix for this discovery! I had been looking at that code many
times without discovering this little gem.

Henrik




More information about the Squeak-dev mailing list