Commit Graph

21 Commits

Author SHA1 Message Date
cdo 4f9353ad86 Remove superfluous comment 2022-10-14 11:41:52 +01:00
cdo 076bda3dc3 Close files after sending 2022-10-14 11:41:43 +01:00
cdo 0311c858c3 Send incomplete response instead of dropping request for most errors 2022-10-14 11:39:36 +01:00
cdo 58c7b6feab Terminate and send response outside of file/dir branch 2022-10-14 11:33:31 +01:00
cdo 120a97189f Simplify Makefile 2022-10-14 11:24:55 +01:00
cdo 06d92b3d25 Handle file requests 2022-10-14 11:24:39 +01:00
cdo 5c21a0a8e2 Get directory response code to work with full resource path 2022-10-14 10:38:12 +01:00
cdo 543858d01d Test whether requested resource is a file or directory 2022-10-14 10:38:12 +01:00
cdo a3cdde2c34 Construct full path of requested resource
Also detects .. in the selector string, as this could be used to see
files outside of srvroot, otherwise.
2022-10-14 10:27:02 +01:00
cdo f6871a7922 Remove trailing slash from srvroot, if present 2022-10-14 10:27:02 +01:00
cdo f171687fda Add test srvroot directory to .gitignore 2022-10-14 10:27:02 +01:00
cdo 5c03ed950f Send srvroot listing for empty selector 2022-10-14 10:27:02 +01:00
cdo fa0dbed44c Write an empty response to clients 2022-10-14 10:27:02 +01:00
cdo 1a13289da9 Improve error handling 2022-10-14 10:27:02 +01:00
cdo f7583f538e Read selector from client 2022-10-14 10:27:02 +01:00
cdo 2ab4966773 Add explanatory comments above each major block in main.c 2022-10-13 12:52:27 +01:00
cdo 88642c0c3f Make accept() error handling a little neater 2022-10-13 12:09:35 +01:00
cdo 21de6cd3e7 Accept incoming connections inside main loop 2022-10-13 12:07:24 +01:00
cdo b39e263499 Initialize socket before main loop 2022-10-13 12:06:25 +01:00
cdo fffd1c3fff Add main loop and signal handler 2022-10-13 11:57:29 +01:00
cdo 948c3971ee Create project structure 2022-10-12 15:24:21 +01:00