forked from KolibriOS/kolibrios
FTPc: bugfix for passive, other small improvements.
git-svn-id: svn://kolibrios.org@3818 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
66d1328706
commit
4828326119
@ -164,6 +164,7 @@ wait_for_servercommand:
|
|||||||
.no_more_data:
|
.no_more_data:
|
||||||
mov [offset], 0
|
mov [offset], 0
|
||||||
.go_cmd:
|
.go_cmd:
|
||||||
|
lea ecx, [edi - s] ; length of command
|
||||||
xor al, al
|
xor al, al
|
||||||
stosb
|
stosb
|
||||||
|
|
||||||
@ -292,21 +293,29 @@ open_dataconnection: ; only passive for now..
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.fail:
|
.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_write_asciiz, str_err_socket
|
||||||
|
invoke con_set_flags ; reset color
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
error_socket:
|
error_socket:
|
||||||
|
invoke con_set_flags, 0x0c ; print errors in red
|
||||||
invoke con_write_asciiz, str_err_socket
|
invoke con_write_asciiz, str_err_socket
|
||||||
jmp wait_for_keypress
|
jmp wait_for_keypress
|
||||||
|
|
||||||
error_resolve:
|
error_resolve:
|
||||||
|
invoke con_set_flags, 0x0c ; print errors in red
|
||||||
invoke con_write_asciiz, str_err_resolve
|
invoke con_write_asciiz, str_err_resolve
|
||||||
|
|
||||||
wait_for_keypress:
|
wait_for_keypress:
|
||||||
|
invoke con_set_flags, 0x07 ; reset color to grey
|
||||||
invoke con_write_asciiz, str_push
|
invoke con_write_asciiz, str_push
|
||||||
invoke con_getch2
|
invoke con_getch2
|
||||||
|
mcall close, [socketnum]
|
||||||
jmp main
|
jmp main
|
||||||
|
|
||||||
done:
|
done:
|
||||||
@ -320,7 +329,7 @@ exit:
|
|||||||
|
|
||||||
; data
|
; data
|
||||||
str_title db 'FTP client',0
|
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 10
|
||||||
db 'Please enter ftp server address.',10,0
|
db 'Please enter ftp server address.',10,0
|
||||||
|
|
||||||
|
@ -29,6 +29,9 @@ server_parser:
|
|||||||
; cmp dword[s], "421 "
|
; cmp dword[s], "421 "
|
||||||
; je timeout
|
; je timeout
|
||||||
|
|
||||||
|
cmp dword[s], "503 " ; login first
|
||||||
|
je welcome
|
||||||
|
|
||||||
cmp dword[s], "530 " ; password incorrect
|
cmp dword[s], "530 " ; password incorrect
|
||||||
je welcome
|
je welcome
|
||||||
|
|
||||||
@ -58,10 +61,10 @@ login_ok:
|
|||||||
|
|
||||||
pasv_ok:
|
pasv_ok:
|
||||||
|
|
||||||
sub ecx, 5
|
sub ecx, 4
|
||||||
jb .fail
|
jb .fail
|
||||||
mov al, "("
|
mov al, "("
|
||||||
mov edi, s + 5
|
mov edi, s + 4
|
||||||
repne scasb
|
repne scasb
|
||||||
|
|
||||||
mcall socket, AF_INET4, SOCK_STREAM, 0
|
mcall socket, AF_INET4, SOCK_STREAM, 0
|
||||||
@ -86,8 +89,12 @@ pasv_ok:
|
|||||||
|
|
||||||
invoke con_write_asciiz, str_open
|
invoke con_write_asciiz, str_open
|
||||||
mcall connect, [datasocket], sockaddr2, 18
|
mcall connect, [datasocket], sockaddr2, 18
|
||||||
|
; cmp eax, -1
|
||||||
|
; je error_socket
|
||||||
|
jmp wait_for_servercommand
|
||||||
|
|
||||||
.fail:
|
.fail:
|
||||||
|
invoke con_write_asciiz, str_unknown
|
||||||
jmp wait_for_servercommand
|
jmp wait_for_servercommand
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user