Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2635 → Rev 2629

/kernel/branches/net/applications/ftpd/ftpd.asm
6,8 → 6,6
; GPLv2
;
 
DEBUG = 0 ; if set to one, program will run in a single thread
 
BUFFERSIZE = 8192
 
; using multiple's of 4
62,18 → 60,6
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:
167,12 → 153,8
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:
213,10 → 195,6
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
406,6 → 384,7
ini.get_int, 'ini_get_int'
 
import libio,\
libio.init, 'lib_init',\
file.size, 'file_size',\
file.open, 'file_open',\
file.read, 'file_read',\
415,9 → 394,6
file.find.close, 'file_find_close'
 
 
IncludeIGlobals
 
 
i_end:
 
diff16 "i_end", 0, $
/kernel/branches/net/applications/ftpd/commands.inc
24,6 → 24,18
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
;
76,7 → 88,6
 
 
align 4
iglobal
commands: ; all commands must be in uppercase
 
dd 'ABOR', login_first, login_first, login_first, cmdABOR
113,7 → 124,6
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: