Starez Ticket Protocol v1.0
Warning
- Warning: We're still working on the protocol, so this might change any moment.
Who speaks this protocol?
- Please see the Starez Protocol documentation to see what tickets, ticket
servers and download servers are for.
- This document describes the protocol that the download servers speak with the masterserver.
- It is used to make sure the download servers can request information about tickets, and report
'download done', without enabling people to request information on all tickets (which would be possible if
the downloadserver and main server had a shared database).
Protocol base
- The first plans for this server are to make it plain text. This might change
later.
- This protocol is a lot more simple than the regular Starez protocol, since the task is also more
simple. Requesting simple information doesn't require a streamlined protocol.
- When the downloadserver connects, it simply says the ticket ID and the server responds with the
filename and download cap in kilobytes (0 if unlimited).
C: [insert ticket ID]
S: FILENAME=[insert filename]
S: CAP=[insert cap]
[Server closes connection]
- After this, the client disconnects and will not reconnect until the download is done.
- There is, however, one exception to this rule. When the connection suddenly drops at 75%, the client
might reconnect later, so the download server must not tell the main server that the
download is done. When the client reconnects, it gives the ticket ID, and the server
must reconnect to the mainserver to request ticket information, after which the
download continues.
- When the download is completely done, the download server connects to the
ticketserver and sends 'DONE [ticketid]'. The server responds OK if all went OK and either of both sides
closes the connection.
C: DONE [insert ticket ID]
S: OK
[Server closes connection]
- When a client connects to the ticket server and asks for a ticket ID that does not exist, the server
responds with 'NO_SUCH_TICKET_ID' and closes the connection. The same happens when a client reports
'download done' for a ticket ID that doesn't exist.
C: 0123401234012340
S: NO_SUCH_TICKET_ID
[Server closes connection]
C: DONE 0123401234012340
S: NO_SUCH_TICKET_ID
[Server closes connection]
- If an error occures, the server will reply ERROR and close the connection. The error itself will be
shown to the server administrator only. In these cases, a download server should act accordingly and
output an error, 500 Internal Server Error is recommended.
See also
Author