mirror of
https://github.com/Doczom/simple-httpd.git
synced 2025-09-21 02:50:09 +02:00
Added basic files: - httpd.asm - main loop server, include other files; - httpd_lib - file for data(constants, response string, headers etc.); - parser.inc - function for generation structure of HTTP request; - settings.inc - description request structure and function for read config file; - sys_func.inc - list function, for worked with sockets, filesystem and other functions system; NOTE: The server does not work in this version, but the main loop and the parser work.
52 lines
1.8 KiB
HTML
52 lines
1.8 KiB
HTML
|
||
|
||
struct CONNECT_DATA ; 16*4 = 64 bytes
|
||
socket dd 0 ; номер сокета подключения
|
||
sockaddr dd 16/4 ; socaddr connection
|
||
buffer_request dd 0 ; pointer to buffer for geting message socket
|
||
request_size dd 0 ; size geted data from client
|
||
tmp_req_size dd 0 ; для парсера
|
||
buffer_response dd 0 ; pointer to buffwr for resp message
|
||
http_method dd 0 ; указатель на строку
|
||
http_verion dd 0 ; указатель на строку
|
||
num_headers dd 0 ; number items in REQUEST_DATA
|
||
http_headers dd 0 ; указатель на массив REQUEST_DATA
|
||
uri_scheme dd 0 ; указатель на схему
|
||
uri_authority dd 0 ; pointer to struct ?
|
||
uri_path dd 0 ; указатель на декодированный путь к ресурсу(без параметров)
|
||
num_uri_args dd 0 ;
|
||
uri_arg dd 0 ; pointer to array REQUEST_DATA аргументов uri строк
|
||
uri_fragment dd 0 ; указатель на строку
|
||
message_body dd 0 ; указатель на тело http запроса
|
||
ends
|
||
|
||
struct REQUEST_DATA
|
||
ptr_name dd 0 ;
|
||
ptr_data dd 0 ;
|
||
ends
|
||
|
||
; Load server config
|
||
; ecx - path to file
|
||
; OUT: eax - 0 or err_code
|
||
load_settings:
|
||
; check file path
|
||
sub esp, 40 ; size file info struct
|
||
push esp
|
||
push ecx
|
||
call FileInfo
|
||
lea esp, [esp + 40]
|
||
test eax, eax
|
||
jnz .err
|
||
|
||
ret
|
||
.err:
|
||
ret
|
||
|
||
; Config format:
|
||
; Standart INI file:
|
||
; - ";" or "#" comments
|
||
; - [name] name of group
|
||
; - arg=val params in group
|
||
|
||
|