HTTPGET : many bug fixing, many remaining....?

This commit is contained in:
burniouf 2023-12-15 18:59:47 +01:00
parent cce21ed742
commit 4f27e8c3b0

View File

@ -70,6 +70,7 @@ L.SA.REMOTE.AD .DA SA.REMOTE+S.SOCKADDR.ADDR
L.MSG.IPKO .DA MSG.IPKO
L.MSG.USAGE .DA MSG.USAGE
L.MSG.CRLF .DA MSG.CRLF
L.MSG.NULL .DA MSG.NULL
L.MSG.UNKNOWN .DA MSG.UNKNOWN
L.MSG.CONNECT .DA MSG.CONNECT
L.MSG.SKTKO .DA MSG.SKTKO
@ -166,6 +167,7 @@ CS.RUN.HOSTOK jsr CS.RUN.GETNEXTARG
lda (ZPPtr),y
cmp #'a'
bcc .11
cmp #'z'+1
bcs .11
@ -193,10 +195,10 @@ CS.RUN.HOSTOK jsr CS.RUN.GETNEXTARG
bne CS.RUN.ESYN
jsr CS.RUN.GETNEXTARG
bcs .9
bcs CS.RUN.ESYN2
>SYSCALL LoadTxtFile
bcs .9
bcs CS.RUN.RTS
>STYA ZPReqBufLen
stx hReqBuf
@ -206,13 +208,13 @@ CS.RUN.HOSTOK jsr CS.RUN.GETNEXTARG
jmp CS.RUN.HOSTOK
.3 cmp #'O'
bne .9
bne CS.RUN.ESYN2
lda ZPFileName+1
bne CS.RUN.ESYN2
jsr CS.RUN.GETNEXTARG
bcs .9
bcs CS.RUN.ESYN2
>STYA ZPFileName
jmp CS.RUN.HOSTOK
@ -221,10 +223,7 @@ CS.RUN.ESYN2 lda #E.SYN
sec
rts
*--------------------------------------
CS.RUN.ARGSOK lda ZPReqBufPtr+1
beq CS.RUN.ESYN2
>PUSHW L.MSG.CONNECT
CS.RUN.ARGSOK >PUSHW L.MSG.CONNECT
ldx #0
.1 >PUSHB SA.REMOTE+S.SOCKADDR.ADDR,x
@ -342,8 +341,14 @@ CS.RUN.GETNEXTARG
>SYSCALL ArgV
rts
*--------------------------------------
CS.RUN.ENCODE >LDYA ZPReqBufPtr
>STYA ZPPtr
CS.RUN.ENCODE ldy ZPReqBufPtr
lda ZPReqBufPtr+1
bne .10
>LDYA L.MSG.NULL
>STYA ZPReqBufPtr
.10 >STYA ZPPtr
inc ZPEncodedBufLen for ending \0
@ -749,7 +754,8 @@ MSG.USAGE .CS "Usage : HTTPGET <ip|host> [port]\r\n"
.CS " -U : Url\r\n"
.CS " -F : UrlFile\r\n"
.CS " -O : OutputFile"
MSG.CRLF .CZ "\r\n"
MSG.CRLF .CS "\r\n"
MSG.NULL .DA #0
MSG.UNKNOWN .CZ "%s: Unknown host\r\n"
MSG.CONNECT .CZ "Connecting to %d.%d.%d.%d:%D (%s)..."
MSG.SKTKO .CZ "Failed to Open Socket."