removed zmrle extension
This commit is contained in:
parent
9083842cbf
commit
992dac98bc
@ -13,7 +13,7 @@ SRCS = signature.c filesub.c language.c mbtoberep.c \
|
||||
timeout.c chat.c file.c misc.c \
|
||||
offline.c user.c mbnewusr.c input.c whoson.c \
|
||||
door.c dispfile.c userlist.c timestats.c logentry.c \
|
||||
zmrle.c zmmisc.c zmsend.c zmrecv.c
|
||||
zmmisc.c zmsend.c zmrecv.c
|
||||
HDRS = signature.h filesub.h language.h mbsebbs.h misc.h offline.h \
|
||||
timeout.h bbslist.h email.h fsedit.h lineedit.h \
|
||||
msgutil.h oneline.h user.h bye.h morefile.h \
|
||||
@ -22,14 +22,14 @@ HDRS = signature.h filesub.h language.h mbsebbs.h misc.h offline.h \
|
||||
pinfo.h chat.h file.h menu.h transfer.h \
|
||||
pop3.h timecheck.h mbnewusr.h input.h whoson.h \
|
||||
door.h dispfile.h userlist.h timestats.h logentry.h lastcallers.h \
|
||||
zmrle.h zmmisc.h zmsend.h zmrecv.h
|
||||
zmmisc.h zmsend.h zmrecv.h
|
||||
MBSEBBS_OBJS = signature.o bbslist.o chat.o file.o funcs.o mail.o menu.o \
|
||||
misc.o pinfo.o oneline.o page.o fsedit.o transfer.o \
|
||||
bye.o change.o mbsebbs.o timeout.o user.o timecheck.o \
|
||||
exitinfo.o filesub.o lineedit.o offline.o language.o msgutil.o \
|
||||
pop3.o email.o input.o whoson.o door.o dispfile.o userlist.o timestats.o \
|
||||
logentry.o morefile.o lastcallers.o term.o ttyio.o openport.o \
|
||||
zmrle.o zmmisc.o zmsend.o zmrecv.o
|
||||
zmmisc.o zmsend.o zmrecv.o
|
||||
MBSEBBS_LIBS = ../lib/libmbse.a ../lib/libmsgbase.a ../lib/libdbase.a ../lib/libmbinet.a ../lib/libnodelist.a
|
||||
MBNEWUSR_OBJS = mbnewusr.o newuser.o language.o timeout.o dispfile.o oneline.o ttyio.o \
|
||||
timecheck.o input.o exitinfo.o funcs.o misc.o change.o door.o term.o openport.o \
|
||||
@ -132,8 +132,7 @@ dispfile.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h ../lib/msg
|
||||
userlist.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h userlist.h language.h input.h timeout.h term.h ttyio.h
|
||||
timestats.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h timestats.h funcs.h language.h input.h exitinfo.h term.h
|
||||
logentry.o: ../config.h ../lib/mbselib.h ../lib/mbse.h ../lib/users.h logentry.h
|
||||
zmrle.o: ../config.h ../lib/mbselib.h ttyio.h zmrle.h zmmisc.h
|
||||
zmmisc.o: ../config.h ../lib/mbselib.h ttyio.h zmrle.h zmmisc.h
|
||||
zmsend.o: ../config.h ../lib/mbselib.h ttyio.h zmmisc.h zmrle.h transfer.h openport.h
|
||||
zmmisc.o: ../config.h ../lib/mbselib.h ttyio.h zmmisc.h
|
||||
zmsend.o: ../config.h ../lib/mbselib.h ttyio.h zmmisc.h transfer.h openport.h
|
||||
zmrecv.o: ../config.h ../lib/mbselib.h ../lib/users.h ttyio.h transfer.h zmmisc.h zmrecv.h openport.h
|
||||
# End of generated dependencies
|
||||
|
@ -163,8 +163,8 @@ int io_mode(int fd, int n)
|
||||
Syslog('t', "io_mode(%d, %d)", fd, n);
|
||||
|
||||
switch(n) {
|
||||
case 2: /* Un-raw mode used by sz, sb when -g detected */
|
||||
if(!did0) {
|
||||
case 2:
|
||||
if (!did0) {
|
||||
did0 = TRUE;
|
||||
tcgetattr(fd,&oldtty);
|
||||
}
|
||||
@ -176,8 +176,6 @@ int io_mode(int fd, int n)
|
||||
|
||||
tty.c_cflag &= ~PARENB; /* Disable parity */
|
||||
tty.c_cflag |= CS8; /* Set character size = 8 */
|
||||
// if (Twostop)
|
||||
// tty.c_cflag |= CSTOPB; /* Set two stop bits */
|
||||
#ifdef READCHECK
|
||||
tty.c_lflag = protocol==ZM_ZMODEM ? 0 : ISIG;
|
||||
tty.c_cc[VINTR] = protocol==ZM_ZMODEM ? -1 : 030; /* Interrupt char */
|
||||
@ -206,17 +204,18 @@ int io_mode(int fd, int n)
|
||||
return 0;
|
||||
case 1:
|
||||
case 3:
|
||||
if(!did0) {
|
||||
if (!did0) {
|
||||
did0 = TRUE;
|
||||
tcgetattr(fd,&oldtty);
|
||||
}
|
||||
tty = oldtty;
|
||||
|
||||
tty.c_iflag = IGNBRK;
|
||||
if (n==3) /* with flow control */
|
||||
if (n == 3) /* with flow control */
|
||||
tty.c_iflag |= IXOFF;
|
||||
|
||||
/* Setup raw mode: no echo, noncanonical (no edit chars),
|
||||
/*
|
||||
* Setup raw mode: no echo, noncanonical (no edit chars),
|
||||
* no signal generating chars, and no extended chars (^V,
|
||||
* ^O, ^R, ^W).
|
||||
*/
|
||||
@ -227,8 +226,6 @@ int io_mode(int fd, int n)
|
||||
/* Set character size = 8 */
|
||||
tty.c_cflag &= ~(CSIZE);
|
||||
tty.c_cflag |= CS8;
|
||||
// if (Twostop)
|
||||
// tty.c_cflag |= CSTOPB; /* Set two stop bits */
|
||||
#ifdef NFGVMIN
|
||||
tty.c_cc[VMIN] = 1; /* This many chars satisfies reads */
|
||||
#else
|
||||
@ -240,8 +237,8 @@ int io_mode(int fd, int n)
|
||||
Syslog('t', "Baudrate = %d", Baudrate);
|
||||
return 0;
|
||||
case 0:
|
||||
if(!did0)
|
||||
return ERROR;
|
||||
if (!did0)
|
||||
return -1;
|
||||
tcdrain (fd); /* wait until everything is sent */
|
||||
tcflush (fd,TCIOFLUSH); /* flush input queue */
|
||||
tcsetattr (fd,TCSADRAIN,&oldtty);
|
||||
|
@ -66,7 +66,6 @@ static void garbitch(void);
|
||||
#include "../config.h"
|
||||
#include "../lib/mbselib.h"
|
||||
#include "ttyio.h"
|
||||
#include "zmrle.h"
|
||||
#include "zmmisc.h"
|
||||
|
||||
|
||||
|
@ -22,14 +22,7 @@
|
||||
#define ZBIN 'A' /* Binary frame indicator (CRC-16) */
|
||||
#define ZHEX 'B' /* HEX frame indicator */
|
||||
#define ZBIN32 'C' /* Binary frame with 32 bit FCS */
|
||||
// #define ZBINR32 'D' /* RLE packed Binary frame with 32 bit FCS */
|
||||
// #define ZVBIN 'a' /* Binary frame indicator (CRC-16) */
|
||||
// #define ZVHEX 'b' /* HEX frame indicator */
|
||||
// #define ZVBIN32 'c' /* Binary frame with 32 bit FCS */
|
||||
// #define ZVBINR32 'd' /* RLE packed Binary frame with 32 bit FCS */
|
||||
// #define ZRESC 0176 /* RLE flag/escape character */
|
||||
#define ZMAXHLEN 16 /* Max header information length NEVER CHANGE */
|
||||
// #define ZMAXSPLEN 1024 /* Max subpacket length NEVER CHANGE */
|
||||
|
||||
|
||||
/* Frame types (see array "frametypes" in zm.c) */
|
||||
@ -82,27 +75,19 @@
|
||||
#define ZP3 3 /* High order 8 bits of file position */
|
||||
|
||||
/* Parameters for ZRINIT header */
|
||||
// #define ZRPXWN 8 /* 9th byte in header contains window size/256 */
|
||||
// #define ZRPXQQ 9 /* 10th to 14th bytes contain quote mask */
|
||||
/* Bit Masks for ZRINIT flags byte ZF0 */
|
||||
#define CANFDX 01 /* Rx can send and receive true FDX */
|
||||
#define CANOVIO 02 /* Rx can receive data during disk I/O */
|
||||
#define CANBRK 04 /* Rx can send a break signal */
|
||||
// #define CANRLE 010 /* Receiver can decode RLE */
|
||||
#define CANLZW 020 /* Receiver can uncompress */
|
||||
#define CANFC32 040 /* Receiver can use 32 bit Frame Check */
|
||||
#define ESCCTL 0100 /* Receiver expects ctl chars to be escaped */
|
||||
#define ESC8 0200 /* Receiver expects 8th bit to be escaped */
|
||||
|
||||
/* Bit Masks for ZRINIT flags byte ZF1 */
|
||||
// #define CANVHDR 01 /* Variable headers OK */
|
||||
// #define ZRRQWN 8 /* Receiver specified window size in ZRPXWN */
|
||||
// #define ZRRQQQ 16 /* Additional control chars to quote in ZRPXQQ */
|
||||
// #define ZRQNVH (ZRRQWN|ZRRQQQ) /* Variable len hdr reqd to access info */
|
||||
|
||||
/* Parameters for ZSINIT frame */
|
||||
#define ZATTNLEN 32 /* Max length of attention string */
|
||||
// #define ALTCOFF ZF1 /* Offset to alternate canit string, 0 if not used */
|
||||
/* Bit Masks for ZSINIT flags byte ZF0 */
|
||||
#define TESCCTL 0100 /* Transmitter expects ctl chars to be escaped */
|
||||
#define TESC8 0200 /* Transmitter expects 8th bit to be escaped */
|
||||
@ -130,9 +115,7 @@
|
||||
#define ZTRLE 3 /* Run Length encoding */
|
||||
/* Extended options for ZF3, bit encoded */
|
||||
#define ZXSPARS 64 /* Encoding for sparse file operations */
|
||||
// #define ZCANVHDR 01 /* Variable headers OK */
|
||||
/* Receiver window size override */
|
||||
// #define ZRWOVR 4 /* byte position for receive window override/256 */
|
||||
|
||||
/* Parameters for ZCOMMAND frame ZF0 (otherwise 0) */
|
||||
#define ZCACK1 1 /* Acknowledge, then do command */
|
||||
@ -154,7 +137,6 @@ char Attn[ZATTNLEN+1]; /* Attention string rx sends to tx on err */
|
||||
char *Altcan; /* Alternate canit string */
|
||||
char Zsendmask[33]; /* Additional control characters to mask */
|
||||
int Zctlesc;
|
||||
//int Usevhdrs; /* Use variable length headers */
|
||||
|
||||
enum zm_type_enum {
|
||||
ZM_XMODEM,
|
||||
|
@ -548,14 +548,16 @@ int putsec(char *buf, int n)
|
||||
{
|
||||
register char *p;
|
||||
|
||||
Syslog('z', "putsec %d characters %s mode", n, Thisbinary ? "binary":"ascii");
|
||||
// Syslog('z', "putsec %d characters %s mode", n, Thisbinary ? "binary":"ascii");
|
||||
|
||||
if (n == 0)
|
||||
return OK;
|
||||
|
||||
if (Thisbinary) {
|
||||
for (p = buf; --n>=0; )
|
||||
putc( *p++, fout);
|
||||
if (fwrite(buf, n, 1, fout) != 1)
|
||||
return ERROR;
|
||||
// for (p = buf; --n>=0; )
|
||||
// putc( *p++, fout);
|
||||
} else {
|
||||
if (Eofseen)
|
||||
return OK;
|
||||
|
214
mbsebbs/zmrle.c
214
mbsebbs/zmrle.c
@ -1,214 +0,0 @@
|
||||
/*
|
||||
* File: zmr.c
|
||||
* Copyright 1988, 1994 Omen Technology Inc All Rights Reserved
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* This module implements ZMODEM Run Length Encoding, an
|
||||
* extension that was not funded by the original Telenet
|
||||
* development contract.
|
||||
*
|
||||
* This software may be freely used for non commercial and
|
||||
* educational (didactic only) purposes. This software may also
|
||||
* be freely used to support file transfer operations to or from
|
||||
* licensed Omen Technology products. Any programs which use
|
||||
* part or all of this software must be provided in source form
|
||||
* with this notice intact except by written permission from Omen
|
||||
* Technology Incorporated.
|
||||
*
|
||||
* Use of this software for commercial or administrative purposes
|
||||
* except when exclusively limited to interfacing Omen Technology
|
||||
* products requires a per port license payment of $20.00 US per
|
||||
* port (less in quantity). Use of this code by inclusion,
|
||||
* decompilation, reverse engineering or any other means
|
||||
* constitutes agreement to these conditions and acceptance of
|
||||
* liability to license the materials and payment of reasonable
|
||||
* legal costs necessary to enforce this license agreement.
|
||||
*
|
||||
*
|
||||
* Omen Technology Inc FAX: 503-621-3745
|
||||
* Post Office Box 4681
|
||||
* Portland OR 97208
|
||||
*
|
||||
* This code is made available in the hope it will be useful,
|
||||
* BUT WITHOUT ANY WARRANTY OF ANY KIND OR LIABILITY FOR ANY
|
||||
* DAMAGES OF ANY KIND.
|
||||
*
|
||||
* ZMODEM RLE compression and decompression functions
|
||||
*/
|
||||
|
||||
#include "../config.h"
|
||||
#include "../lib/mbselib.h"
|
||||
#include "ttyio.h"
|
||||
#include "zmrle.h"
|
||||
#include "zmmisc.h"
|
||||
|
||||
|
||||
extern char *Zendnames[];
|
||||
|
||||
|
||||
/*
|
||||
* Send data subpacket RLE encoded with 32 bit FCS
|
||||
*/
|
||||
/*
|
||||
void zsdar32(char *buf, int length, int frameend)
|
||||
{
|
||||
register int c, l, n;
|
||||
register unsigned long crc;
|
||||
|
||||
crc = 0xFFFFFFFFL;
|
||||
l = *buf++ & 0377;
|
||||
|
||||
if (length == 1) {
|
||||
zsendline(l);
|
||||
crc = updcrc32(l, crc);
|
||||
if (l == ZRESC) {
|
||||
zsendline(1);
|
||||
crc = updcrc32(1, crc);
|
||||
}
|
||||
} else {
|
||||
for (n = 0; --length >= 0; ++buf) {
|
||||
if ((c = *buf & 0377) == l && n < 126 && length>0) {
|
||||
++n; continue;
|
||||
}
|
||||
switch (n) {
|
||||
case 0: zsendline(l);
|
||||
crc = updcrc32(l, crc);
|
||||
if (l == ZRESC) {
|
||||
zsendline(0100);
|
||||
crc = updcrc32(0100, crc);
|
||||
}
|
||||
l = c; break;
|
||||
case 1: if (l != ZRESC) {
|
||||
zsendline(l);
|
||||
zsendline(l);
|
||||
crc = updcrc32(l, crc);
|
||||
crc = updcrc32(l, crc);
|
||||
n = 0;
|
||||
l = c;
|
||||
break;
|
||||
}
|
||||
*/ /* **** FALL THRU TO **** */
|
||||
/* default: zsendline(ZRESC); crc = updcrc32(ZRESC, crc);
|
||||
if (l == 040 && n < 34) {
|
||||
n += 036;
|
||||
zsendline(n);
|
||||
crc = updcrc32(n, crc);
|
||||
} else {
|
||||
n += 0101;
|
||||
zsendline(n);
|
||||
crc = updcrc32(n, crc);
|
||||
zsendline(l);
|
||||
crc = updcrc32(l, crc);
|
||||
}
|
||||
n = 0;
|
||||
l = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
PUTCHAR(ZDLE);
|
||||
PUTCHAR(frameend);
|
||||
crc = updcrc32(frameend, crc);
|
||||
|
||||
crc = ~crc;
|
||||
for (length=4; --length >= 0;) {
|
||||
zsendline((int)crc);
|
||||
crc >>= 8;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Receive data subpacket RLE encoded with 32 bit FCS
|
||||
*/
|
||||
/*
|
||||
int zrdatr32(register char *buf, int length)
|
||||
{
|
||||
register int c;
|
||||
register unsigned long crc;
|
||||
register char *end;
|
||||
register int d;
|
||||
|
||||
crc = 0xFFFFFFFFL;
|
||||
Rxcount = 0;
|
||||
end = buf + length;
|
||||
d = 0; */ /* Use for RLE decoder state */ /*
|
||||
while (buf <= end) {
|
||||
if ((c = zdlread()) & ~0377) {
|
||||
crcfoo:
|
||||
switch (c) {
|
||||
case GOTCRCE:
|
||||
case GOTCRCG:
|
||||
case GOTCRCQ:
|
||||
case GOTCRCW: d = c;
|
||||
c &= 0377;
|
||||
crc = updcrc32(c, crc);
|
||||
if ((c = zdlread()) & ~0377)
|
||||
goto crcfoo;
|
||||
crc = updcrc32(c, crc);
|
||||
if ((c = zdlread()) & ~0377)
|
||||
goto crcfoo;
|
||||
crc = updcrc32(c, crc);
|
||||
if ((c = zdlread()) & ~0377)
|
||||
goto crcfoo;
|
||||
crc = updcrc32(c, crc);
|
||||
if ((c = zdlread()) & ~0377)
|
||||
goto crcfoo;
|
||||
crc = updcrc32(c, crc);
|
||||
if (crc != 0xDEBB20E3) {
|
||||
Syslog('+', "Zmodem zrdatr32: Bad CRC");
|
||||
return TERROR;
|
||||
}
|
||||
Rxcount = length - (end - buf);
|
||||
|
||||
Syslog('z', "zrdatr32: %d %s", Rxcount, Zendnames[(d-GOTCRCE)&3]);
|
||||
|
||||
return d;
|
||||
case GOTCAN: Syslog('+', "Zmodem: Sender Canceled");
|
||||
return ZCAN;
|
||||
case TIMEOUT: Syslog('+', "Zmodem: TIMEOUT");
|
||||
return c;
|
||||
default: Syslog('+', "Zmodem: Bad data subpacket");
|
||||
return c;
|
||||
}
|
||||
}
|
||||
crc = updcrc32(c, crc);
|
||||
switch (d) {
|
||||
case 0: if (c == ZRESC) {
|
||||
d = -1;
|
||||
continue;
|
||||
}
|
||||
*buf++ = c;
|
||||
continue;
|
||||
case -1: if (c >= 040 && c < 0100) {
|
||||
d = c - 035;
|
||||
c = 040;
|
||||
goto spaces;
|
||||
}
|
||||
if (c == 0100) {
|
||||
d = 0;
|
||||
*buf++ = ZRESC;
|
||||
continue;
|
||||
}
|
||||
d = c;
|
||||
continue;
|
||||
default: d -= 0100;
|
||||
if (d < 1)
|
||||
goto badpkt;
|
||||
spaces:
|
||||
if ((buf + d) > end)
|
||||
goto badpkt;
|
||||
while ( --d >= 0)
|
||||
*buf++ = c;
|
||||
d = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
badpkt:
|
||||
Syslog('+', "Zmodem: Data subpacket too long");
|
||||
return TERROR;
|
||||
}
|
||||
*/
|
||||
|
@ -1,11 +0,0 @@
|
||||
#ifndef _ZMRLE_H
|
||||
#define _ZMRLE_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
void zsdar32(char *, int, int);
|
||||
int zrdatr32(register char *, int);
|
||||
*/
|
||||
|
||||
#endif
|
@ -32,7 +32,6 @@
|
||||
#include "../lib/mbselib.h"
|
||||
#include "ttyio.h"
|
||||
#include "zmmisc.h"
|
||||
#include "zmrle.h"
|
||||
#include "transfer.h"
|
||||
#include "openport.h"
|
||||
|
||||
@ -79,6 +78,8 @@ extern int Rxhlen;
|
||||
extern char *txbuf;
|
||||
extern char *frametypes[];
|
||||
|
||||
extern unsigned Baudrate;
|
||||
|
||||
|
||||
int zmsndfiles(down_list *lst)
|
||||
{
|
||||
@ -126,6 +127,7 @@ int zmsndfiles(down_list *lst)
|
||||
free(txbuf);
|
||||
txbuf = NULL;
|
||||
free_frame_buffer();
|
||||
io_mode(0, 1);
|
||||
|
||||
Syslog('z', "Zmodem: send rc=%d", maxrc);
|
||||
return (maxrc < 2)?0:maxrc;
|
||||
@ -139,7 +141,7 @@ static int initsend(void)
|
||||
|
||||
io_mode(0, 1);
|
||||
PUTSTR((char *)"rz\r");
|
||||
stohdr(0x80L); /* Show we can do var header */
|
||||
stohdr(0L);
|
||||
zshhdr(ZRQINIT, Txhdr);
|
||||
|
||||
if (getzrxinit()) {
|
||||
@ -247,35 +249,36 @@ int getzrxinit(void) // CHECKED BUT NOT WELL TESTED
|
||||
zshhdr(ZACK, Txhdr);
|
||||
continue;
|
||||
case ZCOMMAND: /* They didn't see out ZRQINIT */
|
||||
stohdr(0L);
|
||||
zshhdr(ZRQINIT, Txhdr);
|
||||
/* A receiver cannot send a command */
|
||||
continue;
|
||||
case ZRINIT:
|
||||
Rxflags = 0377 & Rxhdr[ZF0];
|
||||
// Usevhdrs = Rxhdr[ZF1] & CANVHDR;
|
||||
Txfcs32 = (Wantfcs32 && (Rxflags & CANFC32));
|
||||
Zctlesc |= Rxflags & TESCCTL;
|
||||
|
||||
Rxbuflen = (0377 & Rxhdr[ZP0])+((0377 & Rxhdr[ZP1])<<8);
|
||||
if ( !(Rxflags & CANFDX))
|
||||
Txwindow = 0;
|
||||
Txwindow = 0;
|
||||
Syslog('z', "Zmodem: Remote allowed Rxbuflen=%d", Rxbuflen);
|
||||
io_mode(0, 2); /* Set cbreak, XON/XOFF, etc. */
|
||||
|
||||
/* Set initial subpacket length */
|
||||
if (blklen < 1024) { /* Command line override? */
|
||||
if (Baudrate > 300)
|
||||
blklen = 256;
|
||||
if (Baudrate > 1200)
|
||||
blklen = 512;
|
||||
if (Baudrate > 2400)
|
||||
blklen = 1024;
|
||||
}
|
||||
if (Rxbuflen && blklen>Rxbuflen)
|
||||
blklen = Rxbuflen;
|
||||
blklen = Rxbuflen;
|
||||
if (blkopt && blklen > blkopt)
|
||||
blklen = blkopt;
|
||||
blklen = blkopt;
|
||||
Syslog('z', "Rxbuflen=%d blklen=%d", Rxbuflen, blklen);
|
||||
Syslog('z', "Txwindow = %u Txwspac = %d", Txwindow, Txwspac);
|
||||
|
||||
// if (Lztrans == ZTRLE && (Rxflags & CANRLE))
|
||||
// Txfcs32 = 2;
|
||||
// else
|
||||
Lztrans = 0;
|
||||
Lztrans = 0;
|
||||
|
||||
return (sendzsinit());
|
||||
case ZCAN:
|
||||
@ -285,7 +288,7 @@ int getzrxinit(void) // CHECKED BUT NOT WELL TESTED
|
||||
return HANGUP;
|
||||
case ZRQINIT:
|
||||
if (Rxhdr[ZF0] == ZCOMMAND)
|
||||
continue;
|
||||
continue;
|
||||
default:
|
||||
zshhdr(ZNAK, Txhdr);
|
||||
continue;
|
||||
@ -337,7 +340,7 @@ int zfilbuf(void)
|
||||
n = fread(txbuf, 1, blklen, in);
|
||||
if (n < blklen) {
|
||||
Eofseen = 1;
|
||||
Syslog('Z', "zfilbuf return %d", n);
|
||||
Syslog('z', "zfilbuf return %d", n);
|
||||
}
|
||||
|
||||
return n;
|
||||
@ -369,10 +372,13 @@ again:
|
||||
switch (c) {
|
||||
case ZRINIT:
|
||||
while ((c = GETCHAR(5)) > 0)
|
||||
if (c == ZPAD) {
|
||||
goto again;
|
||||
}
|
||||
if (c == ZPAD) {
|
||||
goto again;
|
||||
}
|
||||
continue;
|
||||
case ZRQINIT:
|
||||
Syslog('+', "got ZRQINIT, a zmodem sender talks to this sender");
|
||||
return TERROR;
|
||||
case ZCAN:
|
||||
case TIMEOUT:
|
||||
case ZABORT:
|
||||
@ -387,14 +393,14 @@ again:
|
||||
continue;
|
||||
case ZCRC:
|
||||
if (Rxpos != lastcrcrq) {
|
||||
lastcrcrq = Rxpos;
|
||||
crc = 0xFFFFFFFFL;
|
||||
fseek(in, 0L, 0);
|
||||
while (((c = getc(in)) != EOF) && --lastcrcrq)
|
||||
crc = updcrc32(c, crc);
|
||||
crc = ~crc;
|
||||
clearerr(in); /* Clear possible EOF */
|
||||
lastcrcrq = Rxpos;
|
||||
lastcrcrq = Rxpos;
|
||||
crc = 0xFFFFFFFFL;
|
||||
fseek(in, 0L, 0);
|
||||
while (((c = getc(in)) != EOF) && --lastcrcrq)
|
||||
crc = updcrc32(c, crc);
|
||||
crc = ~crc;
|
||||
clearerr(in); /* Clear possible EOF */
|
||||
lastcrcrq = Rxpos;
|
||||
}
|
||||
stohdr(crc);
|
||||
zsbhdr(ZCRC, Txhdr);
|
||||
@ -409,9 +415,9 @@ again:
|
||||
* lastyunc==bytcnt
|
||||
*/
|
||||
if (Rxpos > 0)
|
||||
skipsize = Rxpos;
|
||||
skipsize = Rxpos;
|
||||
if (fseek(in, Rxpos, 0))
|
||||
return TERROR;
|
||||
return TERROR;
|
||||
Lastsync = (bytcnt = Txpos = Lrxpos = Rxpos) -1;
|
||||
return zsendfdata();
|
||||
}
|
||||
|
Reference in New Issue
Block a user