From 1531cabb3871e99e64cb0f4e7712b35a0e8cbc29 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Tue, 9 Jul 2013 21:31:47 +0000 Subject: [PATCH] FTPc: added retr command (just print to console for now). git-svn-id: svn://kolibrios.org@3793 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/network/ftpc/ftpc.asm | 6 +++++ programs/network/ftpc/usercommands.inc | 36 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/programs/network/ftpc/ftpc.asm b/programs/network/ftpc/ftpc.asm index b99ff7f000..5aee1a7cf0 100644 --- a/programs/network/ftpc/ftpc.asm +++ b/programs/network/ftpc/ftpc.asm @@ -205,6 +205,12 @@ wait_for_usercommand: cmp dword[s], "cwd " je cmd_cwd + cmp dword[s], "retr" + je cmd_retr + +; cmp dword[s], "stor" +; je cmd_stor + invoke con_write_asciiz, str_unknown jmp wait_for_usercommand diff --git a/programs/network/ftpc/usercommands.inc b/programs/network/ftpc/usercommands.inc index 6cd08fd28a..b1ca064635 100644 --- a/programs/network/ftpc/usercommands.inc +++ b/programs/network/ftpc/usercommands.inc @@ -28,4 +28,40 @@ cmd_cwd: mcall send, [socketnum], s, , 0 + jmp wait_for_servercommand + + +cmd_retr: + + call open_dataconnection + + mov dword[s], "RETR" + mov byte[s+4], " " + + mov ecx, 256 + xor al, al + mov edi, s + repne scasb + lea esi, [edi - s - 1] + + mcall send, [socketnum], s, , 0 + + jmp wait_for_servercommand + + +cmd_stor: + + call open_dataconnection + + mov dword[s], "STOR" + mov byte[s+4], " " + + mov ecx, 256 + xor al, al + mov edi, s + repne scasb + lea esi, [edi - s - 1] + + mcall send, [socketnum], s, , 0 + jmp wait_for_servercommand \ No newline at end of file