= Data server protocol = Core client communicate with data servers using HTTP. A data server is typically implemented using a web server together with a BOINC-supplied CGI program, '''file_upload_handler'''. === Download === File download is done by a GET request to a URL from the FILE_INFO element. The file offset, if any, is given in '''Range:''' attribute of the HTTP header. === Upload === File upload is done using POST operations to a CGI program. A security mechanism prevents unauthorized upload of large amounts of data to the server. Two RPC operations are used. '''1) Get file size''' The request message has the form: {{{ 1 1 1 filename }}} The reply message has the form: {{{ x [ text | nbytes ] }}} Status is '''''':: Success. Nbytes is 0 if the file doesn't exist. '''1''':: Transient error. The client should try another data server, or try this one later. '''-1''':: Permanent error. The client should give up on the result. In the error cases, the element is omitted and the element gives an explanation. '''2) Upload file''' Request message format: {{{ 1 1 1 ... ... x x x ... (nbytes bytes of data; may include non-ASCII data) (no closing tags) }}} The element is the exact text sent from the scheduling server to the client. It includes a signature based on the project's file upload authentication key pair. is the size of the file. is MD5 of the entire file. is the offset within the file. Reply message format: {{{ x text }}} Status is '''''':: success '''1''':: transient error; The client should try another data server, or try this one later. '''-1''':: Permanent error. The client should give up on the result. In the error cases, the element gives an explanation. TODO: if there's an error in the header (bad signature, or file is too large) the client should learn this without actually uploading the file.