> Jerome Flesch schrieb:
> >> Hi,
> >>
> >> I have a question regarding byte sizes in Fcp. Along with some requests
> >> sizes are passed as 1G or 1000K.
> >
> > I would be interrested to know where you saw that. From what I know, FCP
> > always provide/need sizes/times in bytes/seconds (except for things
> > related to the node config, see below).
>
> ConfigData
>     current.node.outputBandwidthLimit=12K
>     current.node.storeSize=1G
>     (...)
> EndMessage
>
"Except for things related to the node config".


> >> Quite obvious what it's about but
> >> nevertheless it is not documented.
> >>
> >> Can I assume Fcp always uses kibs and values are always passed following
> >> this patttern?
> >>
> >> -1 (not set)
> >> n
> >> n*1000 or (n)K
> >> n*1.000.000 or (n)M
> >> (...)
> >>
> >> The only time value (except from secs since epoch) I faced so far is one
> >> I got in
> >> response to GetConfig. It read '1HOUR'. Is there a similar pattern for
> >> time values to rely on?
> >
> > This value comes directly from the node configuration, and node
> > configuration is made to be human readable. Imo, that's the only reason
> > why this time is not given in seconds.
>
> ConfigData
>     default.logger.interval=1HOUR
> EndMessage
>
>
> To make these values adjustable by users I have to parse them.
> So there should be a spec somewhere. It would be enough to give
> me a pointer where to find it in freenets sources (still a bit lost
> in there) and I'd happily add a page regarding Fcp types to the wiki.
>
http://freenet.googlecode.com/svn/trunk/freenet/src/freenet/config/
http://freenet.googlecode.com/svn/trunk/freenet/src/freenet/config/LongOption.java

For the sizes: 
http://freenet.googlecode.com/svn/trunk/freenet/src/freenet/support/Fields.java 
(Fields.parseLong() ; I think it's the i18n standard (so 1000 and not 1024))

For the periods: 
http://freenet.googlecode.com/svn/trunk/freenet/src/freenet/support/FileLoggerHook.java
(FileLoggerHook.setInterval() ; ok, this one is not really standard ...)

But I agree, it would probably be better if FCP would be able to specify the 
type of input expected (boolean, long, string, period, etc).

Anyway, if it's an user input issue, you can do like I did in Thaw (the dev 
version only atm) or like it's done in FProxy : let the user enters whatever 
[s]he wants, and if the node complains / doesn't accept the value, then tell 
him (atm, in thaw, it doesn't tell him, it just put displays again the 
previous value).

-- 
Jerome Flesch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: 
<https://emu.freenetproject.org/pipermail/tech/attachments/20080213/0e175cf7/attachment.pgp>

Reply via email to