Raphael Manfredi wrote:
> :I know many will not approve of this, but how about a temporary
> :extension for tree hashing for gtk-gnutella not using XML.......
 
> I'm not fond of XML either, but when it comes to inter-operability,
> we need to stick to whatever other vendors are doing.

For gtk-gnutella this is really a non-problem as it depends on
libxml2 anyway which makes all this rather trivial. If you wanted
to write a simple up-/download-tool for Gnutella (such as the
equivalent of BitTorrent) this is a major suckage unless you
really want to depend on some bloated XML library just to extract
this little tiny information. Of course, only god knows what
side-effects get triggered by letting a library parse this
XML data. It almost provokes one (except the Java guys maybe) to write
a simple hack which implements a pseudo-XML parser which defeats the
purpose of XML in the first-place.
 
> Therefore, THEX is a necessary evil.  Note that the XML in THEX is
> just an encapsulation of the binary hash tree, so it's not entirely
> bad.

It's fairly idiotic. This very little information fits perfectly into
an HTTP header which is just as extensible. Actually, you can simply
pass and negotiate this data using the "Accept" and "Content-Type"
headers. Some arbitrary identifier as Content-Type like
"application/x-hashtree-tiger-bf-1k" (the meaning shoule be obvious)
would be perfectly fine. I doubt there will be (m)any variants because
that would totally defeat the purpose. The only reason to add a new
variant would be a weakness or severe performance difference. Two or
three of those header tokens - if ever necessary - wouldn't really
cause an unreasonable overhead. You only need multiple of those during
a migration phase anyway.

Another advantage is that you get the interesting information with a
light-weight HEAD request if you need it. With THEX you have to choke
the whole object, make a good guess or kill the connection, all of
that wasting a good amount of resources.

Using XML and DIME has really zero benefits over the light-weight
variant. Often specifications are too tight making them non-extensible
but this is a very good example for making something unnecessarily
complex in advance. It opens a can of worms with respect to denial of
service and the likeliness of compatibility issues. After all it's
simply not elegant and missing elegance is a often a hint that
something is ill-defined.

If Gtk-Gnutella ever supports TTH, I would really suggest to add such
a simpler method - keeping the code backwards-compatible of course.
Once you've implemented it, publish the specification at the GDF.
Maybe I am missing something because I wonder why people ever agreed
on that instead of the outlined scheme.

-- 
Christian

Attachment: pgp0tI4Y8NEdS.pgp
Description: PGP signature

Reply via email to