5 /* (c) Copyright 1988 by the Massachusetts Institute of Technology. */
6 /* For copying and distribution information, please see the file */
7 /* <mit-copyright.h>. */
10 static char *rcsid_xfer_002_c = "$Header$";
13 #include <mit-copyright.h>
17 #include <sys/param.h>
22 extern CONNECTION conn;
25 extern int code, errno;
27 extern int have_authorization, have_file, done;
32 * >>> (STRING)"xfer_002" filesize checksum pathname
39 * >>> (STRING)data (last data block)
40 * <<< (int)code (from read, write, checksum verify)
43 * perform initial preparations and receive file as
44 * a single string, storing it into <pathname>.moira_update.
46 * still to be done: file locking; perform transfers in pieces instead
47 * of all at once; use checksums
66 file_size = atoi(str);
79 if (!have_authorization) {
83 if (done) /* re-initialize data */
87 lose("sending ok for file xfer (2)");
88 code = get_file(pathname, file_size, checksum);
92 strcpy(buf, "transferred file ");
93 strcat(buf, pathname);