Lines Matching +full:per +full:- +full:hart
2 lrz - receive files with x/y/zmodem
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.
40 //#include "long-options.h"
115 int tcp_socket=-1;
176 if (!zi->fname) \
179 shortname=strrchr(zi->fname,'/'); \
181 shortname=zi->fname; \
232 wait_msec -= xyzModem_CHAR_TIMEOUT; in read_data()
486 {"allow-commands", no_argument, NULL, 'C'},
487 {"allow-remote-commands", no_argument, NULL, 'C'},
491 {"crc-check", no_argument, NULL, 'H'},
492 {"junk-path", no_argument, NULL, 'j'},
494 {"disable-timeouts", no_argument, NULL, 'O'},
495 {"disable-timeout", no_argument, NULL, 'O'}, /* i can't get it right */
496 {"min-bps", required_argument, NULL, 'm'},
497 {"min-bps-time", required_argument, NULL, 'M'},
499 {"newer-or-longer", no_argument, NULL, 'N'},
504 {"stop-at", required_argument, NULL, 's'},
507 {"keep-uppercase", no_argument, NULL, 'u'},
511 {"with-crc", no_argument, NULL, 'c'},
518 {"delay-startup", required_argument, NULL, 4},
519 {"o-sync", no_argument, NULL, 5},
521 {"tcp-server", no_argument, NULL, 6},
522 {"tcp-client", required_argument, NULL, 7},
562 //chkinvok(argv[0]); /* if called as [-]rzCOMMAND set flag */ in zmodem_rx()
592 buffersize=-1; in zmodem_rx()
642 tm->tm_hour=hh; in zmodem_rx()
643 tm->tm_min=hh; in zmodem_rx()
647 if (stop_time - t <10) in zmodem_rx()
653 STRTOL_FATAL_ERROR (optarg, _("stop-at"), s_err); in zmodem_rx()
700 DO_SYSLOG((LOG_INFO,"--unrestrict option used under restricted shell")); in zmodem_rx()
733 usage(2,_("bytes-per-error should be >100")); in zmodem_rx()
778 //npats = argc - optind; in zmodem_rx()
815 if (gethostname(hn,sizeof(hn))==-1) { in zmodem_rx()
818 fprintf(stdout,"connect with lrz --tcp-client \"%s:%s\"\n",hn,p); in zmodem_rx()
977 bps=(zi.bytes_received-zi.bytes_skipped)/d; in wcreceive()
981 _("\rBytes received: %7ld/%7ld BPS:%-6ld \r\n"), in wcreceive()
996 dummy[0]='\0'; /* pre-ANSI HPUX cc demands this */ in wcreceive()
1050 bps=(zi.bytes_received-zi.bytes_skipped)/d; in wcreceive()
1053 _("\rBytes received: %7ld BPS:%-6ld \r\n"), in wcreceive()
1107 zi->eof_seen=FALSE; in wcrxpn()
1130 * Jack M. Wierda and Roderick W. Hart
1140 zi->eof_seen=FALSE; in wcrx()
1153 if (zi->bytes_total && R_BYTESLEFT(zi) < Blklen) in wcrx()
1155 zi->bytes_received+=Blklen; in wcrx()
1212 for (p=rxbuf,wcj=*Blklen; --wcj>=0; ) { in wcgetsec()
1232 else if (((checksum-firstch)&0377)==0) { in wcgetsec()
1272 while(cnt-- && READLINE_PF(1)!=TIMEOUT) in wcgetsec()
1294 * do ZCRC-Check for open file f.
1295 * check at most check_bytes bytes (crash recovery). if 0 -> whole file.
1313 if (-1==fstat(fileno(f),&st)) { in do_crc_check()
1325 //while (n-- && ((c = getc(f)) != EOF)) in do_crc_check()
1382 /* alert - file name ended in with a / */ in procheader()
1395 zi->fname=name_static; in procheader()
1431 zi->bytes_total = DEFBYTL; in procheader()
1432 zi->mode = 0; in procheader()
1433 zi->eof_seen = 0; in procheader()
1434 zi->modtime = 0; in procheader()
1443 zi->modtime=modtime; in procheader()
1444 zi->bytes_total=bytes_total; in procheader()
1445 zi->mode=mode; in procheader()
1446 if (zi->mode & UNIXFILE) in procheader()
1466 if (-1==fstat(fileno(fout),&sta)) { in procheader()
1479 if (sta.st_mtime > zi->modtime) { in procheader()
1485 /* newer-or-longer */ in procheader()
1487 if (((size_t) sta.st_size) >= zi->bytes_total in procheader()
1488 && sta.st_mtime > zi->modtime) { in procheader()
1496 int r=do_crc_check(NULL,zi->bytes_total,0); in procheader()
1532 zi->fname=name_static; in procheader()
1542 if ( *--p == '.') /* zap trailing period */ in procheader()
1550 long d=t-zi->modtime; in procheader()
1555 (long) t, (long) zi->modtime, d); in procheader()
1560 tv.tv_sec=zi->modtime; in procheader()
1576 zi->bytes_received=0; in procheader()
1583 && !(zi->mode&UNIXFILE)) in procheader()
1620 /* cast because we might not have a prototyp for strdup :-/ */ in procheader()
1626 return -1; in procheader()
1632 /* looks like a security hole -- uwe */ in procheader()
1637 Topipe = -1; return(OK); in procheader()
1650 int r=do_crc_check(NULL,zi->bytes_total,0); in procheader()
1659 //if ((unsigned long)st.st_size > zi->bytes_total) { in procheader()
1664 zi->bytes_skipped = 0 & ~(1023); in procheader()
1667 if (fseek(fout, (long) zi->bytes_skipped, SEEK_SET)) { in procheader()
1674 zi->bytes_skipped=0; /* resume impossible, file has changed */ in procheader()
1677 zi->bytes_skipped=0; in procheader()
1720 if (buffersize==-1 && s) { in procheader()
1721 if (zi->bytes_total>last_length) { in procheader()
1729 if (buffersize==-1) { in procheader()
1730 if (zi->bytes_total>0) in procheader()
1731 last_length=zi->bytes_total; in procheader()
1752 zi->bytes_received=zi->bytes_skipped; in procheader()
1759 * Directory-creating routines from Public Domain TAR by John Gilmore
1779 if (p == pathname || p[-1] == '/') in make_dirs()
1782 if (p[-1] == '.' && (p == pathname+1 || p[-2] == '/')) in make_dirs()
1829 if (zi->eof_seen)
1831 for (p=buf; n>0; ++p,n-- ) {
1835 zi->eof_seen=TRUE;
1894 * If called as [-][dir/../]vrzCOMMAND set Verbose to 1
1895 * If called as [-][dir/../]rzCOMMAND set the pipe flag
1904 while (*p == '-') in chkinvok()
1914 s++; /* lrz -> rz */ in chkinvok()
1945 bibi(-1); in checkpath()
1959 bibi(-1); in checkpath()
1967 bibi(-1); in checkpath()
1976 * Return ZFILE if Zmodem filename received, -1 on error,
1991 (--n + zrqinits_received) >=0 && zrqinits_received<10; ) { in tryz()
2012 if (tcp_socket==-1 && *tcp_buf) { in tryz()
2021 tryzhdrtype = ZRINIT; /* CAF 8-21-87 */ in tryz()
2040 /* resume with sz -r is impossible (at least with unix sz) in tryz()
2059 * trouble: if rz get --escape flag: in tryz()
2060 * - it sends TESCCTL to sz, in tryz()
2061 * get a ZSINIT _without_ TESCCTL (yeah - sender didn't know), in tryz()
2063 * - sender receives TESCCTL and uses "|=..." in tryz()
2149 xil_printf("%s(): receive %s (%d bytes)complete\n\r", __func__, zi->fname, (u32)zi->bytes_total); in rzfiles()
2160 bps=(zi->bytes_received-zi->bytes_skipped)/d; in rzfiles()
2163 _("\rBytes received: %7ld/%7ld BPS:%-6ld \r\n"), in rzfiles()
2164 (long) zi->bytes_received, (long) zi->bytes_total, bps); in rzfiles()
2167 protname(), (long) zi->bytes_total,bps)); in rzfiles()
2224 zi->eof_seen=FALSE; in rzfile()
2239 stohdr(zi->bytes_received); in rzfile()
2247 if (akt->pos==zi->bytes_received) { in rzfile()
2248 putsec(zi, akt->data, akt->len); in rzfile()
2249 zi->bytes_received += akt->len; in rzfile()
2250 vfile("using saved out-of-sync-paket %lx, len %ld", in rzfile()
2251 akt->pos,akt->len); in rzfile()
2255 next=akt->next; in rzfile()
2256 if (akt->pos<zi->bytes_received) { in rzfile()
2257 vfile("removing unneeded saved out-of-sync-paket %lx, len %ld", in rzfile()
2258 akt->pos,akt->len); in rzfile()
2260 last->next=akt->next; in rzfile()
2262 anker=akt->next; in rzfile()
2263 free(akt->data); in rzfile()
2286 if ( --n < 0) { in rzfile()
2302 if (rclhdr(Rxhdr) != (long) zi->bytes_received) { in rzfile()
2304 * Ignore eof if it's at wrong place - force in rzfile()
2325 if ( --n < 0) { in rzfile()
2346 if (rclhdr(Rxhdr) != (long) zi->bytes_received) { in rzfile()
2351 if ( --n < 0) { in rzfile()
2364 if (pos>zi->bytes_received) { in rzfile()
2367 neu->data=malloc(bytes_in_block); in rzfile()
2368 if (neu && neu->data) { in rzfile()
2372 "saving out-of-sync-block %lx, len %lu", in rzfile()
2375 vfile("saving out-of-sync-block %lx, len %lu",pos, in rzfile()
2377 memcpy(neu->data,secbuf,bytes_in_block); in rzfile()
2378 neu->pos=pos; in rzfile()
2379 neu->len=bytes_in_block; in rzfile()
2380 neu->next=anker; in rzfile()
2398 || zi->bytes_received > last_bps / 2 + last_rxbytes)) { in rzfile()
2407 last_bps=zi->bytes_received/d; in rzfile()
2415 if (now-low_bps>=min_bps_time) { in rzfile()
2441 vstringf(_("\rBytes received: %7ld/%7ld BPS:%-6ld ETA %02d:%02d "), in rzfile()
2442 (long) zi->bytes_received, (long) zi->bytes_total, in rzfile()
2444 last_rxbytes=zi->bytes_received; in rzfile()
2475 if ( --n < 0) { in rzfile()
2489 if ( --n < 0) { in rzfile()
2506 zi->bytes_received += bytes_in_block; in rzfile()
2507 stohdr(zi->bytes_received); in rzfile()
2518 zi->bytes_received += bytes_in_block; in rzfile()
2519 stohdr(zi->bytes_received); in rzfile()
2530 zi->bytes_received += bytes_in_block; in rzfile()
2540 zi->bytes_received += bytes_in_block; in rzfile()
2568 write(1,s,(size_t) (p-s)); in zmputs()
2590 if(0>(nr=readlink(fnmbuf, buf, sizeof(buf)))) return -1;
2626 if (zi->modtime) {
2630 timep.modtime = zi->modtime;
2635 //timep[1] = zi->modtime;
2640 if (S_ISREG(zi->mode)) {
2642 //if ((zi->mode&S_IFMT) == S_IFREG) {
2651 chmod(Pathname, (00666 & zi->mode));
2653 chmod(Pathname, (07777 & zi->mode));
2671 for (n=3; --n>=0; ) {
2710 execl("/bin/sh", "sh", "-c", s);