Alot of discussion has been focused on search commands and it's features.
I don't think we need (nor should) do it too complex and with many
features.
"SEARCH <dest[:port]> <id> <mime> <size|#[type#]hash> :<pattern>\r\n"
The first 3 arguments are given, no discussion there.
(destination must be a ip with port for active search and for passive it
is the client's GUID or name... whatever will be used).
The fourth argument can be for two uses. either a size (range) or a
hash. If it's a hash it must begin with a # char.
Next comes the pattern (wich can contain spaces, therefor the : to tell
the beginning of the message).
Pattern can also have two meanings, either it can be a regex (poisix or
perl, doesnt matter) or it is the exact (or wildcarded) name of the
file. Clients can decide, upon submitting, if they want to replace
spaces with a * to work the way searching currently does.
To tell a regex from name the work is simple - as no filename on a
filesystem can contain directory delimiters and therefor noone can
search for one, we simply add them in the beginning and end of the
regex. And woila, we still have a valid regex: "/pattern goes here/" :)
(some regex libs cant handle the / /, but it's easy to filter out by the
end-client).
No need for fancy if-statements and such in the search query. A user
mostly just searches for a name anyway and goes through the results
manually, it's the quickest and most userfriendly. Ok - it's simple to
write a if-statement yourself.. but imagine a gui to that.. to be able
to make a complex if statement without actually write the if statement
it would require alot of controls. As per my example you only need a
single text field. Pherhaps you like to some checkboxes to tell if you
want it as a regex, wildcard of plain to ensure syntax before sending
the request to save traffic, but this is optional.
450000000 )" provides simultaneously an enhanced query type and a querytype that can evolve without breaking "syntactic compatibility" with previous client (supporting the same query scheme). You even have encountered a limit of your own suggestion with your "Perhaps ..." because if you start to add new features by breaking the previous protocol definition 2 minutes after its creation, I don't want to imagine the result after 6 months :)
I know we are to discuss the actual protocol - but what's the point of
making a protocol that is not usable?
Also, you quickly want to find something.. dont want to sit 2minutes
configuring a criteria when it only takes 30seconds to scroll through
100+ results.
Instead, we absolutely need to standardize a specific hashing
algorithm. I suggest SHA1, but it doesn't really matter. It would be
good if everyone could agree soon, though.
Pattern can also have two meanings, either it can be a regex (poisix or perl, doesnt matter) or it is the exact (or wildcarded) name of the file. Clients can decide, upon submitting, if they want to replace spaces with a * to work the way searching currently does.
a part of a WinRAR packed file name "foo" with exact size 15000000 bytes
"SEARCH 217.210.105.76:412 03 text/* =15000000 :/^foo\.part[0-9]{2,3}\.rar$/\r\n"
Fredrik Tolf wrote:
Instead, we absolutely need to standardize a specific hashing
algorithm. I suggest SHA1, but it doesn't really matter. It would be
good if everyone could agree soon, though.
[2004-01-15 14:44] <sandos> someone care to mention to the mlist that TTHs are already semi-standard (well, in my small DC world atleast)
Yes, Tiger Tree Hashes have been part of BCDC for several months now.
why lock it to a single hash algorithm? you can't know the hash of the
file you're looking to unless you have downloaded a *.sfv (what
algorithm? is it called sfv, or?) or MD5 (or simlar) file telling it.
But of course we can encourage use of a specific hashing algorithm, but I
dont think we should explicitly use one.
And all other suggestions for deciding filetype have been so far to have it being based on filextensions, wich is not the same!The best suggestion so far is to leave the current system of file types (where a type is some set of file extensions) in place.
--On fredag den 16 januari 2004 02:22 +0100 Carl-Adam Brengesjö <[email protected]> wrote:
why lock it to a single hash algorithm? you can't know the hash of the
file you're looking to unless you have downloaded a *.sfv (what
algorithm? is it called sfv, or?) or MD5 (or simlar) file telling it.
The way it is implemented right now is, the client calculates hashes for the files in your share, and supplies them when sending out search hits.
Carl-Adam Brengesjö wrote:
Pattern can also have two meanings, either it can be a regex (poisix or perl, doesnt matter) or it is the exact (or wildcarded) name of the file. Clients can decide, upon submitting, if they want to replace spaces with a * to work the way searching currently does.
[2004-01-15 14:51] <nysin> (Might someone suggest on dcdev-list that these people try some sample queries in their regex syntax on a largeish share?
If any of you need it, I have several large filelists (in bz2 format) that I passed along to cologic (nysin). One in particular is 493gb and 172,000 files. I think modeling a typical search load on this share might quickly tell if regexp searching is feasible.
A previous discussion on regexps also yielded concerns about... ahem... resource intensive expressions. Nothing quite like being able to DOS all the clients in a hub simply by sending a well crafted regexp search.
> application/rar ?a part of a WinRAR packed file name "foo" with exact size 15000000 bytes
"SEARCH 217.210.105.76:412 03 text/* =15000000 :/^foo\.part[0-9]{2,3}\.rar$/\r\n"
Ah yes. A wonderful example of why searching by MIME types is not so useful. What exactly is the proper type for RAR files?
Yes in search results it's good with only one hash algorithm. I mean when
_searching_ for a file with a hash.
Say when having a file in your queue (together with a MD5 file in same
directory) and want to search for alternative sources than the one you
have. You open the MD5 file and looks for the file you want... and copies
the md5 sum, say `3efdb9c9e399679cccd23179c4f1a1f2', then you searches
for files with that hash.
... it's difficult to get the ass out of the chair in the middle of
interesting conversations ;) *must sleep*
why lock it to a single hash algorithm?
you can't know the hash of the file you're looking to unless you have downloaded a *.sfv (what algorithm? is it called sfv, or?) or MD5 (or simlar) file telling it.
Sure. But if you originally downloaded the file from someone with hashing support in the client, you already have hashes for the file in your queue.xml, and if you don't, you really have no way of knowing if it's actually the same file or not, except if a .md5 file (.sfv is CRC32, which IMHO isn't good enough since it's a checksum, not a hash) is supplied with the file. Most people are never going to keep .md5 files in their share.
TTH, on the other hand, is done mostly transparent to the user. Which is good, since users are all idiots. :P
Hm, 439GB ... what is that guy sharing exactly? Piracy is a crime...
no, silly answer :)
Any form of a more advanced query requires some time for execution (more or less). So how much time requires the query type suggested (fredrik was it, no?) ?
I'm not trying to promote regex now, just wanna know.
I can make a test with some various filelists. (C#, don't know C/C++ that good) Results coming up in a few days (or hours, depending how little I plan to sleep this night ;)
These lists ARE standard. Unfortunatly, rar is not listed. And as so we can decide it (if we want to), as long the decition corresponds to the RFC's. And thus it can be, as Todd wrote, application/x-rar-compressed (RFC2046, page 9).
I say (if we use mimetypes) we use strictly standard, meaning if a client searches for "application/x-rar" - well bad for him if he dont get any results.
RFC2046 specifies that application/octet-stream should be used with "uninterpreted binary data". And doesn't rar files come under that category? :) If the user really wants to search for .rar files, well use the filename pattern instead!
I can make a test with some various filelists. (C#, don't know C/C++ that good) Results coming up in a few days (or hours, depending how little I plan to sleep this night ;)
Guessing/deciding non-standard MIME types on our own? So if MIME searching doesn't totally replace the existing system, why make any new proposal more complex by including it?
Actually, I had intended every logical part of the search string to be
a seperate token in the line sent over the protocol that I
quick-drafted earlier. If you look in the archives for the `Text
protocol draft' draft that I sent Dec 2nd, you'll see what I
mean. It's also included in my upcoming protocol draft, which is more
complete than that mail.
Carl-Adam Brengesjö wrote:>
And all other suggestions for deciding filetype have been so far to have it being based on filextensions, wich is not the same!The best suggestion so far is to leave the current system of file types (where a type is some set of file extensions) in place.
Again: what does using MIME types gain us over file extensions?
Sure, we could basically recreate/port the unix way of guessing mime type, but... why? It gains us nothing, and it adds complexity and uncertainty. Not all will handle MIME guessing the same, so you've just introduced interoperability issues.
ps. I'm going to bed now, before I cause any more mess in this list ;)
Carl-Adam Brengesjö wrote:
ps. I'm going to bed now, before I cause any more mess in this list ;)
Even posts with fallout are better than no discussions.
I trust you've downloaded the full archive to see some of the past topics? :)
- Todd
I say again, filetypes with mime decides the type depending on the
actual _data_, what it contains. File extension is basicly just a cheap
trick to `know' it's type even before the file has been opened, and can
therefor be easily faked - or mistaken.
But I seem to be the only one that likes the idea with mime types, and
everyone is fighting against me on the subject... `resistance is futile'
- at least it seems to be :(
But I seem to be the only one that likes the idea with mime types, and
everyone is fighting against me on the subject... `resistance is futile'
- at least it seems to be :(
IMHO, mime types is not the solution. Something like mime-magic is probably better but has its limit. How to handle files with unknown content but known extension and how to handle new file format or "rare" ones (who knows PES format ?).
http://www.dolda2000.com/~fredrik/doldaconnect/protocol.html
> IMHO, mime types is not the solution. Something like mime-magic is
> probably better but has its limit. How to handle files with unknown
> content but known extension and how to handle new file format or "rare"
> ones (who knows PES format ?).
Magic-mime will give a file with unkown content the type `text/plain'
and so it always have a mime type, though it may not be accurate. But
event the current system isn't accurate with stuff like that.
However, the last thing I want to do is to ban MIME types from
usage. On the contrary; consider my search format, for example. It can
be implemented at once, or once these file formats have standard MIME
types, but at any point, it's easy to add something like
( M =~ video/.* ). That way, it will be optional in the way that it
should be. Those clients that don't have the MIME type attribute
implemented will simply return false on those queries.
> About connection stage, I assume GUID is the first command you sent
> (correct me if I am wrong). Why not having the following connection
> establishment:
>
> 1: H=>C: the hub sends its ID (something like the GUID of the client but
> for the hub)
>
> 2: C=>H: the client sends its ID and its password simultaneously (I
> modified your "GUID ID" command into "GUID ID password"). Then we can do
> the full authentification in a single step and without error, thanks to
> the GUID of the hub
>
> 3: H=>C: the hub accepts an continue the process into "normal" mode or
> close the connection after a message.
Again, my utter goal is to avoid this state machine stuff. Such a
thing as a "first command" should not be defined. It is equally OK to
send any command that is part of the `identify' context, be it DESC or
GUID. The important thing is what should be done, not in what order.
1:
C->H: GUID xxx
H->C: ACCP
C->H: DESC xxx
H->C: WELC
2:
C->H: DESC xxx
H->C: ACCP
C->H: GUID xxx
H->C: WELC
3:
C->H: GUID xxx1
H->C: ACCP
C->H: GUID xxx2
H->C: ACCP
C->H: GUID xxx3 (note that this will be the authoritative one)
H->C: ACCP
C->H: DESC xxx
H->C: WELC
Essentially, a state machine where you must send GUID first and then
DESC is like this context engine, only that it has even more contexts
and even more implicit changes. Therefore, I think this is clearer,
more flexible, and also allows for human input error when eg. typing
in a Telnet session. Also, since all contexts are named, that gives a
very strict definition of the protocol - there can be no doubts
anywhere about when you should/could send what.
At least that is the idea I had behind it.
I searched on DC now for rar files, using filename pattern "." and `filetype' compressed. What I got was *.zip and *.rar, but what with *.r01, *.r02 (etc) ? Using mime types here would return _all_ files that are rar files.
Not all clients will decide filetypes on extension either. When I did my search described above - I got 7 (SEVEN!!) hits on directories that ended with ".ra", and therefor treated as compressed files (the clients who responded used DC++ 0.303, is this fixed in newer releases?).
I say again, filetypes with mime decides the type depending on the actual _data_, what it contains. File extension is basicly just a cheap trick to `know' it's type even before the file has been opened, and can therefor be easily faked - or mistaken.
But I seem to be the only one that likes the idea with mime types, and everyone is fighting against me on the subject... `resistance is futile' - at least it seems to be :(
I have to say same thing over and over in this matter (with different words) and either is it you that don't understand what I'm saying, or it's me who doesn't understand what I want to be said (or needed to be said) :/ either way we are not making any progress. I give up! :p
If you use context, use binary flags instead of string names - you can
save alot of bandwidth - instead of 18 bytes ("base,main,operator") you
have just 2 bytes (in a text protocol, 1 byte if we can cheat) (using
table described below).
base 0
identify 1
auth 2
main 4
operator 8
base|main|operator = 12
And last, about adding more operator `levels' - dont! I can only see the
usage of adding a `voice' (vip), and a global operator level if channel
support are going to be supported.
Adding too many of userlevels in the protocol don't allow much of the
customization that is available to DC today regarding user modes/access.
With all due respect, I don't, since if we use a bitfield number for
flags, we only get 32 (or possibly 64) possible contexts, which also
require a centralized place for registration. I was hoping on using
the text-based contexts for extending the protocol as well. For
example, if a specific client implementation has some extra command
that it wants to use, it could request an extra context named
"myextension" or similar from the hub/peer, and if the request is
successful, then those commands will be available.
So you see, I was also planning on having the context scheme double as
capability arbitration. Don't you think that's even slightly good?
and allow both "auth|identify" or "2|1" or "3". This allows non standard extension to be coded like "myextension|3" (more compact than "myextension|identify|auth" but still understandable by clients not supporting the extension).base 0
identify 1
auth 2
main 4
operator 8
If you use context, use binary flags instead of string names - you can
save alot of bandwidth - instead of 18 bytes ("base,main,operator") you
have just 2 bytes (in a text protocol, 1 byte if we can cheat) (using
table described below).
base 0
identify 1
auth 2
main 4
operator 8
base|main|operator = 12
And last, about adding more operator `levels' - dont! I can only see the
usage of adding a `voice' (vip), and a global operator level if channel
support are going to be supported.
Adding too many of userlevels in the protocol don't allow much of the
customization that is available to DC today regarding user modes/access.