Skip to content

Commit

Permalink
Merge pull request #53 from dmcoles/v5.3.2
Browse files Browse the repository at this point in the history
V5.3.2
  • Loading branch information
dmcoles authored Sep 1, 2020
2 parents 6aca43f + 5c578e7 commit 74237df
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
14 changes: 8 additions & 6 deletions express.e
Original file line number Diff line number Diff line change
Expand Up @@ -14118,7 +14118,7 @@ PROC httpUpload(uploadFolder: PTR TO CHAR,httpPort)
StrCopy(tempstr,'localhost')
ENDIF

doHttpd(node,tempstr,httpPort,uploadFolder,{aePuts},{readChar},{sCheckInput},x,{ftpUploadFileStart},{ftpUploadFileEnd}, {ftpTransferFileProgress},{ftpDupeCheck},TRUE)
doHttpd(node,tempstr,httpPort,uploadFolder,{aePuts},{readChar},{sCheckInput},x,{ftpUploadFileStart},{ftpUploadFileEnd}, {ftpTransferFileProgress},{ftpDupeCheck},{checkCarrier},TRUE)
serialCacheEnabled:=oldSerCache
END x
ENDPROC
Expand Down Expand Up @@ -14167,7 +14167,7 @@ PROC httpDownload(fileList: PTR TO stdlist, pupdateDownloadStats,httpPort)
oldSerCache:=serialCacheEnabled
flushSerialCache()
serialCacheEnabled:=FALSE
doHttpd(node,tempstr,httpPort,tempDir,{aePuts},{readChar},{sCheckInput},x,{ftpDownloadFileStart},{ftpDownloadFileEnd}, {ftpTransferFileProgress},{ftpDupeCheck},FALSE)
doHttpd(node,tempstr,httpPort,tempDir,{aePuts},{readChar},{sCheckInput},x,{ftpDownloadFileStart},{ftpDownloadFileEnd}, {ftpTransferFileProgress},{ftpDupeCheck},{checkCarrier},FALSE)
serialCacheEnabled:=oldSerCache

->clean up ram links
Expand Down Expand Up @@ -14314,7 +14314,7 @@ PROC ftpUpload(uploadFolder:PTR TO CHAR,ftpPort,ftpDataPort)
StrCopy(tempstr,'localhost')
ENDIF

doftp(node,tempstr,ftpPort,ftpDataPort,uploadFolder,{aePuts},{readChar},{sCheckInput},x,{ftpUploadFileStart},{ftpUploadFileEnd},{ftpTransferFileProgress},{ftpDupeCheck},TRUE)
doftp(node,tempstr,ftpPort,ftpDataPort,uploadFolder,{aePuts},{readChar},{sCheckInput},x,{ftpUploadFileStart},{ftpUploadFileEnd},{ftpTransferFileProgress},{ftpDupeCheck},{checkCarrier},TRUE)
serialCacheEnabled:=oldSerCache
END x

Expand Down Expand Up @@ -14364,7 +14364,7 @@ PROC ftpDownload(fileList: PTR TO stdlist, updateDownloadStats,ftpPort,ftpDataPo
oldSerCache:=serialCacheEnabled
flushSerialCache()
serialCacheEnabled:=FALSE
doftp(node,tempstr,ftpPort,ftpDataPort,tempDir,{aePuts},{readChar},{sCheckInput},x,{ftpDownloadFileStart},{ftpDownloadFileEnd},{ftpTransferFileProgress},{ftpDupeCheck},FALSE)
doftp(node,tempstr,ftpPort,ftpDataPort,tempDir,{aePuts},{readChar},{sCheckInput},x,{ftpDownloadFileStart},{ftpDownloadFileEnd},{ftpTransferFileProgress},{ftpDupeCheck},{checkCarrier},FALSE)
serialCacheEnabled:=oldSerCache

->clean up ram links
Expand Down Expand Up @@ -15013,8 +15013,10 @@ redo1:
IF Recv(telnetSocket,zmodemBuffer,n,0)=n
bufferedBytes:=n
ENDIF
checkCarrier()
JUMP redo1
IF checkCarrier() THEN JUMP redo1
res:=0
ELSE
IF checkCarrier()=FALSE THEN res:=0
ENDIF
ENDIF
UNTIL (res=0) OR (recvd) OR (timeout=0)
Expand Down
12 changes: 8 additions & 4 deletions ftpd.e
Original file line number Diff line number Diff line change
Expand Up @@ -1065,12 +1065,13 @@ PROC createThread(num,node,sockid,ftpData:PTR TO ftpData)
END tags
ENDPROC

EXPORT PROC doftp(node,ftphost,ftpport,ftpdataport,ftppath,aePutsPtr, readCharPtr, sCheckInputPtr, xprInfo, ftpFileStartPtr, ftpFileEndPtr, ftpFileProgressPtr, ftpDupeCheckPtr,uploadMode)
EXPORT PROC doftp(node,ftphost,ftpport,ftpdataport,ftppath,aePutsPtr, readCharPtr, sCheckInputPtr, xprInfo, ftpFileStartPtr, ftpFileEndPtr, ftpFileProgressPtr, ftpDupeCheckPtr,ftpCheckConnection,uploadMode)
DEF r,ftp_s,ftp_c,s,sb
DEF temp[255]:STRING
DEF ftpData:PTR TO ftpData
DEF flg,rchar
DEF tcount=0,i,t
DEF connected=TRUE

ftpData:=NEW ftpData
ftpData.rest:=0
Expand Down Expand Up @@ -1115,6 +1116,9 @@ EXPORT PROC doftp(node,ftphost,ftpport,ftpdataport,ftppath,aePutsPtr, readCharPt
ENDIF
EXIT rchar=3

IF ftpCheckConnection<>NIL THEN connected:=ftpCheckConnection()
EXIT connected=FALSE

ftp_c:=accept(sb,ftp_s,NIL,NIL)
IF(ftp_c< 0)
IF errno(sb)<>35
Expand All @@ -1137,16 +1141,16 @@ EXPORT PROC doftp(node,ftphost,ftpport,ftpdataport,ftppath,aePutsPtr, readCharPt
r:=closeSocket(sb,ftp_s)
ENDIF
IF flg THEN aePuts(ftpData,'\b\n')
IF rchar=3
aePuts(ftpData,'CTRL-C detected, FTP transfer aborted\b\n')
IF (rchar=3) OR (connected=FALSE)
StringF(temp,'\s detected, FTP transfer aborted\b\n',IF rchar=3 THEN 'CTRL-C' ELSE 'Disconnect')
aePuts(ftpData,temp)
FOR i:=0 TO tcount-1
StringF(temp,'ftpThread\d-\d',node,i)
Forbid()
t:=FindTask(temp)
IF t<>NIL THEN Signal(t,SIGBREAKF_CTRL_C)
Permit()
ENDFOR

ELSE
aePuts(ftpData,'FTP transfers complete, all ftp connections closed\b\n')
ENDIF
Expand Down
13 changes: 9 additions & 4 deletions httpd.e
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ PROC extractFileData(sb,socket,httpData:PTR TO httpData,boundary:PTR TO CHAR,con
ENDPROC


EXPORT PROC doHttpd(node,httphost,httpport,httppath,aePutsPtr, readCharPtr, sCheckInputPtr, xprInfo:PTR TO xprData, httpFileStartPtr, httpFileEndPtr, httpFileProgressPtr, httpDupeCheckPtr, uploadMode)
EXPORT PROC doHttpd(node,httphost,httpport,httppath,aePutsPtr, readCharPtr, sCheckInputPtr, xprInfo:PTR TO xprData, httpFileStartPtr, httpFileEndPtr, httpFileProgressPtr, httpDupeCheckPtr, httpCheckConnection, uploadMode)
DEF r,http_s,http_c,sb
DEF temp[255]:STRING
DEF httpData:PTR TO httpData
Expand All @@ -580,6 +580,7 @@ EXPORT PROC doHttpd(node,httphost,httpport,httppath,aePutsPtr, readCharPtr, sChe
DEF fh,buff,l,t,t2,lastpos,pos,cps
DEF asynclib
DEF p,contentLength
DEF connected=TRUE

httpData:=NEW httpData
httpData.rest:=0
Expand Down Expand Up @@ -615,14 +616,17 @@ EXPORT PROC doHttpd(node,httphost,httpport,httppath,aePutsPtr, readCharPtr, sChe
IF r
ioctlSocket(sb,http_s,FIONBIO,[1])
rchar:=0
WHILE (rchar<>3)
WHILE (rchar<>3) AND connected
Delay(10)
rchar:=0
IF sCheckInput(httpData)
rchar:=readChar(httpData)
ENDIF
EXIT rchar=3

IF httpCheckConnection<>NIL THEN connected:=httpCheckConnection()
EXIT connected=FALSE

http_c:=accept(sb,http_s,NIL,NIL)
IF(http_c< 0)
IF errno(sb)<>35
Expand Down Expand Up @@ -735,8 +739,9 @@ EXPORT PROC doHttpd(node,httphost,httpport,httppath,aePutsPtr, readCharPtr, sChe
r:=closeSocket(sb,http_s)
ENDIF
IF flg THEN aePuts(httpData,'\b\n')
IF rchar=3
aePuts(httpData,'CTRL-C detected, HTTP processor closed\b\n')
IF (rchar=3) OR (connected=FALSE)
StringF(temp,'\s detected, , HTTP processor closed\b\n',IF rchar=3 THEN 'CTRL-C' ELSE 'Disconnect')
aePuts(httpData,temp)
ELSE
aePuts(httpData,'HTTP transfers complete, all connections closed\b\n')
ENDIF
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ options=DEBUG IGNORECACHE NILCHECK
compiler=EC
expprogramname=AmiExpress
acpprogramname=ACP
version=5.3.1
version=5.3.2

all: acp express5 jsonimport icon2cfg qwk ftn

Expand Down

0 comments on commit 74237df

Please sign in to comment.