FTPc: added pwd command, bugfixes

git-svn-id: svn://kolibrios.org@3794 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-07-09 21:59:02 +00:00
parent 1531cabb38
commit 7cc4d5555e
2 changed files with 23 additions and 7 deletions

View File

@ -194,6 +194,8 @@ wait_for_usercommand:
; read string
mov esi, s
invoke con_gets, esi, 256
invoke con_write_asciiz, str4 ; newline
invoke con_set_flags, 0x07
cmp dword[s], "list"
@ -208,6 +210,9 @@ wait_for_usercommand:
cmp dword[s], "retr"
je cmd_retr
cmp dword[s], "pwd" + 10 shl 24
je cmd_pwd
; cmp dword[s], "stor"
; je cmd_stor
@ -284,7 +289,7 @@ exit:
; data
title db 'FTP client',0
str1 db 'FTP client for KolibriOS v0.03',10,10,'Please enter ftp server address.',10,0
str1 db 'FTP client for KolibriOS v0.04',10,10,'Please enter ftp server address.',10,0
str2 db '> ',0
str3 db 'Resolving ',0
str4 db 10,0
@ -298,8 +303,8 @@ str12 db 'Waiting for welcome message.',10,0
str_user db "username: ",0
str_pass db "password: ",0
str_unknown db "unknown command",10,0
str_help db "available commands:",10,10
db "help list",10,0
str_help db "available commands:",10
db "help list cwd retr pwd",10,10,0
str_open db "opening data socket",10,0
@ -343,15 +348,19 @@ import console, \
i_end:
align 4
status db ?
active_passive db ?
align 4
socketnum dd ?
datasocket dd ?
buffer_ptr rb BUFFERSIZE
buffer_ptr2 rb BUFFERSIZE
status db ?
offset dd ?
size dd ?
buffer_ptr rb BUFFERSIZE+1
buffer_ptr2 rb BUFFERSIZE+1
s rb 1024
mem:

View File

@ -4,7 +4,7 @@ cmd_list:
mov dword[s], "LIST"
mov byte[s+4], 0x0a
mcall send, [socketnum], s, 5
mcall send, [socketnum], s, 5, 0
jmp wait_for_servercommand
@ -16,6 +16,13 @@ cmd_help:
jmp wait_for_usercommand
cmd_pwd:
mov dword[s], "PWD" + 10 shl 24
mcall send, [socketnum], s, 4, 0
jmp wait_for_servercommand
cmd_cwd:
mov dword[s], "CWD "