From 0b7957db671400ee34f8f597b409f792e5300186 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Fri, 20 Sep 2024 10:51:45 +0200 Subject: stuff and debug delete --- main.asm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'main.asm') diff --git a/main.asm b/main.asm index 8c19651..03148b4 100644 --- a/main.asm +++ b/main.asm @@ -12,9 +12,10 @@ struc db [data] segment writable readable connect_header db 'HTTP/1.1 200 OK', 13, 10 db 'Content-Type: text/html', 13, 10 + db 'Server: asmsite', 13, 10 db 'Connection: close', 13, 10 db 13, 10 - db 'asmsiteHello, World!', 10 + db 'asmsiteHello, World!', 10 connect_header_len = $ - connect_header stat_msg db 'Get file stats', 10 @@ -50,6 +51,13 @@ serveraddr_len = $ - serveraddr.sin_family clientaddr servaddr_in clientaddr_len dd serveraddr_len +struc timespec +{ + .time dq 0 + .time_nano dd 0 +} +sleep_time timespec + segment readable executable entry _main @@ -92,7 +100,7 @@ _main: jl error ls_write STDOUT, listen_msg, listen_msg.size - ls_listen qword [socketfd], 5 + ls_listen qword [socketfd], 4096 cmp rax, 0 jl error @@ -106,6 +114,10 @@ listen: ls_write qword [connfd], connect_header, connect_header_len + ;; mov [sleep_time.time], 10 + ;; mov [sleep_time.time_nano], 1000 + ;; ls_nanosleep sleep_time.time, 0 + ls_close qword [connfd] jmp listen -- cgit v1.2.3