Skip to content

Commit

Permalink
ACP
Browse files Browse the repository at this point in the history
1) Added check for EVO 3.5 to allow compiling under Evo 3.5.0

Express
1) Added check for EVO 3.5 to allow compiling under Evo 3.5.0
2) Persist daily byte allowance between calls (Eg if you have increased it by uploading)
3) Fix CPS calculations and display in a more user friendly way in ACP
4) Revert zmodem iac change that was unintentionally made
  • Loading branch information
dmcoles committed Feb 28, 2022
1 parent 6839668 commit 1f663e0
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 20 deletions.
4 changes: 3 additions & 1 deletion ACP.e
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'*jsonParser',
'*jsonCreate',
'*stringlist',
'*acpversion'
'*acpversion'

ENUM ERR_NONE,ERR_ALREADY_RUNNING,ERR_STARTUP, ERR_VALIDATE,ERR_NO_DISKFONT,ERR_FDS_RANGE

Expand All @@ -52,7 +52,9 @@ CONST MAX_LINE=255
CONST FIONBIO=$8004667e
CONST EWOULDBLOCK=35

#ifndef EVO_3_5_0
CONST TAG_END=0
#endif

CONST NODECONFIG=1
CONST RUNMCP=2
Expand Down
2 changes: 2 additions & 0 deletions axconsts.e
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

OPT MODULE

#ifndef EVO_3_5_0
EXPORT CONST TAG_DONE=0
#endif

EXPORT CONST LISTENQ=100
EXPORT CONST FIONBIO=$8004667e
Expand Down
2 changes: 1 addition & 1 deletion axobjects.e
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ EXPORT OBJECT user
translatorID: CHAR
msgBaseRJoin:INT
confYM9: LONG ->not used
beginLogCall : LONG ->not used
todaysBytesLimit : LONG
protocol: CHAR ->not really used
uucpa: CHAR
lineLength: CHAR
Expand Down
32 changes: 26 additions & 6 deletions express.e
Original file line number Diff line number Diff line change
Expand Up @@ -14268,6 +14268,7 @@ PROC updateZDisplay()
DEF tempstr[255]:STRING
DEF xpos,tags2:PTR TO LONG,vi
DEF v1,v2
DEF d1,d2
IF netMailTransfer
IF zModemInfo.currentOperation=ZMODEM_DOWNLOAD
StringF(tempstr,'[Node \d] NetMail Send Window',node)
Expand Down Expand Up @@ -14361,7 +14362,26 @@ PROC updateZDisplay()
zmodemStatPrint(tempstr)

ENDIF
StringF(tempstr,'\r\d[7]',zModemInfo.cps)

IF zModemInfo.cps>900000000
d1:=Shr(zModemInfo.cps,30) AND $FF
d2:=Shr(zModemInfo.cps,25) AND $1f
d2:=Shr(Mul(d2,10),5)
StringF(tempstr,'\r\d[2].\d[1]g/s',d1,d2)
ELSEIF zModemInfo.cps>900000
d1:=Shr(zModemInfo.cps,20) AND $3FF
d2:=Shr(zModemInfo.cps,15) AND $1f
d2:=Shr(Mul(d2,10),5)
IF d1>100 THEN StringF(tempstr,'\r\d[3]m/s',d1) ELSE StringF(tempstr,'\r\d[2].\d[1]m/s',d1,d2)
ELSEIF zModemInfo.cps>900
d1:=Shr(zModemInfo.cps,10) AND $3FF
d2:=Shr(zModemInfo.cps,5) AND $1f
d2:=Shr(Mul(d2,10),5)
IF d1>100 THEN StringF(tempstr,'\r\d[3]k/s',d1) ELSE StringF(tempstr,'\r\d[2].\d[1]k/s',d1,d2)
ELSE
StringF(tempstr,'\r\d[4]cps',zModemInfo.cps)
ENDIF

sendACPCommand2(tempstr,JH_TRANSFERCPS)
ENDPROC

Expand Down Expand Up @@ -14493,10 +14513,10 @@ PROC httpDownload(fileList: PTR TO stdlist, pupdateDownloadStats,httpPorts)
Execute(linkStr,NIL,NIL)
ENDPROC

PROC ftpUploadFileStart(fileName:PTR TO CHAR,filelen)
PROC ftpUploadFileStart(fileName:PTR TO CHAR,resumefrom)
sendMasterUpload(FilePart(fileName))
zModemInfo.filesize:=filelen
zModemInfo.resumePos:=0
zModemInfo.filesize:=0
zModemInfo.resumePos:=resumefrom
zModemInfo.transPos:=0
ftptime:=getSystemTime()
updateZDisplay()
Expand Down Expand Up @@ -15658,7 +15678,7 @@ repbuff:
ADD.L A2,A0
CLR.L D0
MOVE.B (A0)+,D0
SUB.L A2,A0
SUB.L A2,A0

MOVE.L lastIAC,D2
BNE.S testiac
Expand All @@ -15669,7 +15689,7 @@ repbuff:

testiac:
CMP.B #1,D2
BNE.S test1 ->testiac2
BNE.S testiac2

CMP.B #255,D0
BNE.S test1
Expand Down
25 changes: 13 additions & 12 deletions ftpd.e
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ PROC setSockOpt(sb,s,level,optname,optval,optlen )
MOVEM.L (A7)+,D1-D7/A0-A6
ENDPROC D0

PROC uploadFileStart(ftpData:PTR TO ftpData,fn,pos)
PROC uploadFileStart(ftpData:PTR TO ftpData,fn,resumepos)
DEF fs
fs:=ftpData.uploadFileStart
MOVE.L fn,-(A7)
MOVE.L pos,-(A7)
MOVE.L resumepos,-(A7)
fs()
ADD.L #8,A7
ENDPROC
Expand Down Expand Up @@ -444,16 +444,17 @@ PROC freeFileList(fileList:PTR TO stdlist)
ENDPROC

PROC calcCPS(pd,t,t2)
DEF cps
DEF cps,td
cps:=0

IF t<t2
IF (pd<0) OR (pd>$1000000)
pd:=Shr(pd,4) AND $fffffff
cps:=Div(Mul(pd,50),(t2-t))
cps:=Shl(cps,4)
td:=t2-t
IF (pd<0) OR (pd>$10000000)
pd:=Shr(pd,1) AND $7fffffff
td:=Div(td,50)
IF td<1 THEN td:=1
cps:=Shl(Div(pd,td),1)
ELSE
cps:=Div(Mul(pd,50),(t2-t))
cps:=Div(Mul(pd,50),td)
ENDIF
ELSE
cps:=pd
Expand Down Expand Up @@ -1469,7 +1470,7 @@ PROC cmdStor(sb,ftp_c,data_s,data_c,filename:PTR TO CHAR,ftpData:PTR TO ftpData)
writeLineEx(sb,ftp_c,temp)
ELSE
IF ftpData.uploadFileStart<>NIL
uploadFileStart(ftpData,filename,0)
uploadFileStart(ftpData,filename,ftpData.restPos)
ENDIF

buff:=New(32768)
Expand Down Expand Up @@ -1526,7 +1527,7 @@ PROC cmdStor(sb,ftp_c,data_s,data_c,filename:PTR TO CHAR,ftpData:PTR TO ftpData)
pos:=Seek(fh,0,OFFSET_CURRENT)
ENDIF
t2:=fastSystemTime()
cps:=calcCPS(ftpData.restPos-pos,startTime,t2)
cps:=calcCPS(pos-ftpData.restPos,startTime,t2)
uploadFileProgress(ftpData,filename,pos,cps)
ENDIF
IF asynclib<>NIL
Expand Down Expand Up @@ -1714,7 +1715,7 @@ PROC cmdRetr(sb,ftp_c,data_s,data_c,filename:PTR TO CHAR,ftpData:PTR TO ftpData)
pos:=Seek(fh,0,OFFSET_CURRENT)
ENDIF
t2:=fastSystemTime()
cps:=calcCPS(ftpData.restPos-pos,startTime,t2)
cps:=calcCPS(pos-ftpData.restPos,startTime,t2)
downloadFileProgress(ftpData,fn,pos,cps)
ENDIF
IF asynclib<>NIL
Expand Down

0 comments on commit 1f663e0

Please sign in to comment.