3 * Copyright (C) 1988-1998 by the Massachusetts Institute of Technology.
4 * For copying and distribution information, please see the file
8 #include <mit-copyright.h>
10 #include "update_server.h"
22 * >>> (STRING)"xfer_002" filesize checksum pathname
29 * >>> (STRING)data (last data block)
30 * <<< (int)code (from read, write, checksum verify)
33 * perform initial preparations and receive file as
34 * a single string, storing it into <pathname>.moira_update.
36 * still to be done: file locking; perform transfers in pieces instead
37 * of all at once; use checksums
40 void xfer_002(int conn, char *str)
42 int file_size, checksum, code;
51 send_int(conn, MR_ARGS);
55 file_size = strtol(str, &p, 10);
58 send_int(conn, MR_ARGS);
66 checksum = strtol(str, &p, 10);
69 send_int(conn, MR_ARGS);
81 if (!have_authorization)
83 send_int(conn, MR_PERM);
88 code = get_file(conn, pathname, file_size, checksum, 0700, 0);
90 com_err(whoami, 0, "Transferred file %s", pathname);