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"
21 extern CONNECTION conn;
22 extern char buf[BUFSIZ];
26 extern int have_authorization, have_file, done;
31 * >>> (STRING)"xfer_002" filesize checksum pathname
38 * >>> (STRING)data (last data block)
39 * <<< (int)code (from read, write, checksum verify)
42 * perform initial preparations and receive file as
43 * a single string, storing it into <pathname>.moira_update.
45 * still to be done: file locking; perform transfers in pieces instead
46 * of all at once; use checksums
49 int xfer_002(char *str)
64 file_size = atoi(str);
77 if (!have_authorization)
82 if (done) /* re-initialize data */
86 lose("sending ok for file xfer (2)");
87 code = get_file(pathname, file_size, checksum, 0700, 0);
92 strcpy(buf, "transferred file ");
93 strcat(buf, pathname);