improved timing, better ftp server compatibility
This commit is contained in:
parent
e0c7598647
commit
f6d1312fc4
|
@ -138,13 +138,11 @@ PRI ftplogin(username, password) | pwreq, respOK
|
||||||
strTemp[4] := 0
|
strTemp[4] := 0
|
||||||
if strcomp(@strTemp, string("230 "))
|
if strcomp(@strTemp, string("230 "))
|
||||||
respOk := TRUE
|
respOk := TRUE
|
||||||
ios.print(string("Antwort korrekt."))
|
quit
|
||||||
ios.printnl
|
|
||||||
elseif strcomp(@strTemp, string("331 "))
|
elseif strcomp(@strTemp, string("331 "))
|
||||||
pwreq := TRUE
|
pwreq := TRUE
|
||||||
respOk := TRUE
|
respOk := TRUE
|
||||||
ios.print(string("Antwort korrekt."))
|
quit
|
||||||
ios.printnl
|
|
||||||
ifnot respOK
|
ifnot respOK
|
||||||
ios.print(string("Keine oder falsche Antwort vom FTP-Server erhalten."))
|
ios.print(string("Keine oder falsche Antwort vom FTP-Server erhalten."))
|
||||||
ios.printnl
|
ios.printnl
|
||||||
|
@ -206,6 +204,7 @@ PRI ftppasv : port | i, k, port256, port1
|
||||||
strTemp[i] := 0
|
strTemp[i] := 0
|
||||||
if (port256 & port1)
|
if (port256 & port1)
|
||||||
port := (num.FromStr(@strTemp+port256, num#DEC) * 256) + num.FromStr(@strTemp+port1, num#DEC)
|
port := (num.FromStr(@strTemp+port256, num#DEC) * 256) + num.FromStr(@strTemp+port1, num#DEC)
|
||||||
|
quit
|
||||||
|
|
||||||
if (port == 0)
|
if (port == 0)
|
||||||
ios.print(string("FTP-Server-Fehler beim Öffnen des Passiv-Ports"))
|
ios.print(string("FTP-Server-Fehler beim Öffnen des Passiv-Ports"))
|
||||||
|
@ -223,7 +222,7 @@ PRI ftppasv : port | i, k, port256, port1
|
||||||
ios.printnl
|
ios.printnl
|
||||||
return(0)
|
return(0)
|
||||||
|
|
||||||
PRI ftpretr | len
|
PRI ftpretr | len, respOK
|
||||||
|
|
||||||
if sendStr(string("TYPE I",13,10))
|
if sendStr(string("TYPE I",13,10))
|
||||||
ios.print(string("Fehler beim Senden des Types"))
|
ios.print(string("Fehler beim Senden des Types"))
|
||||||
|
@ -248,7 +247,19 @@ PRI ftpretr | len
|
||||||
if sendStr(string("RETR ")) || sendStr(@filename) || sendStr(string(13,10))
|
if sendStr(string("RETR ")) || sendStr(@filename) || sendStr(string(13,10))
|
||||||
ios.print(string("Fehler beim Senden des Filenamens"))
|
ios.print(string("Fehler beim Senden des Filenamens"))
|
||||||
return -1
|
return -1
|
||||||
ifnot getResponse(string("150 "))
|
respOK := FALSE
|
||||||
|
repeat until readLine == -1
|
||||||
|
ios.print(string(" < "))
|
||||||
|
ios.print(@strTemp)
|
||||||
|
ios.printnl
|
||||||
|
strTemp[4] := 0
|
||||||
|
if strcomp(@strTemp, string("150 "))
|
||||||
|
respOk := TRUE
|
||||||
|
quit
|
||||||
|
elseif strcomp(@strTemp, string("125 "))
|
||||||
|
respOk := TRUE
|
||||||
|
quit
|
||||||
|
ifnot respOK
|
||||||
ios.print(string("Keine oder falsche Antwort vom FTP-Server erhalten."))
|
ios.print(string("Keine oder falsche Antwort vom FTP-Server erhalten."))
|
||||||
ios.printnl
|
ios.printnl
|
||||||
return(-1)
|
return(-1)
|
||||||
|
@ -286,17 +297,16 @@ PRI getResponse (strOk) : respOk | len
|
||||||
strTemp[strsize(strOk)] := 0
|
strTemp[strsize(strOk)] := 0
|
||||||
if strcomp(@strTemp, strOk)
|
if strcomp(@strTemp, strOk)
|
||||||
respOk := TRUE
|
respOk := TRUE
|
||||||
ios.print(string("Antwort korrekt."))
|
quit
|
||||||
ios.printnl
|
|
||||||
|
|
||||||
return respOk
|
return respOk
|
||||||
|
|
||||||
PRI readLine | i, ch
|
PRI readLine | i, ch
|
||||||
|
|
||||||
repeat i from 0 to 126
|
repeat i from 0 to 126
|
||||||
ch := ios.lan_rxtime(handleidx_control, 500)
|
ch := ios.lan_rxtime(handleidx_control, 2000)
|
||||||
if ch == 13
|
if ch == 13
|
||||||
ch := ios.lan_rxtime(handleidx_control, 500)
|
ch := ios.lan_rxtime(handleidx_control, 2000)
|
||||||
if ch == -1 or ch == 10
|
if ch == -1 or ch == 10
|
||||||
quit
|
quit
|
||||||
strTemp[i] := ch
|
strTemp[i] := ch
|
||||||
|
|
Loading…
Reference in New Issue