0-byte file requests

Ideas for ADC may be presented here for others to review and point out flaws or further improve the idea.
Forum rules
If you have an account on the wiki, remember to update the ADC Proposals page for new ideas.

http://dcbase.org/wiki/ADC_Proposals_list
Locked
Pretorian
Site Admin
Posts: 214
Joined: 21 Jul 2009, 10:21

0-byte file requests

Post by Pretorian » 28 Jan 2013, 20:28

To download with ADC (and NMDC) with a GET, one specifies the byte position where the uploader should start streaming data. This position can also be '-1' to indicate that the uploader should fill in the amount of bytes in the SND. This is fine and dandy for all files except a file that is literally 0 bytes.

In ADC with TTHs, this file has a hash of "LWPNACQDBZRYXW3VHJVCJ64QBZNGHOHHHZWCLNQ" (in Base32).

The problem is that if you do a GET and then a consequent SND, there is literally 0 data that needs to be transferred. That means that the state will go from NORMAL to DATA to NORMAL alternatively not move from NORMAL at all. This means that if a client expects data to change from DATA to NORMAL (and sets itself in DATA), there will never be a situation where that occur.

This means that the specification must take 0 byte files into account and that a client should generate these files themselves (which isn't a problem in any programming language).

There are two ways that the protocol can specify this;
* Any GET with a file that is 0 bytes shall be followed by a STA (e.g. "File not available")
* After a SND, the state remain in NORMAL (and no STA)

I prefer the first. Changes to GET;
A client must generate 0-byte files themselves. Any file requests for a 0-byte file should be responded to by a STA.
If one want to include the second way;
A client must generate 0-byte files themselves. Any file requests for a 0-byte file should be responded to by a STA or a SND followed by normal operation (i.e. no state transition).

Pretorian
Site Admin
Posts: 214
Joined: 21 Jul 2009, 10:21

Re: 0-byte file requests

Post by Pretorian » 29 Jan 2013, 20:46

The response from Yorhel and cologic has been to not have this information in the base specification, but rather in the recommendations document. The document needs to be more frequently updated, so please post if you want some stuff in there...

Locked