Commit graph

420 commits

Author SHA1 Message Date
Jonah Beckford
14a48756a8 Do not use sigprocmask on Windows
Fixes #85
2024-04-18 11:20:40 -04:00
Simon Cruanes
bc34363f60
expose Bad_req in Server 2024-04-16 14:45:21 -04:00
Simon Cruanes
e5191f0fd7
fix: give the correct code+error if protocol upgrade fails 2024-04-15 15:04:44 -04:00
Simon Cruanes
284d1f7400
add optional middlewares to tiny_httpd_ws 2024-04-15 12:11:46 -04:00
Simon Cruanes
241d9aeaf1
add Head_middleware.trivial 2024-04-15 12:09:37 -04:00
Simon Cruanes
e1368525d8
feat: add Head_middleware.t; accept it for SSE/websocket 2024-04-15 12:05:48 -04:00
Simon Cruanes
19554068b5
feat ws: expose Close_connection 2024-04-05 16:14:23 -04:00
Simon Cruanes
e4303b2fd4
remove debug messages 2024-04-05 13:49:10 -04:00
Simon Cruanes
2292128d30
perf: optim in read_line 2024-04-05 13:23:41 -04:00
Simon Cruanes
3393c13c00
fix websocket: properly remember the offset in current frame
not doing so means we always unmask from offset 0, which means we might
use the wrong index in the mask if we do, say, `read()=3` followed by
another read: the second one would start from mask[0] instead of
mask[3], producing raw unfiltered garbage.
2024-04-05 13:21:54 -04:00
Simon Cruanes
5301ed40ea
fix websocket: read 16-bit length as unsigned 2024-04-04 22:11:08 -04:00
Simon Cruanes
7c765a181d
remove dead code 2024-04-04 16:27:06 -04:00
Simon Cruanes
dbd00259da
feat ws: a bit of cleanup, expose masking primitive 2024-04-04 15:54:55 -04:00
Simon Cruanes
84adbb13b2
cleanup 2024-04-03 21:36:14 -04:00
Simon Cruanes
d8ff243e8d
feat ws: pass the whole request to the handler 2024-04-02 14:35:57 -04:00
Simon Cruanes
4b845bf019
debug in websocket 2024-04-02 14:10:16 -04:00
Simon Cruanes
8dd86993d7
remove potentially security-leaking debug line 2024-03-26 13:01:02 -04:00
Simon Cruanes
a309c657c8
fix: 1xx codes are also success 2024-03-25 14:24:17 -04:00
Simon Cruanes
fca8ba46e1
make sure to flush underlying stream 2024-03-25 10:18:27 -04:00
Simon Cruanes
9864c53b95
wip 2024-03-15 11:04:16 -04:00
Simon Cruanes
fe9596f4fe
fix ws: missing flush 2024-03-12 10:39:38 -04:00
Simon Cruanes
05dcf77981
feat: add Request.pp_with which is a customizable printer 2024-02-29 10:31:15 -05:00
Simon Cruanes
eada4cde08
less verbose logs for unix server 2024-02-28 16:24:15 -05:00
Simon Cruanes
7de89bd555
expose Response.Bad_req 2024-02-28 16:11:16 -05:00
Simon Cruanes
5a38ffdce7
comment 2024-02-28 15:16:14 -05:00
Simon Cruanes
91951ca5a1
logging 2024-02-28 15:05:23 -05:00
Simon Cruanes
7e790c0161
fix: parse query when there's a fragment indication 2024-02-28 15:01:13 -05:00
Simon Cruanes
179d41cd9a
logging 2024-02-28 09:46:34 -05:00
Simon Cruanes
bcc208cf59
fix middlewares: merge-sort per-request middleares and global ones 2024-02-27 15:42:30 -05:00
Simon Cruanes
1debf0f688
expose all modules again 2024-02-27 13:38:35 -05:00
Simon Cruanes
384515a594
dir: handle html 2024-02-27 11:00:42 -05:00
Simon Cruanes
950f0e734f
fix bugs 2024-02-26 22:50:30 -05:00
Simon Cruanes
ec3dec6b72
wip: bugfixes 2024-02-26 16:28:31 -05:00
Simon Cruanes
e3047a7b6a
fixes 2024-02-26 15:59:23 -05:00
Simon Cruanes
adf4c6815f
finish refactor 2024-02-26 15:48:10 -05:00
Simon Cruanes
22f158ccd8
fix websocket 2024-02-26 14:06:01 -05:00
Simon Cruanes
0d750cd86c
fix prometheus 2024-02-26 14:05:56 -05:00
Simon Cruanes
04be73ee00
refactor the rest 2024-02-26 13:55:20 -05:00
Simon Cruanes
8e2cf23e27
add html sub-library 2024-02-26 13:42:18 -05:00
Simon Cruanes
5f321774e1
wip: use Iostream for IOs; add hmap to request; refactor 2024-02-26 13:41:55 -05:00
Simon Cruanes
8f33a77017
Merge pull request #80 from c-cube/wip-fix-http-of-dir-2024-02-18
improvements for http_of_dir
2024-02-22 22:20:43 -05:00
Simon Cruanes
da55098a7a
remove some uses of scanf in parsing 2024-02-22 19:00:01 -05:00
Simon Cruanes
5018df5ff8
fix: avoid collisions in Mime_ private module 2024-02-22 18:33:57 -05:00
Simon Cruanes
225c21b4cc
error handling, and bugfix (idempotent closing of Unix.fd) 2024-02-22 18:23:18 -05:00
Simon Cruanes
d56ffb3a08
http_of_dir: ability to setup socket timeout 2024-02-21 22:09:18 -05:00
Simon Cruanes
353f0925b4
server: better logging, better error handling 2024-02-21 22:08:58 -05:00
Simon Cruanes
88b9f1e411
fix stream: fix a bug, use a loop in another place 2024-02-21 22:07:49 -05:00
Simon Cruanes
01faca284f
fix IO: use a loop for IO.Input.of_unix_fd; handle nonblocking 2024-02-21 22:07:12 -05:00
Simon Cruanes
e69f1b7c8c
feat dir: only read content of regular files
no need to look into sockets, pipes, etc.
2024-02-21 22:06:24 -05:00
Simon Cruanes
d9b3731207
feat: optional dep on magic-mime for http_of_dir 2024-02-21 22:03:31 -05:00