Commit graph

168 commits

Author SHA1 Message Date
Simon Cruanes
4bdca82fce
wip: try to make non-block read, block write work 2021-12-11 09:29:41 -05:00
Simon Cruanes
6536bfeeb3
fix: when reading from unix FD, use a loop to handle signals 2021-12-11 09:13:16 -05:00
Simon Cruanes
f316e66c15
switch from "available" to "active" connections 2021-12-11 09:10:29 -05:00
Simon Cruanes
6dcae7f996
Merge pull request #23 from craff/master
max_keep_alive and non blocking reading of request
2021-12-11 09:10:22 -05:00
craff
c3265af08f moved back acquire before accept but inside the try ... with ... one never knowns 2021-12-10 12:49:51 -10:00
craff
97eeaf96dc make accessible to the end user the number of available connections 2021-12-08 17:54:08 -10:00
craff
9b4a1b1197 remove mutex to get available_connections 2021-12-08 17:47:53 -10:00
craff
8da6967039 Merge branch 'master' of github.com:craff/tiny_httpd 2021-12-08 16:41:07 -10:00
craff
e87428ae51 release semaphore does not return anything anymore 2021-12-08 16:38:59 -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
9e9fe32347 only set non blocking for reading request, not to write answer 2021-12-08 12:07:35 -10:00
Christophe Raffalli
b394527709
Merge branch 'c-cube:master' into master 2021-12-08 11:48:58 -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
ff70d7df8b
prepare for 0.10 2021-11-30 09:45:27 -05:00
Simon Cruanes
ac05b9eaa1
Merge pull request #22 from craff/master
Unix.accept may raise an exception
2021-11-30 09:43:22 -05:00
craff
a65734e8cc Merge branch 'master' of github.com:craff/tiny_httpd 2021-11-29 23:39:33 -10:00
craff
19a4bad231 use _debug and better message 2021-11-29 23:38:28 -10:00
Simon Cruanes
50f225638d
Update src/Tiny_httpd.ml 2021-11-29 22:37:19 -05:00
craff
6ccd8314a3 Unix.accept may raise an exception (typicall Unix.EINTR, even with sigpipe blocked ?)
This avoids the server to stop
2021-11-29 15:35:41 -10:00
Simon Cruanes
a58372b9a7
add a @since 2021-09-25 15:35:57 -04:00
Simon Cruanes
70dcf8269a
Merge pull request #19 from yawaramin/master
feat: allow socket activation
2021-09-25 15:34:26 -04:00
Simon Cruanes
0e05b8cac6
Update src/Tiny_httpd.ml 2021-09-25 14:41:42 -04:00
Yawar Amin
8414efc3e0 Adjust implementation
Only do things that are relevant for binding a socket if we actually
should.
2021-09-25 02:03:28 -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
6c810fb0ed readme 2021-07-18 00:05:44 -04:00
Simon Cruanes
3848b25aae
Merge pull request #17 from c-cube/wip-server-sent
server sent events
2021-07-17 22:10:49 -04:00
Simon Cruanes
b292664b2e test: expect test for server-send events (linux only) 2021-07-17 22:10:15 -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
ce552cafdd add some example programs to exercize 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
a3edf75a05 opam fix from @kit_ty_kate 2021-06-04 09:32:10 -04:00
Simon Cruanes
19cbda8571 test is only for tiny_httpd 2021-06-02 21:06:38 -04:00
Simon Cruanes
3068d07df4 add missing opam dep
thanks to @kit-ty-kate
2021-06-02 19:48:19 -04:00
Simon Cruanes
36cf26f7b2 prepare for 0.8 2021-06-02 15:50:05 -04:00
Simon Cruanes
8a914448c9 avoid dune stanza for inline tests
simpler to just do the testing ourselves
2021-06-02 15:39:50 -04:00
Simon Cruanes
e5d5f60e67 chore: try to fix CI 2021-06-01 10:53:33 -04:00
Simon Cruanes
9d8439b96a chore: bump to ocaml 4.04 2021-06-01 10:25:07 -04:00
Simon Cruanes
ff5795c389 workaround for css/js in http_of_dir 2021-06-01 09:59:55 -04:00
Anurag Soni
6b57540b50
Validate header key's character set (#15)
* Validate header key's character set
2021-05-14 12:10:33 -04:00
Simon Cruanes
2340cf0bf7 chore: tell dune to stop pestering with warn-error 2021-05-03 13:23:56 -04:00
Simon Cruanes
ddd337cc61 perf: simpler parsing of headers 2021-05-03 12:39:19 -04:00
Simon Cruanes
0138f22826 use 4.08 for ci 2021-02-01 11:23:41 -05:00
Simon Cruanes
06ef1fc787 ci stuff 2021-02-01 11:15:49 -05:00
Simon Cruanes
07d479c305 chore: try to fix the freakin CI 2021-01-27 10:50:38 -05:00
Simon Cruanes
2804b7f3f1 chore: remove travis 2021-01-27 10:30:54 -05:00
Simon Cruanes
21f4743320 fix(urlencode): encode non ascii chars 2020-12-15 22:16:33 -05:00