v0.1.0
Format:
*<filename_size><filename><id><size><data>
Where:
filename_sizeis a little-endian uint64idis a little-endian uint64sizeis a little-endian uint64filenameis []byte with len offilename_size, containing the name of uploading filedatais []byte with len ofsizecontaining theid'th chunk of file
<code><msg_size>[<msg>]
Where:
codeis the little-endian uint64 status code (see Status Codes)msg_sizeis the little-endian uint64 representing the size of followingmsg. Ifmsgnot present, themsg_sizewill be0
Request specified chunk of the file.
Format:
/<filename_size><filename><id>
Where:
filename_sizeis a little-endian uint64idis a little-endian uint64 ID of file chunkfilenameis []byte with len offilename_size, containing the name of uploading file
Depends on the code
<code><filename_size><filename><id><size><data>
The part after code is identical to send chunk request
<code>
<code><msg_size>[<msg>]
Where:
msg_sizeis the little-endian uint64 representing the size of followingmsg. Ifmsgnot present, themsg_sizewill be0
Request specific chunks of the file.
Format:
%<filename_size><filename>
Where:
filename_sizeis a little-endian uint64filenameis []byte with len offilename_size, containing the name of uploading file
<code><count>[<...ids>]
Where:
countis a little-endian uint64 representing count of following chunk IDs...idsis a sequence (len =count) of little-endian uint64, representing ids of chunks stored in node
If there is no chunks in the node, the count will be 0 and there will be no ids after that. The code still will be OK
<code><msg_size>[<msg>]
Where:
msg_sizeis the little-endian uint64 representing the size of followingmsg. Ifmsgnot present, themsg_sizewill be0
If the request will not match to any of specified requests, the server will return INVALID_REQ code in following format:
<code><msg_size>[<msg>]
Where:
msg_sizeis the little-endian uint64 representing the size of followingmsg. Ifmsgnot present, themsg_sizewill be0
Status code is a little-endian uint64 with following meanings:
10- OK20- NOT_FOUND21- INVALID_REQ30- INTERNAL
I don't know