Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2629 → Rev 2635

/kernel/branches/net/applications/ftpd/commands.inc
24,18 → 24,6
buffer rb BUFFERSIZE
ends
 
 
macro sendFTP str {
local .string, .length, .label
xor edi, edi
mcall send, [ebp + thread_data.socketnum], .string, .length
jmp @f
.string db str, 13, 10
.length = $ - .string
@@:
 
}
 
;------------------------------------------------
; parse_cmd
;
88,6 → 76,7
 
 
align 4
iglobal
commands: ; all commands must be in uppercase
 
dd 'ABOR', login_first, login_first, login_first, cmdABOR
124,6 → 113,7
dd 'TYPE', login_first, login_first, login_first, cmdTYPE
dd 'USER', cmdUSER, cmdUSER, cmdUSER, cmdUSER.2
db 0 ; end marker
endg
 
align 4
login_first:
/kernel/branches/net/applications/ftpd/ftpd.asm
6,6 → 6,8
; GPLv2
;
 
DEBUG = 0 ; if set to one, program will run in a single thread
 
BUFFERSIZE = 8192
 
; using multiple's of 4
60,6 → 62,18
include '../libio.inc'
 
include '../network.inc'
 
macro sendFTP str {
local string, length
xor edi, edi
mcall send, [ebp + thread_data.socketnum], string, length
 
iglobal
string db str, 13, 10
length = $ - string
\}
}
 
include 'commands.inc'
 
start:
153,8 → 167,12
test eax, eax ; network event?
jz .checkconsole
 
if DEBUG
jmp threadstart
else
mcall 51, 1, threadstart, 0 ; Start a new thread for every incoming connection
; NOTE: upon initialisation of the thread, stack will not be available!
end if
jmp mainloop
 
.checkconsole:
195,6 → 213,10
je thread_exit
mov [ebp + thread_data.socketnum], eax
 
if DEBUG
mcall close, [socketnum] ; close the listening socket
end if
 
mov [ebp + thread_data.state], STATE_CONNECTED
mov [ebp + thread_data.permissions], 0
mov [ebp + thread_data.mode], MODE_NOTREADY
384,7 → 406,6
ini.get_int, 'ini_get_int'
 
import libio,\
libio.init, 'lib_init',\
file.size, 'file_size',\
file.open, 'file_open',\
file.read, 'file_read',\
394,6 → 415,9
file.find.close, 'file_find_close'
 
 
IncludeIGlobals
 
 
i_end:
 
diff16 "i_end", 0, $