7 static char *rcsid_xfer_002_c = "$Header$";
13 #include <sys/param.h>
19 extern CONNECTION conn;
22 extern int code, errno;
24 extern int have_authorization, have_file, done;
29 * >>> (STRING)"xfer_002" filesize checksum pathname
36 * >>> (STRING)data (last data block)
37 * <<< (int)code (from read, write, checksum verify)
40 * perform initial preparations and receive file as
41 * a single string, storing it into <pathname>.sms_update.
43 * still to be done: file locking; perform transfers in pieces instead
44 * of all at once; use checksums
60 reject_call(SMS_ARGS);
63 file_size = atoi(str);
76 if (!have_authorization) {
77 reject_call(SMS_PERM);
80 if (done) /* re-initialize data */
84 lose("sending ok for file xfer (2)");
85 code = get_file(pathname, file_size, checksum);
89 strcpy(buf, "transferred file ");
90 strcat(buf, pathname);