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>
23 extern CONNECTION conn;
26 extern int code, errno;
28 extern int have_authorization, have_file, done;
33 * >>> (STRING)"xfer_002" filesize checksum pathname
40 * >>> (STRING)data (last data block)
41 * <<< (int)code (from read, write, checksum verify)
44 * perform initial preparations and receive file as
45 * a single string, storing it into <pathname>.sms_update.
47 * still to be done: file locking; perform transfers in pieces instead
48 * of all at once; use checksums
64 reject_call(SMS_ARGS);
67 file_size = atoi(str);
80 if (!have_authorization) {
81 reject_call(SMS_PERM);
84 if (done) /* re-initialize data */
88 lose("sending ok for file xfer (2)");
89 code = get_file(pathname, file_size, checksum);
93 strcpy(buf, "transferred file ");
94 strcat(buf, pathname);