Added .INCOMPLETE hack to aid with marking finished transfers.

This commit is contained in:
Matthew Bloch
2012-05-29 11:24:24 +01:00
parent ab0dfb5eca
commit 21ccd17ea5
4 changed files with 15 additions and 4 deletions

View File

@@ -167,6 +167,12 @@ int client_serve_request(struct client_params* client)
switch (be32toh(request.type))
{
case REQUEST_READ:
if (access(client->serve->filename_incomplete, F_OK) == 0 ) {
debug("read request while data incomplete");
reply.error = htobe32(10);
write(client->socket, &reply, sizeof(reply));
return 0;
}
case REQUEST_WRITE:
/* check it's not out of range */
if (be64toh(request.from) < 0 ||