David 'Bombe' Roden | 1 Aug 05:17 2006
Picon

Re: Re: [freenet-cvs] r9809 - trunk/freenet/src/freenet/clients/http

On Sunday 30 July 2006 15:42, David Sowder (Zothar) wrote:

> Perhaps it's a lot more work and harder to do, but I think it would
> be much better to fix the corner cases with the Hashmaps used by
> node.getPeerNodeStatusSize() rather than calculating it for every
> /darknet/ page load.  Part of the idea of
> node.getPeerNodeStatusSize() was for the information to be both
> accurate and available to other parts of the node at near zero CPU
> cost.

Uhm, I'm not sure I completely understand what you mean but iterating 
once (!) over an array of 5 to 50 PeerNode objects and calling a method 
that simply returns an int (which most probably gets inlined anyway) is 
something I do consider "near zero CPU cost."

The problem with node.getPeerNodeStatusSize() is that state information 
for a PeerNode can change during the point getPeerNodeStatusSize() is 
called and the PeerNode's status itself is shown on the page. To fix 
that you'd either have to synchronized Node externally (which is a 
_very_ bad idea) or you'd have to return a list of shallow PeerNode 
copies that don't change their state after returning them.

	David
_______________________________________________
Devl mailing list
Devl@...
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
David Sowder (Zothar | 1 Aug 15:23 2006

Re: Re: [freenet-cvs] r9809 - trunk/freenet/src/freenet/clients/http

David 'Bombe' Roden wrote:
> On Sunday 30 July 2006 15:42, David Sowder (Zothar) wrote:
>
>   
>> Perhaps it's a lot more work and harder to do, but I think it would
>> be much better to fix the corner cases with the Hashmaps used by
>> node.getPeerNodeStatusSize() rather than calculating it for every
>> /darknet/ page load.  Part of the idea of
>> node.getPeerNodeStatusSize() was for the information to be both
>> accurate and available to other parts of the node at near zero CPU
>> cost.
>>     
>
> Uhm, I'm not sure I completely understand what you mean but iterating 
> once (!) over an array of 5 to 50 PeerNode objects and calling a method 
> that simply returns an int (which most probably gets inlined anyway) is 
> something I do consider "near zero CPU cost."
>   
Whereas asking a Hashmap it's size probably doesn't iterate over an 
array as it probably tracks it's size with a variable.  While iterating 
over the peers list is not a big deal for the /darknet/ page, it may 
matter if knowing the number of connected peers is useful in one or more 
of the pieces of the node's code that may run tens of times a second or 
more.
> The problem with node.getPeerNodeStatusSize() is that state information 
> for a PeerNode can change during the point getPeerNodeStatusSize() is 
> called and the PeerNode's status itself is shown on the page. To fix 
> that you'd either have to synchronized Node externally (which is a 
> _very_ bad idea) or you'd have to return a list of shallow PeerNode 
> copies that don't change their state after returning them.
(Continue reading)

Re: Re: [freenet-cvs] r9830 - in trunk/apps/installer/installclasspath: linux windows

* Juiceman <juiceman69@...> [2006-07-31 18:10:35]:

> 
> I think this makes sense from a scalablity view, but is this a good
> idea to have our scripts and the sha1test.jar come from unsecure
> servers?  What if one of the mirrors are hacked to put an evil version
> of update.cmd that redirects to a different server/with an evil
> version of the node.jar?  Users might never know.  These are both tiny
> files and imho should be left on the secure URL.
> 

Well, that's the first step : the second one will be to use sha1test for
everything ... and removing the binary "wget.exe"

But yes, you're right, that's bad

NextGen$
_______________________________________________
Devl mailing list
Devl@...
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
Matthew Toseland | 1 Aug 20:04 2006
Picon

Re: Re: [freenet-cvs] r9809 - trunk/freenet/src/freenet/clients/http

Why can't we just construct the main table before the summary?

On Tue, Aug 01, 2006 at 08:23:42AM -0500, David Sowder (Zothar) wrote:
> David 'Bombe' Roden wrote:
> >On Sunday 30 July 2006 15:42, David Sowder (Zothar) wrote:
> >
> >  
> >>Perhaps it's a lot more work and harder to do, but I think it would
> >>be much better to fix the corner cases with the Hashmaps used by
> >>node.getPeerNodeStatusSize() rather than calculating it for every
> >>/darknet/ page load.  Part of the idea of
> >>node.getPeerNodeStatusSize() was for the information to be both
> >>accurate and available to other parts of the node at near zero CPU
> >>cost.
> >>    
> >
> >Uhm, I'm not sure I completely understand what you mean but iterating 
> >once (!) over an array of 5 to 50 PeerNode objects and calling a method 
> >that simply returns an int (which most probably gets inlined anyway) is 
> >something I do consider "near zero CPU cost."
> >  
> Whereas asking a Hashmap it's size probably doesn't iterate over an 
> array as it probably tracks it's size with a variable.  While iterating 
> over the peers list is not a big deal for the /darknet/ page, it may 
> matter if knowing the number of connected peers is useful in one or more 
> of the pieces of the node's code that may run tens of times a second or 
> more.
> >The problem with node.getPeerNodeStatusSize() is that state information 
> >for a PeerNode can change during the point getPeerNodeStatusSize() is 
> >called and the PeerNode's status itself is shown on the page. To fix 
(Continue reading)

Matthew Toseland | 1 Aug 20:06 2006
Picon

Re: Re: [freenet-cvs] r9830 - in trunk/apps/installer/installclasspath: linux windows

It's not mirrored is it?

On Mon, Jul 31, 2006 at 06:10:35PM -0400, Juiceman wrote:
> On 7/31/06, nextgens@...
<nextgens@...> wrote:
> >Author: nextgens
> >Date: 2006-07-31 10:30:14 +0000 (Mon, 31 Jul 2006)
> >New Revision: 9830
> >
> >Modified:
> >   trunk/apps/installer/installclasspath/linux/update.sh
> >   trunk/apps/installer/installclasspath/windows/update.cmd
> >Log:
> >update the updating scripts : new urls
> >
> >Modified: trunk/apps/installer/installclasspath/linux/update.sh
> >===================================================================
> >--- trunk/apps/installer/installclasspath/linux/update.sh       2006-07-30 
> >19:31:03 UTC (rev 9829)
> >+++ trunk/apps/installer/installclasspath/linux/update.sh       2006-07-31 
> >10:30:14 UTC (rev 9830)
> > <at>  <at>  -37,9 +37,9  <at>  <at> 
> >                echo Downloading sha1test.jar utility jar which will 
> >                download the actual update.
> >                if [[ $WGET -eq 1 ]]
> >                then
> >-                       $DOWNLOADER $NOCERT 
> >https://emu.freenetproject.org/sha1test.jar
> >+                       $DOWNLOADER $NOCERT 
> >http://downloads.freenetproject.org/installer/sha1test.jar
(Continue reading)

Re: Re: [freenet-cvs] r9830 - in trunk/apps/installer/installclasspath: linux windows

* Matthew Toseland <toad@...> [2006-08-01 19:06:42]:

> It's not mirrored is it?

Now it is.

> 
> On Mon, Jul 31, 2006 at 06:10:35PM -0400, Juiceman wrote:
> > On 7/31/06, nextgens@...
<nextgens@...> wrote:
> > >Author: nextgens
> > >Date: 2006-07-31 10:30:14 +0000 (Mon, 31 Jul 2006)
> > >New Revision: 9830
> > >
> > >Modified:
> > >   trunk/apps/installer/installclasspath/linux/update.sh
> > >   trunk/apps/installer/installclasspath/windows/update.cmd
> > >Log:
> > >update the updating scripts : new urls
> > >
> > >Modified: trunk/apps/installer/installclasspath/linux/update.sh
> > >===================================================================
> > >--- trunk/apps/installer/installclasspath/linux/update.sh       2006-07-30 
> > >19:31:03 UTC (rev 9829)
> > >+++ trunk/apps/installer/installclasspath/linux/update.sh       2006-07-31 
> > >10:30:14 UTC (rev 9830)
> > > <at>  <at>  -37,9 +37,9  <at>  <at> 
> > >                echo Downloading sha1test.jar utility jar which will 
> > >                download the actual update.
> > >                if [[ $WGET -eq 1 ]]
(Continue reading)

Matthew Toseland | 1 Aug 20:16 2006
Picon

Re: Re: [freenet-cvs] r9830 - in trunk/apps/installer/installclasspath: linux windows

On Tue, Aug 01, 2006 at 08:11:31PM +0200, Florent Daignière (NextGen$) wrote:
> * Matthew Toseland <toad@...> [2006-08-01 19:06:42]:
> 
> > It's not mirrored is it?
> 
> Now it is.

Ummm, that's bad. sha1test.jar should NOT be mirrored.
> 
> > 
> > On Mon, Jul 31, 2006 at 06:10:35PM -0400, Juiceman wrote:
> > > On 7/31/06, nextgens@...
<nextgens@...> wrote:
> > > >Author: nextgens
> > > >Date: 2006-07-31 10:30:14 +0000 (Mon, 31 Jul 2006)
> > > >New Revision: 9830
> > > >
> > > >Modified:
> > > >   trunk/apps/installer/installclasspath/linux/update.sh
> > > >   trunk/apps/installer/installclasspath/windows/update.cmd
> > > >Log:
> > > >update the updating scripts : new urls
> > > >
> > > >Modified: trunk/apps/installer/installclasspath/linux/update.sh
> > > >===================================================================
> > > >--- trunk/apps/installer/installclasspath/linux/update.sh       2006-07-30 
> > > >19:31:03 UTC (rev 9829)
> > > >+++ trunk/apps/installer/installclasspath/linux/update.sh       2006-07-31 
> > > >10:30:14 UTC (rev 9830)
> > > > <at>  <at>  -37,9 +37,9  <at>  <at> 
(Continue reading)

David Sowder (Zothar | 1 Aug 22:59 2006

Re: Re: [freenet-cvs] r9809 - trunk/freenet/src/freenet/clients/http

Matthew Toseland wrote:
> Why can't we just construct the main table before the summary?
>   
That's what we were doing before my HashMap stuff was added.  Since the 
HashMap stuff is currently only used for the periodic log message, 
perhaps we can take /darknet/ (and other similar places) back to the 
table then summary approach.
> On Tue, Aug 01, 2006 at 08:23:42AM -0500, David Sowder (Zothar) wrote:
>   
>> David 'Bombe' Roden wrote:
>>     
>>> On Sunday 30 July 2006 15:42, David Sowder (Zothar) wrote:
>>>
>>>  
>>>       
>>>> Perhaps it's a lot more work and harder to do, but I think it would
>>>> be much better to fix the corner cases with the Hashmaps used by
>>>> node.getPeerNodeStatusSize() rather than calculating it for every
>>>> /darknet/ page load.  Part of the idea of
>>>> node.getPeerNodeStatusSize() was for the information to be both
>>>> accurate and available to other parts of the node at near zero CPU
>>>> cost.
>>>>    
>>>>         
>>> Uhm, I'm not sure I completely understand what you mean but iterating 
>>> once (!) over an array of 5 to 50 PeerNode objects and calling a method 
>>> that simply returns an int (which most probably gets inlined anyway) is 
>>> something I do consider "near zero CPU cost."
>>>  
>>>       
(Continue reading)

Juiceman | 2 Aug 00:21 2006
Picon

Re: Re: [freenet-cvs] r9830 - in trunk/apps/installer/installclasspath: linux windows

On 8/1/06, Matthew Toseland <toad@...> wrote:
> On Tue, Aug 01, 2006 at 08:11:31PM +0200, Florent Daignière (NextGen$) wrote:
> > * Matthew Toseland <toad@...> [2006-08-01 19:06:42]:
> >
> > > It's not mirrored is it?
> >
> > Now it is.
>
> Ummm, that's bad. sha1test.jar should NOT be mirrored.

Neither should be mirrored, If someone compromises the update script
they can bypass sha1test.jar altogether.  Or were you speaking of
something else?

--

-- 
I may disagree with what you have to say, but I shall defend, to the
death, your right to say it. - Voltaire

Re: Re: [freenet-cvs] r9830 - in trunk/apps/installer/installclasspath: linux windows

* Juiceman <juiceman69@...> [2006-08-01 18:21:20]:

> On 8/1/06, Matthew Toseland <toad@...> wrote:
> >On Tue, Aug 01, 2006 at 08:11:31PM +0200, Florent Daignière (NextGen$) 
> >wrote:
> >> * Matthew Toseland <toad@...> [2006-08-01 19:06:42]:
> >>
> >> > It's not mirrored is it?
> >>
> >> Now it is.
> >
> >Ummm, that's bad. sha1test.jar should NOT be mirrored.
> 
> Neither should be mirrored, If someone compromises the update script
> they can bypass sha1test.jar altogether.  Or were you speaking of
> something else?
> 

Ok, I think I've fixed the problem :

try getting
http://downloads.freenetproject.org/alpha/installer/sha1test.jar, it
sends you to http://get.freenetproject.org/sha1test.jar wich isn't
mirrored...

.cmd and .sh, as well as .sha1 files aren't using mirrors anyway

I'm wondering what to do regarding the installer's files (.exe and one
.jar) Those are picked up from mirrors and aren't signed.

(Continue reading)


Gmane