mirror of
https://github.com/Doczom/simple-httpd.git
synced 2025-09-21 22:53:54 +02:00
Add support units in server
Added support for loading and calling server modules. Added the download of the configuration file(httpd.ini). Several bugs have been fixed. Added simple example for generating server units and mime types file.
This commit is contained in:
@@ -249,30 +249,25 @@ file_server:
|
||||
; char* stdcall Get_MIME_Type(FILED* fd); //path is ASCIIZ string
|
||||
Get_MIME_Type:
|
||||
push esi edi
|
||||
mov eax, [esp + 4*2 + 4]
|
||||
mov eax, [eax + FILED.end_path]
|
||||
mov edx, [GLOBAL_DATA.MIME_types_arr]
|
||||
mov esi, [esp + 4*2 + 4]
|
||||
sub edx, 8
|
||||
.next:
|
||||
add edx, 8
|
||||
mov ecx, [esi + FILED.end_path] ;pointer to \0 full path
|
||||
|
||||
cmp dword[edx], 0
|
||||
jz .found
|
||||
|
||||
mov edi, [edx]
|
||||
movzx eax, byte[edi]
|
||||
sub ecx, eax
|
||||
@@:
|
||||
inc edi
|
||||
mov al, [edi]
|
||||
cmp byte[ecx], al
|
||||
jne .next
|
||||
|
||||
inc ecx
|
||||
test al, al
|
||||
jne @b
|
||||
|
||||
.found:
|
||||
mov eax, [edx + 4]
|
||||
pop edi esi
|
||||
mov esi, [edx]
|
||||
add edx, 4
|
||||
cmp dword[esi], 0
|
||||
jz .other
|
||||
|
||||
mov edi, eax
|
||||
movzx ecx, byte [esi]
|
||||
inc esi
|
||||
sub edi, ecx
|
||||
repe cmpsb
|
||||
jne @b
|
||||
@@:
|
||||
mov eax, esi
|
||||
pop edi esi
|
||||
ret 4
|
||||
.other:
|
||||
add esi, 4
|
||||
jmp @b
|
Reference in New Issue
Block a user