files
simple-httpd/settings.inc
Doczom 3d3fa69481 Added basic files
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.
2023-11-12 16:02:12 +05:00

52 lines
1.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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