File transfer times now in mSecs calculated
This commit is contained in:
parent
c00a90da19
commit
56ea18bebf
@ -4738,7 +4738,7 @@ v0.33.20 10-Feb-2002
|
||||
Added experimental support for binkp GET command frame, under
|
||||
test now.
|
||||
Registers TCP/IP sessions with mbtask.
|
||||
Experimental: binkp filetransfer times are calculated in mSec.
|
||||
All filetransfer times and cps rates are calculated in mSecs.
|
||||
|
||||
mbout:
|
||||
The status display has now 9 digits for the outbound size.
|
||||
|
@ -88,11 +88,11 @@ depend:
|
||||
# Dependencies generated by make depend
|
||||
zmmisc.o: ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ttyio.h session.h zmodem.h
|
||||
zmrle.o: ../lib/libs.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h ttyio.h session.h zmodem.h
|
||||
zmrecv.o: ../lib/libs.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h lutil.h ttyio.h session.h zmodem.h config.h emsi.h openfile.h openport.h
|
||||
zmrecv.o: ../lib/libs.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h lutil.h ttyio.h session.h zmodem.h config.h emsi.h openfile.h filelist.h openport.h
|
||||
zmsend.o: ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ttyio.h session.h zmodem.h lutil.h emsi.h filelist.h
|
||||
binkp.o: ../lib/libs.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbnode.h ../lib/clcomm.h ttyio.h session.h statetbl.h config.h emsi.h openfile.h respfreq.h filelist.h opentcp.h rdoptions.h lutil.h binkp.h config.h
|
||||
xmsend.o: ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h session.h ttyio.h statetbl.h xmsend.h m7send.h filelist.h filetime.h
|
||||
xmrecv.o: ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h session.h ttyio.h statetbl.h config.h lutil.h openfile.h m7recv.h xmrecv.h filetime.h
|
||||
xmrecv.o: ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h session.h ttyio.h statetbl.h config.h lutil.h openfile.h m7recv.h xmrecv.h filelist.h filetime.h
|
||||
m7recv.o: ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h statetbl.h ttyio.h m7recv.h
|
||||
m7send.o: ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h statetbl.h ttyio.h m7send.h
|
||||
hydra.o: ../lib/libs.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h session.h filelist.h filetime.h ttyio.h statetbl.h config.h emsi.h openfile.h lutil.h respfreq.h mbcico.h hydra.h
|
||||
|
@ -32,9 +32,6 @@
|
||||
/*
|
||||
* ifcico v3.0.cm - hydra protocol module
|
||||
* Copyright (C) 1996-98 Christof Meerwald.
|
||||
*
|
||||
* $RCSfile$ - $Author$
|
||||
* $Revision$ - $Date$
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -546,8 +543,9 @@ int hydra_batch(int role, file_list *to_send)
|
||||
int txwaitpkt, rxwaitpkt;
|
||||
enum HyPktTypes pkttype;
|
||||
int waitputget = 0;
|
||||
time_t rxstarttime, rxendtime;
|
||||
time_t txstarttime, txendtime;
|
||||
struct timeval txstarttime, txendtime;
|
||||
struct timeval rxstarttime, rxendtime;
|
||||
struct timezone tz;
|
||||
int sverr;
|
||||
|
||||
Syslog('h', "Hydra: resettimers");
|
||||
@ -566,8 +564,9 @@ int hydra_batch(int role, file_list *to_send)
|
||||
SETTIMER(TIMERNO_BRAIN, H_BRAINDEAD);
|
||||
txstate = HTX_START;
|
||||
txoptions = HTXI_OPTIONS;
|
||||
rxstarttime = txstarttime = time(NULL);
|
||||
|
||||
txstarttime.tv_sec = txstarttime.tv_usec = txendtime.tv_sec = txendtime.tv_usec = 0;
|
||||
rxstarttime.tv_sec = rxstarttime.tv_usec = rxendtime.tv_sec = rxendtime.tv_usec = 0;
|
||||
tz.tz_minuteswest = tz.tz_dsttime = 0;
|
||||
rxstate = HRX_INIT;
|
||||
rxoptions = HRXI_OPTIONS;
|
||||
|
||||
@ -839,7 +838,7 @@ int hydra_batch(int role, file_list *to_send)
|
||||
|
||||
Syslog('+', "Hydra: send \"%s\" as \"%s\"", MBSE_SS(to_send->local), MBSE_SS(to_send->remote));
|
||||
Syslog('+', "Hydra: size %lu bytes, dated %s",(unsigned long)txstat.st_size, date(txstat.st_mtime));
|
||||
txstarttime = time(NULL);
|
||||
gettimeofday(&txstarttime, &tz);
|
||||
}
|
||||
|
||||
txstate = HTX_ToFName;
|
||||
@ -1116,22 +1115,18 @@ int hydra_batch(int role, file_list *to_send)
|
||||
/*
|
||||
* calculate time needed and bytes transferred
|
||||
*/
|
||||
txendtime = time(NULL);
|
||||
txstarttime = txendtime - txstarttime;
|
||||
|
||||
if (txstarttime <= 0L)
|
||||
txstarttime = 1L;
|
||||
gettimeofday(&txendtime, &tz);
|
||||
|
||||
/* close transmitter file */
|
||||
fclose(txfp);
|
||||
|
||||
if (txpos >= 0) {
|
||||
stxpos = txpos - stxpos;
|
||||
Syslog('+', "Hydra: OK %lu bytes in %s (%ld cps)",
|
||||
stxpos, str_time(txstarttime), stxpos/txstarttime);
|
||||
Syslog('+', "Hydra: OK %s", transfertime(txstarttime, txendtime, stxpos, TRUE));
|
||||
execute_disposition(to_send);
|
||||
} else {
|
||||
Syslog('+', "Hydra: transmitter skipped file after %ld seconds", txstarttime);
|
||||
Syslog('+', "Hydra: transmitter skipped file after %ld seconds",
|
||||
txendtime.tv_sec - txstarttime.tv_sec);
|
||||
}
|
||||
|
||||
to_send = to_send->next;
|
||||
@ -1325,7 +1320,7 @@ int hydra_batch(int role, file_list *to_send)
|
||||
Name, filesize, date(timestamp));
|
||||
|
||||
rxfp = openfile(Name, timestamp, filesize, &rxpos, resync);
|
||||
rxstarttime = time(NULL);
|
||||
gettimeofday(&rxstarttime, &tz);
|
||||
|
||||
/* check for error opening file */
|
||||
if (rxfp) {
|
||||
@ -1415,19 +1410,15 @@ int hydra_batch(int role, file_list *to_send)
|
||||
/*
|
||||
* calculate time and CPU usage needed
|
||||
*/
|
||||
rxendtime = time(NULL);
|
||||
gettimeofday(&rxendtime, &tz);
|
||||
|
||||
if (rxpos >= 0) {
|
||||
rxfp = NULL;
|
||||
if (!closefile(1)) {
|
||||
srxpos = rxpos - srxpos;
|
||||
|
||||
rxstarttime = rxendtime - rxstarttime;
|
||||
if (rxstarttime <= 0)
|
||||
rxstarttime = 1L;
|
||||
|
||||
Syslog('+', "Hydra: OK %lu bytes in %s (%ld cps)",
|
||||
srxpos, str_time(rxstarttime), srxpos/rxstarttime);
|
||||
Syslog('+', "Hydra: OK %s",
|
||||
transfertime(rxstarttime, rxendtime, srxpos, FALSE));
|
||||
|
||||
rxstate = HRX_OkEOF;
|
||||
} else {
|
||||
@ -1442,7 +1433,7 @@ int hydra_batch(int role, file_list *to_send)
|
||||
}
|
||||
} else {
|
||||
Syslog('+', "Hydra: receiver skipped file after %ld seconds",
|
||||
rxendtime - rxstarttime);
|
||||
rxendtime.tv_sec - rxstarttime.tv_sec);
|
||||
|
||||
if (rxfp) {
|
||||
closefile(0);
|
||||
|
@ -54,7 +54,9 @@ static FILE *in;
|
||||
static char txbuf[2048];
|
||||
static char rxbuf[2048];
|
||||
static int rx_type;
|
||||
static long startime,endtime,sbytes;
|
||||
static long sbytes;
|
||||
struct timeval starttime, endtime;
|
||||
struct timezone tz;
|
||||
static off_t rxbytes;
|
||||
|
||||
static int sendtfile(char *,char *);
|
||||
@ -197,7 +199,7 @@ static int sendtfile(char *ln, char *rn)
|
||||
if (st.st_size > 0) {
|
||||
Syslog('+', "TCP send \"%s\" as \"%s\"", MBSE_SS(ln), MBSE_SS(rn));
|
||||
Syslog('+', "TCP size %lu bytes, dated %s", (unsigned long)st.st_size, date(st.st_mtime));
|
||||
startime = time(NULL);
|
||||
gettimeofday(&starttime, &tz);
|
||||
} else {
|
||||
Syslog('+', "File \"%s\" has 0 size, skiped",ln);
|
||||
return 0;
|
||||
@ -239,15 +241,9 @@ static int sendtfile(char *ln, char *rn)
|
||||
}
|
||||
|
||||
if (rc == 0 && strncmp(rxbuf,"FOK",3) == 0) {
|
||||
endtime = time(NULL);
|
||||
|
||||
if ((startime=endtime-startime) == 0)
|
||||
startime = 1;
|
||||
gettimeofday(&endtime, &tz);
|
||||
Syslog('a', "st_size %d, offset %d",st.st_size,offset);
|
||||
Syslog('+', "Sent %lu bytes in %s (%ld cps)",
|
||||
(unsigned long)st.st_size-offset,
|
||||
str_time(startime),
|
||||
(long)(st.st_size-offset)/startime);
|
||||
Syslog('+', "TCP: OK %s", transfertime(starttime, endtime, st.st_size-offset, TRUE));
|
||||
sentbytes += (unsigned long)st.st_size - offset;
|
||||
return 0;
|
||||
} else if(strncmp(rxbuf,"FERROR",6) == 0){
|
||||
@ -274,13 +270,12 @@ static int closeit(int success)
|
||||
rc = closefile(success);
|
||||
fout = NULL;
|
||||
sbytes = rxbytes - sbytes;
|
||||
endtime = time(NULL);
|
||||
gettimeofday(&endtime, &tz);
|
||||
|
||||
if ((startime = endtime - startime) == 0L)
|
||||
startime = 1L;
|
||||
Syslog('+', "%s %lu bytes in %s (%ld cps)",
|
||||
success?"OK":"dropped after",
|
||||
sbytes, str_time(startime), sbytes / startime);
|
||||
if (success)
|
||||
Syslog('+', "TCP: OK %s", transfertime(starttime, endtime, sbytes, FALSE));
|
||||
else
|
||||
Syslog('+', "TCP: dropped after %ld bytes", sbytes);
|
||||
rcvdbytes += sbytes;
|
||||
return rc;
|
||||
}
|
||||
@ -311,7 +306,7 @@ static int receivefile(char *fn, time_t ft, off_t fs)
|
||||
Syslog('+', "TCP receive \"%s\" (%lu bytes) dated %s",fn,fs,date(ft));
|
||||
strcpy(txbuf,"ROK");
|
||||
fout = openfile(fn, ft, fs, &rxbytes, resync);
|
||||
startime = time(NULL);
|
||||
gettimeofday(&starttime, &tz);
|
||||
sbytes = rxbytes;
|
||||
|
||||
if (fs == rxbytes) {
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "openfile.h"
|
||||
#include "m7recv.h"
|
||||
#include "xmrecv.h"
|
||||
#include "filelist.h"
|
||||
#include "filetime.h"
|
||||
|
||||
|
||||
@ -54,7 +55,8 @@ static char *recvname=NULL;
|
||||
static char *fpath=NULL;
|
||||
static FILE *fp=NULL;
|
||||
static int last;
|
||||
static time_t stm,etm;
|
||||
struct timeval starttime, endtime;
|
||||
struct timezone tz;
|
||||
static off_t startofs;
|
||||
static long recv_blk;
|
||||
|
||||
@ -88,11 +90,11 @@ int closeit(int success)
|
||||
off_t endofs;
|
||||
|
||||
endofs = recv_blk*XMBLKSIZ;
|
||||
etm = time(NULL);
|
||||
if (etm == stm)
|
||||
etm++;
|
||||
Syslog('+', "Xmodem %s %lu bytes in %s (%lu cps)", success?"received":"dropped after",
|
||||
(unsigned long)(endofs-startofs),str_time(etm-stm), (unsigned long)(endofs-startofs)/(etm-stm));
|
||||
gettimeofday(&endtime, &tz);
|
||||
if (success)
|
||||
Syslog('+', "Xmodem: OK %s", transfertime(starttime, endtime, endofs-startofs, FALSE));
|
||||
else
|
||||
Syslog('+', "Xmodem: dropped after %ld bytes", endofs-startofs);
|
||||
rcvdbytes += (unsigned long)(endofs-startofs);
|
||||
fp = NULL;
|
||||
return closefile(success);
|
||||
@ -146,7 +148,7 @@ SM_EDECL
|
||||
int goteot = FALSE;
|
||||
|
||||
Syslog('x', "xmrecv INIT");
|
||||
stm = time(NULL);
|
||||
gettimeofday(&starttime, &tz);
|
||||
recv_blk=-1L;
|
||||
|
||||
memset(&tmpfname, 0, sizeof(tmpfname));
|
||||
|
@ -97,7 +97,8 @@ SM_EDECL
|
||||
int a,a1,a2;
|
||||
int i;
|
||||
time_t seatime;
|
||||
time_t stm,etm;
|
||||
struct timeval starttime, endtime;
|
||||
struct timezone tz;
|
||||
unsigned char header=SOH;
|
||||
struct _xmblk {
|
||||
unsigned char n1;
|
||||
@ -122,7 +123,7 @@ SM_EDECL
|
||||
fl.l_len=0L;
|
||||
|
||||
Syslog('x', "xmsend INIT");
|
||||
stm = time(NULL);
|
||||
gettimeofday(&starttime, &tz);
|
||||
|
||||
/* if we got 'C' than hopefully remote is sealink capable... */
|
||||
|
||||
@ -235,11 +236,8 @@ SM_STATE(sendblk)
|
||||
} else if (ackd_blk < last_blk) {
|
||||
SM_PROCEED(waitack);
|
||||
} else {
|
||||
etm = time(NULL);
|
||||
if (etm == stm)
|
||||
etm++;
|
||||
Syslog('+', "sent %lu bytes in %s (%lu cps)", (unsigned long)st.st_size,str_time(etm-stm),
|
||||
(unsigned long)st.st_size/(etm-stm));
|
||||
gettimeofday(&endtime, &tz);
|
||||
Syslog('+', "Xmodem: OK %s", transfertime(starttime, endtime, st.st_size, TRUE));
|
||||
sentbytes += (unsigned long)st.st_size;
|
||||
fclose(fp);
|
||||
SM_SUCCESS;
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "config.h"
|
||||
#include "emsi.h"
|
||||
#include "openfile.h"
|
||||
#include "filelist.h"
|
||||
#include "openport.h"
|
||||
|
||||
|
||||
@ -52,8 +53,9 @@ static int Usevhdrs;
|
||||
static long rxbytes;
|
||||
static int Eofseen; /* indicates cpm eof (^Z) has been received */
|
||||
static int errors;
|
||||
static time_t startime,etime;
|
||||
static long sbytes;
|
||||
struct timeval starttime, endtime;
|
||||
struct timezone tz;
|
||||
|
||||
#define DEFBYTL 2000000000L /* default rx file size */
|
||||
static long Bytesleft; /* number of bytes of incoming file left */
|
||||
@ -441,11 +443,11 @@ int closeit(int success)
|
||||
rc = closefile(success);
|
||||
fout = NULL;
|
||||
sbytes = rxbytes - sbytes;
|
||||
etime = time(NULL);
|
||||
if ((startime = etime - startime) == 0L)
|
||||
startime = 1L;
|
||||
Syslog('+', "Zmodem: %s %lu bytes in %s (%ld cps)", success?"OK":"dropped after",
|
||||
sbytes, str_time(startime), sbytes / startime);
|
||||
gettimeofday(&endtime, &tz);
|
||||
if (success)
|
||||
Syslog('+', "Zmodem: OK %s", transfertime(starttime, endtime, sbytes, FALSE));
|
||||
else
|
||||
Syslog('+', "Zmodem: dropped after %lu bytes", sbytes);
|
||||
rcvdbytes += sbytes;
|
||||
return rc;
|
||||
}
|
||||
@ -514,7 +516,7 @@ int procheader(char *Name)
|
||||
Syslog('+', "Zmodem: \"%s\" %ld bytes, %s mode %o", Name, Bytesleft, ctt, Filemode);
|
||||
|
||||
fout = openfile(Name,Modtime,Bytesleft,&(long)(rxbytes),resync);
|
||||
startime = time(NULL);
|
||||
gettimeofday(&starttime, &tz);
|
||||
sbytes = rxbytes;
|
||||
|
||||
if (Bytesleft == rxbytes) {
|
||||
|
@ -73,8 +73,9 @@ static int Lskipnocor=0;
|
||||
static int Lzconv=0;
|
||||
static int Beenhereb4;
|
||||
static char Myattn[]={0};
|
||||
static long startime,endtime;
|
||||
static long skipsize;
|
||||
struct timeval starttime, endtime;
|
||||
struct timezone tz;
|
||||
|
||||
extern unsigned long sentbytes;
|
||||
extern int Rxhlen;
|
||||
@ -211,7 +212,7 @@ static int sendzfile(char *ln, char *rn)
|
||||
|
||||
Syslog('+', "Zmodem: send \"%s\" as \"%s\"", MBSE_SS(ln), MBSE_SS(rn));
|
||||
Syslog('+', "Zmodem: size %lu bytes, dated %s", (unsigned long)st.st_size, date(st.st_mtime));
|
||||
startime = time(NULL);
|
||||
gettimeofday(&starttime, &tz);
|
||||
|
||||
sprintf(txbuf,"%s %lu %lo %o 0 0 0", rn,(unsigned long)st.st_size, st.st_mtime+(st.st_mtime%2), st.st_mode);
|
||||
bufl = strlen(txbuf);
|
||||
@ -223,11 +224,8 @@ static int sendzfile(char *ln, char *rn)
|
||||
Syslog('+', "Zmodem: remote skipped %s, is OK",MBSE_SS(ln));
|
||||
return 0;
|
||||
} else if ((rc == OK) && (st.st_size - skipsize)) {
|
||||
endtime = time(NULL);
|
||||
if ((startime = endtime - startime) == 0)
|
||||
startime = 1;
|
||||
Syslog('+', "Zmodem: OK %lu bytes in %s (%ld cps)", (unsigned long)st.st_size - skipsize, str_time(startime),
|
||||
(long)(st.st_size-skipsize) / startime);
|
||||
gettimeofday(&endtime, &tz);
|
||||
Syslog('+', "Zmodem: OK %s", transfertime(starttime, endtime, (unsigned long)st.st_size - skipsize, TRUE));
|
||||
sentbytes += (unsigned long)st.st_size - skipsize;
|
||||
return 0;
|
||||
} else
|
||||
|
Reference in New Issue
Block a user