FTPc: bugfix for passive, other small improvements.

git-svn-id: svn://kolibrios.org@3818 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-07-12 20:35:53 +00:00
parent 66d1328706
commit 4828326119
2 changed files with 19 additions and 3 deletions

View File

@ -164,6 +164,7 @@ wait_for_servercommand:
.no_more_data:
mov [offset], 0
.go_cmd:
lea ecx, [edi - s] ; length of command
xor al, al
stosb
@ -292,21 +293,29 @@ open_dataconnection: ; only passive for now..
ret
.fail:
invoke con_get_flags
push eax
invoke con_set_flags, 0x0c ; print errors in red
invoke con_write_asciiz, str_err_socket
invoke con_set_flags ; reset color
ret
error_socket:
invoke con_set_flags, 0x0c ; print errors in red
invoke con_write_asciiz, str_err_socket
jmp wait_for_keypress
error_resolve:
invoke con_set_flags, 0x0c ; print errors in red
invoke con_write_asciiz, str_err_resolve
wait_for_keypress:
invoke con_set_flags, 0x07 ; reset color to grey
invoke con_write_asciiz, str_push
invoke con_getch2
mcall close, [socketnum]
jmp main
done:
@ -320,7 +329,7 @@ exit:
; data
str_title db 'FTP client',0
str_welcome db 'FTP client for KolibriOS v0.08',10
str_welcome db 'FTP client for KolibriOS v0.09',10
db 10
db 'Please enter ftp server address.',10,0

View File

@ -29,6 +29,9 @@ server_parser:
; cmp dword[s], "421 "
; je timeout
cmp dword[s], "503 " ; login first
je welcome
cmp dword[s], "530 " ; password incorrect
je welcome
@ -58,10 +61,10 @@ login_ok:
pasv_ok:
sub ecx, 5
sub ecx, 4
jb .fail
mov al, "("
mov edi, s + 5
mov edi, s + 4
repne scasb
mcall socket, AF_INET4, SOCK_STREAM, 0
@ -86,8 +89,12 @@ pasv_ok:
invoke con_write_asciiz, str_open
mcall connect, [datasocket], sockaddr2, 18
; cmp eax, -1
; je error_socket
jmp wait_for_servercommand
.fail:
invoke con_write_asciiz, str_unknown
jmp wait_for_servercommand