Commit graph

84 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
1debf0f688
expose all modules again 2024-02-27 13:38:35 -05:00
Simon Cruanes
ec3dec6b72
wip: bugfixes 2024-02-26 16:28:31 -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
da55098a7a
remove some uses of scanf in parsing 2024-02-22 19:00:01 -05:00
Simon Cruanes
86f1b9025d
add optional dependency on logs 2024-01-23 23:32:20 -05:00
Simon Cruanes
b9faebffe4 use a resource pool to recycle buffers 2023-06-23 17:58:11 -04:00
Simon Cruanes
5ba1ff0de4 add Tiny_httpd_pool 2023-06-23 17:58:11 -04:00
Simon Cruanes
a32297ac6c
add Tiny_httpd_io module, abstraction over IOs
abstract channels, and abstract TCP server.
2023-06-20 23:03:30 -04:00
Simon Cruanes
04fb648576
update docs 2023-05-24 15:21:49 -04:00
Simon Cruanes
0908d71e19
ocamlformat 2023-05-23 17:40:18 -04:00
Simon Cruanes
7d74dacbea
add @since 2022-04-08 11:40:14 -04:00
Simon Cruanes
4bf7c267d6
fix: module Html was not exposed 2022-04-02 23:48:42 -04:00
Simon Cruanes
91e835ea60
docstrings 2022-03-30 12:55:03 -04:00
Simon Cruanes
d5f9eacc81 split code into more modules 2022-03-16 20:40:38 -04:00
Simon Cruanes
3a7019c7cb
prepare for 0.11 2022-01-01 00:17:18 -05:00
Simon Cruanes
4aaa61f622
add ?get_time_s param to create 2021-12-31 20:43:20 -05:00
Simon Cruanes
ce4b5f0a11
some small code improvements 2021-12-20 09:49:44 -05:00
craff
6dceabdd6c Revert "use bigstring and map_file"
This reverts commit 3067120539.
2021-12-19 00:54:17 -10:00
craff
3067120539 use bigstring and map_file 2021-12-19 00:29:56 -10:00
craff
613c9ae7c3 Add a module to server static files 2021-12-17 18:55:06 -10:00
Simon Cruanes
b684835901
store http version in request, and close connections when needed
cases include:
- http 1.0 and no "connection: keep-alive"
- http 1.1 and "connection: close"
2021-12-16 23:19:48 -05:00
Simon Cruanes
accdb1e0ac
Update src/Tiny_httpd.mli 2021-12-16 00:26:18 -05:00
Simon Cruanes
7b14cbd6a7
rename time into start_time 2021-12-16 00:26:07 -05:00
craff
4770e3e729 Timing start of request 2021-12-15 18:14:17 -10:00
Simon Cruanes
5827328993
feat: add ?middlewares param to create 2021-12-12 17:06:46 -05:00
Simon Cruanes
9e26576740
breaking: more getter/setters for request/response, change signature
some setters now take request last, to favor composition with |>
2021-12-12 17:06:46 -05:00
Simon Cruanes
ba31534551
feat: pass buf_size in many places, set default buf_size to 16kb 2021-12-12 17:06:46 -05:00
Simon Cruanes
8655200bd7
deprecate, add todos 2021-12-12 17:06:45 -05:00
Simon Cruanes
6b0000eb6e
feat: add a notion of Middleware
this subsumes and deprecates the encoding/decoding callbacks.
2021-12-12 17:06:43 -05:00
Simon Cruanes
2d2ffc722a
remove deprecated path handlers based on scanf 2021-12-12 17:01:51 -05:00
craff
10b64c2a16 put back active_connections 2021-12-11 23:50:06 -10:00
craff
b539b4f9ba timout using socket options 2021-12-11 23:48:27 -10:00
Simon Cruanes
89344f46f0
feat(server-sent): add a close() function 2021-12-11 10:01:55 -05:00
Simon Cruanes
dc72dad5db
revert: remove timeout handling for now
This reverts commit 6536bfeeb3.
2021-12-11 09:32:55 -05:00
Simon Cruanes
f316e66c15
switch from "available" to "active" connections 2021-12-11 09:10:29 -05:00
craff
97eeaf96dc make accessible to the end user the number of available connections 2021-12-08 17:54:08 -10:00
Christophe Raffalli
024a774f39
Update src/Tiny_httpd.mli
Co-authored-by: Simon Cruanes <simon.cruanes.2007@m4x.org>
2021-12-08 16:25:07 -10:00
craff
4c7d27dadd Added a max_keep_alive and moved to a non blocking reading of request not to loose connection slot.
Default is max_keep_alive = -1.0 which keeps the original behaviour.
2021-12-08 11:46:01 -10:00
Simon Cruanes
a58372b9a7
add a @since 2021-09-25 15:35:57 -04:00
Yawar Amin
ce61ac2afd feat: allow socket activation
This enables passing in an existing socket e.g. from systemd,[1] instead
of creating a new socket when running the server.

[1] https://github.com/juergenhoetzel/ocaml-systemd
2021-09-25 01:41:32 -04:00
Simon Cruanes
9961bd1b29 prepare for 0.9 2021-07-18 00:07:43 -04:00
Simon Cruanes
95d9bd10ef fix: do not set content-length for server-sent events 2021-07-17 22:09:45 -04:00
Simon Cruanes
62d583553e allow extra headers in server-sent events 2021-07-17 22:09:45 -04:00
Simon Cruanes
17d8f37c93 feat: remove async for now, finish server sent events 2021-07-17 22:09:45 -04:00
Simon Cruanes
2e0f08366f wip: feat: server-sent events, and asynchronous handlers 2021-07-16 01:12:39 -04:00
Simon Cruanes
91e9323671 doc 2021-07-15 23:47:31 -04:00
Simon Cruanes
70f1205880 doc: fix examples 2020-12-08 00:26:08 -05:00
Simon Cruanes
e267838d23 fix doc 2020-11-17 14:32:45 -05:00